Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
tsa::order Class Referenceabstract

Class order is the library's internal order representation. Users are not intended to interact with this class directly and its member functions are not documented. Use class order_ref to interact with orders. More...

#include <TSAOrder.h>

Inheritance diagram for tsa::order:
tsa::object

Classes

struct  order_info
 Information about an order. More...
 

Public Types

Static Public Member Functions

static std::string to_string (order::status)
 returns a string representation of order::state.
 
static std::string to_string (order::time_in_force)
 returns a string representation of order::time_in_force.
 
static std::string to_string (order::action)
 returns a string representation order::action.
 
static std::string to_string (order::type)
 returns a string representation order::type.
 
static std::string to_string (order::exec_interval)
 returns a string representation order::exec_interval.
 

Additional Inherited Members

- Public Member Functions inherited from tsa::object
 object (void)
 Constructor.
 
virtual ~object (void)
 Destructor.
 
const char * class_name (void) const
 Returns the class name as returned by the 'Real Time Type Information' (RTTI) mechanism. More...
 
bool has_same_class_as (const object &other) const
 Returns true if self has the same type as other object. More...
 

Detailed Description

Class order is the library's internal order representation. Users are not intended to interact with this class directly and its member functions are not documented. Use class order_ref to interact with orders.

Member Enumeration Documentation

Order action.

Enumerator
buy 

The order is a 'buy' order.

sell 

The order is a 'sell' order.

oa_undefined 

internal use

The order 'execution interval' determines when an order will be executed. Note: By default market orders are to be executed immediately, which means at the 'open' of the 'next' bar (in relation to the bar that just closed). 'Stop' and 'limit' orders are to be executed anytime between as well as during the next bar's 'opening' and 'closing' intervals. For research purposes, it is possible to mark orders for execution at 'this_close' (meaning the closing price of the bar that has already closed). This only makes sense when researching end- of-day strategies, where deployment could require the order to be placed manually, just before the close, with the assumption that the actual close will not change strategy signals.

Enumerator
at_open 

At the 'open' of next bar.

at_close 

At the 'close' of the next bar.

during_bar 

During the entire next 'bar'.

this_close 

At the current-bar's close (This is only relevant for simulations on end-of-day data. Not to be used for deployment).

Order state.

Enumerator
created 

The order has been created but has not been transmitted, and can still be modified.

pending_submit 

The order has been transmitted. It is has not yet been confirmed as submitted but we must assume that is has and that it is active. order::is_active() returns true.

pre_submitted 

The order is held by the platform until elected for submission. This can happen when the order is submitted outside trading hours, or when a particular order type is simulated by the platform.

submitted 

The order is confirmed 'working' at the exchange. It may already be filled.

pending_cancel 

A cancellation request has been sent, but the order is not yet confirmed cancelled. In this state the order may already be filled.

pending_cancel_replace 

A request to cancel-replace the order has been made, but no confirmation has been received.

paused 

The exchange has notified that the order is paused, due to exchange issues.

filled 

The order has been filled in its entirety.

cancelled 

The order is confirmed cancelled and is no longer active.

rejected 

The order has been rejected.

Time-in-force (TIF). By default all orders are placed as good-till-cancel (GTC) orders. See instrument::default_time_in_force(order::time_in_force).

Enumerator
gtc 

Good Till Cancel (default).

day 

Expires at the end of day/session.

user_defined_tif 

User defined time-in-force.

Order type.

Enumerator
market 

'Market' order.

stop 

'Stop' order (includes 'stop limit' orders).

limit 

'Limit' order.

ot_undefined 

internal use