![]() |
Trading System API
3.0
Library for Simulating and Deploying Trading and Investment Strategies
|
Allows users to manually submit record data for the next bar. This is useful for testing new functionality. More...
#include <TSACompInput.h>
Public Member Functions | |
manual_ohlcv (void) | |
Constructor. | |
virtual | ~manual_ohlcv (void) |
Destructor. | |
virtual void | isa__get_price_bar (const date_time &date_time, instrument_price_bar &priceBar) override |
Abstract member to be implemented by derived classes. In derived classes, this member should populate priceBar with data corresponding to the current strategy date_time. If no corresponding price data exists for the given strategy date_time, then the most recently available price data may be returned, or else an exception must be thrown. More... | |
virtual date_time | isa__get_record_timestamp (void) override |
This member must be overridden, and must return the current record's timestamp which may or may not correspond to the strategy's current timestamp. More... | |
virtual bool | isa__get_time_of_next_bar (date_time &nextDateTime, const date_time ¤tDateTime) override |
Abstract member which should return the timestamp of the strategy's next price bar (nextDateTime) when given the strategy's currentDateTime. The member should return true if successful. More... | |
virtual bool | isa__implements_scheduling (void) const override |
Query if this object isa implements scheduling. More... | |
virtual std::string | isa__stream_name (void) const override |
Abstract member. In derived classes should return the data source name (e.g series_base table name). More... | |
void | set_next_bar (const date_time &ts, double o, double h, double l, double c, double v) |
Call this member from strategy::on_bar_close() to define the next bar's timestamp, price and volume data. More... | |
![]() | |
in_stream_adaptor (void) | |
Constructor. | |
~in_stream_adaptor (void) | |
Destructor. | |
size_t | close_field_position (void) const |
Returns the index of the 'close' field. More... | |
virtual void | cmp__evaluate_bar (const date_time &) override |
virtual void | cmp__finalize (void) override |
void | current_value (const variant &value) |
Sets the current value. More... | |
bool | get_is_strategy_scheduler (void) const |
Returns true. More... | |
size_t | high_field_position (void) const |
Returns the index of the 'high' field. More... | |
bool | is_connected (void) const |
Returns true if the object state is 'connected'. More... | |
size_t | low_field_position (void) const |
Returns the index of the 'low' field. More... | |
size_t | open_field_position (void) const |
Returns the index of the 'open' field. More... | |
void | set_connected (bool is_connected_flag=true) |
Sets the object state to is_connected_flag. More... | |
void | stream_name (const std::string &stream_name) |
Sets the data source_name. More... | |
const std::string & | stream_name (void) const |
Returns the data source name. More... | |
virtual void | isa__set_forward_shift (size_t) |
![]() | |
virtual void | cmp__post_evaluate_bar (const date_time &) |
bool | is_registered_with_strategy (void) const |
void | register_with_strategy (strategy *) |
![]() | |
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... | |
Allows users to manually submit record data for the next bar. This is useful for testing new functionality.
|
overridevirtual |
Abstract member to be implemented by derived classes. In derived classes, this member should populate priceBar with data corresponding to the current strategy date_time. If no corresponding price data exists for the given strategy date_time, then the most recently available price data may be returned, or else an exception must be thrown.
date_time | The date time. | |
[in,out] | priceBar | The price bar. |
Implements tsa::in_stream_adaptor.
|
overridevirtual |
This member must be overridden, and must return the current record's timestamp which may or may not correspond to the strategy's current timestamp.
Implements tsa::in_stream_adaptor.
|
overridevirtual |
Abstract member which should return the timestamp of the strategy's next price bar (nextDateTime) when given the strategy's currentDateTime. The member should return true if successful.
This member is important when 'externally scheduling' a strategy. If the derived component is set as TIME_MASTER, then the strategy will retrieve the 'scheduling sequence' via this member.
It is important to properly handle the condition that arises when the strategy date_time reaches the timestamp of last record in the source table, at which point this member must return false.
Scheduling a strategy internal beyond this point won't be possible.
[in,out] | nextDateTime | The next date time. |
currentDateTime | The current date time. |
Implements tsa::in_stream_adaptor.
|
overridevirtual |
Query if this object isa implements scheduling.
Implements tsa::in_stream_adaptor.
|
overridevirtual |
Abstract member. In derived classes should return the data source name (e.g series_base table name).
Implements tsa::in_stream_adaptor.
void tsa::manual_ohlcv::set_next_bar | ( | const date_time & | ts, |
double | o, | ||
double | h, | ||
double | l, | ||
double | c, | ||
double | v | ||
) |
Call this member from strategy::on_bar_close() to define the next bar's timestamp, price and volume data.
ts | Next bar's timestamp. Must be higher than current timestamp |
o | Next bar's open price. |
h | Next bar's high price. |
l | Next bar's low price. |
c | Next bar's close price. |
v | Next bar's volume. |