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

What has filled on one order, and what it cost. More...

#include <algotradelib/src/core/types.hpp>

Collaboration diagram for algotradelib::OrderExecution:

Public Attributes

Decimal64 filled_quantity_
 The quantity filled so far; zero if nothing has filled. Always present.
std::optional< Decimal64 > average_filled_price_
 The average fill price, only where the broker supplies it.
std::optional< Money > filled_amount_
 The value of the fills, as the broker computed it.
std::optional< Money > commission_
 Commission charged so far, if the broker reports it per order.
std::optional< Money > tax_
 Transaction tax charged so far, if the broker reports it per order.
std::optional< std::chrono::system_clock::time_point > filled_at_
 When the most recent fill happened, if the broker timestamps it.
std::optional< Date > settlement_date_
 The settlement date the broker stated.

Detailed Description

What has filled on one order, and what it cost.

Warning
Test whether an order filled with filled_quantity_, never with whether an amount is present: KIS reports a zero filled_amount_ on unfilled orders, and Toss leaves amounts empty when the broker sent null.

At Toss, an amount sent as null is empty, but a missing field fails the listing as a protocol error.

Definition at line 1981 of file types.hpp.

Member Data Documentation

◆ average_filled_price_

std::optional<Decimal64> algotradelib::OrderExecution::average_filled_price_

The average fill price, only where the broker supplies it.

KIS's real-server open-order listing never sets it, even on a partly filled order; on a demo account, where the listing is built from the day's history, it is set once something has filled.

Definition at line 1990 of file types.hpp.

◆ commission_

std::optional<Money> algotradelib::OrderExecution::commission_

Commission charged so far, if the broker reports it per order.

Definition at line 1998 of file types.hpp.

◆ filled_amount_

std::optional<Money> algotradelib::OrderExecution::filled_amount_

The value of the fills, as the broker computed it.

Present on every KIS row, and zero when nothing has filled; empty at Toss when not reported.

Definition at line 1996 of file types.hpp.

◆ filled_at_

std::optional<std::chrono::system_clock::time_point> algotradelib::OrderExecution::filled_at_

When the most recent fill happened, if the broker timestamps it.

Definition at line 2002 of file types.hpp.

◆ filled_quantity_

Decimal64 algotradelib::OrderExecution::filled_quantity_

The quantity filled so far; zero if nothing has filled. Always present.

Definition at line 1983 of file types.hpp.

◆ settlement_date_

std::optional<Date> algotradelib::OrderExecution::settlement_date_

The settlement date the broker stated.

Definition at line 2004 of file types.hpp.

◆ tax_

std::optional<Money> algotradelib::OrderExecution::tax_

Transaction tax charged so far, if the broker reports it per order.

Definition at line 2000 of file types.hpp.


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