algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::runner::Fill Struct Reference

One execution of an order the strategy placed, delivered to on_fill. More...

#include <algotradelib/src/strategy/event.hpp>

Collaboration diagram for algotradelib::runner::Fill:

Public Attributes

std::string order_id_
 The broker's order id.
InstrumentId instrument_
 The instrument traded.
OrderSide side_ {OrderSide::BUY}
 The side of the order.
Decimal64 quantity_
 The quantity of this execution, not the order's running total.
Decimal64 price_
 The execution price.
std::string tag_
 The tag of the intent that produced the order.
std::chrono::system_clock::time_point at_ {}
 When the execution happened.

Detailed Description

One execution of an order the strategy placed, delivered to on_fill.

Each execution is its own event, so a partial fill arrives as several; quantity_ is this execution's quantity, and the order's running total is in the portfolio. order_id_ names the order by the broker's id where the source states one; a replay's fills leave it empty, and live, on_fill does not fire (Runner::on_fill_never_fires). Look orders up in ctx.portfolio().

Warning
A backtest delivers fills, but the shipped live loop never does: no broker inquiry produces a Fill. A strategy that reacts to fills in on_fill (for example, to set a stop) does nothing live. Live, executions show up through on_order_update and the portfolio.

Definition at line 407 of file event.hpp.

Member Data Documentation

◆ at_

std::chrono::system_clock::time_point algotradelib::strategy::Fill::at_ {}

When the execution happened.

Definition at line 421 of file event.hpp.

◆ instrument_

The instrument traded.

Definition at line 411 of file event.hpp.

◆ order_id_

The broker's order id.

Definition at line 409 of file event.hpp.

◆ price_

The execution price.

Definition at line 417 of file event.hpp.

◆ quantity_

The quantity of this execution, not the order's running total.

Definition at line 415 of file event.hpp.

◆ side_

The side of the order.

Definition at line 413 of file event.hpp.

◆ tag_

The tag of the intent that produced the order.

Definition at line 419 of file event.hpp.


The documentation for this struct was generated from the following file: