Parent class for 'in-stream adaptors'. in_stream object rely on adaptors for access to underlying data source. In order to support access to new data sources, new in_stream_adaptor derived classes must be implemented.
More...
#include <TSAStreams.h>
|
virtual void | isa__set_forward_shift (size_t) |
|
virtual void | isa__set_position (const date_time &)=0 |
|
virtual bool | isa__field_exists (const std::string &)=0 |
|
virtual type_t | isa__field_type (size_t)=0 |
|
virtual size_t | isa__field_index (const std::string &)=0 |
|
virtual size_t | isa__field_count ()=0 |
|
virtual const std::string & | isa__field_name (size_t)=0 |
|
virtual date_time | isa__get_record_timestamp (void)=0 |
| 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 date_time | isa__begin (void)=0 |
|
virtual date_time | isa__end (void)=0 |
|
virtual size_t | isa__size (void)=0 |
|
virtual void | isa__on_open (void)=0 |
|
virtual variant | isa__get_variant (size_t idx)=0 |
|
virtual double | isa__get_double (size_t idx)=0 |
|
virtual void | isa__update_value_at_position (size_t idx)=0 |
|
virtual void | isa__get_price_bar (const date_time &date_time, instrument_price_bar &priceBar)=0 |
| 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 bool | isa__get_time_of_next_bar (date_time &nextDateTime, const date_time ¤tDateTime)=0 |
| 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 std::string | isa__stream_name (void) const =0 |
| Abstract member. In derived classes should return the data source name (e.g series_base table name). More...
|
|
virtual bool | isa__implements_scheduling (void) const =0 |
| Query if this object isa implements scheduling. More...
|
|
Parent class for 'in-stream adaptors'. in_stream object rely on adaptors for access to underlying data source. In order to support access to new data sources, new in_stream_adaptor derived classes must be implemented.
size_t tsa::in_stream_adaptor::close_field_position |
( |
void |
| ) |
const |
Returns the index of the 'close' field.
- Returns
- A size_t.
void tsa::in_stream_adaptor::current_value |
( |
const variant & |
value | ) |
|
Sets the current value.
- Parameters
-
bool tsa::in_stream_adaptor::get_is_strategy_scheduler |
( |
void |
| ) |
const |
|
inline |
Returns true.
- Returns
- true if it succeeds, false if it fails.
size_t tsa::in_stream_adaptor::high_field_position |
( |
void |
| ) |
const |
Returns the index of the 'high' field.
- Returns
- A size_t.
bool tsa::in_stream_adaptor::is_connected |
( |
void |
| ) |
const |
Returns true if the object state is 'connected'.
- Returns
- true if connected, false if not.
virtual void tsa::in_stream_adaptor::isa__get_price_bar |
( |
const date_time & |
date_time, |
|
|
instrument_price_bar & |
priceBar |
|
) |
| |
|
pure virtual |
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.
- Parameters
-
| date_time | The date time. |
[in,out] | priceBar | The price bar. |
Implemented in tsa::mem_table, tsa::manual_ohlcv, and tsa::random_walk_stream.
virtual date_time tsa::in_stream_adaptor::isa__get_record_timestamp |
( |
void |
| ) |
|
|
pure virtual |
virtual bool tsa::in_stream_adaptor::isa__get_time_of_next_bar |
( |
date_time & |
nextDateTime, |
|
|
const date_time & |
currentDateTime |
|
) |
| |
|
pure virtual |
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.
- Parameters
-
[in,out] | nextDateTime | The next date time. |
| currentDateTime | The current date time. |
- Returns
- true if it succeeds, false if it fails.
Implemented in tsa::mem_table, tsa::manual_ohlcv, and tsa::random_walk_stream.
virtual bool tsa::in_stream_adaptor::isa__implements_scheduling |
( |
void |
| ) |
const |
|
pure virtual |
virtual std::string tsa::in_stream_adaptor::isa__stream_name |
( |
void |
| ) |
const |
|
pure virtual |
size_t tsa::in_stream_adaptor::low_field_position |
( |
void |
| ) |
const |
Returns the index of the 'low' field.
- Returns
- A size_t.
size_t tsa::in_stream_adaptor::open_field_position |
( |
void |
| ) |
const |
Returns the index of the 'open' field.
- Returns
- A size_t.
void tsa::in_stream_adaptor::set_connected |
( |
bool |
is_connected_flag = true | ) |
|
Sets the object state to is_connected_flag.
- Parameters
-
is_connected_flag | true if this object is connected flag. |
void tsa::in_stream_adaptor::stream_name |
( |
const std::string & |
stream_name | ) |
|
Sets the data source_name.
- Parameters
-
stream_name | Name of the stream. |
const std::string & tsa::in_stream_adaptor::stream_name |
( |
void |
| ) |
const |