Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
Strategy And Instrument Properties (DSL)

Functions

sref< int64_t > tsa::BAR_COUNT (void)
 Returns the strategy's current bar-count. Returns the same value as strategy::bar_count().
 
template<typename T >
sref< T > tsa::invoke_function (const std::function< T(void)> &member_func)
 Generic way of invoking an object member function from DSL. The following function returns the strategy's current timestamp: More...
 
sref< double > tsa::NET_PROFIT (void)
 Returns the strategy's current 'net profit'.
 
sref< date_time > tsa::TIMESTAMP (void)
 Returns the strategy's current timestamp (The timestamp of the current bar).
 

Detailed Description

Function Documentation

template<typename T >
sref<T> tsa::invoke_function ( const std::function< T(void)> &  member_func)

Generic way of invoking an object member function from DSL. The following function returns the strategy's current timestamp:

sref<date_time> TIMESTAMP(void) {
strategy* strategy_ptr = strategy_context::strategy_ptr();
return invoke_function<date_time>(std::bind(&strategy::timestamp, strategy_ptr));
}

.

Template Parameters
Ttemplate arg.
Parameters
member_funcThe member function.
Returns
A sref<T>