Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
tsa::chart Class Reference

Class representing a timeseries chart. More...

#include <TSCWrapper.h>

Inheritance diagram for tsa::chart:
tsa::object tsa::component

Classes

class  pane
 Class representing a 'pane' on a chart. More...
 

Public Member Functions

 chart (void)
 Constructor.
 
virtual ~chart (void)
 Destructor.
 
virtual void cmp__evaluate_bar (const date_time &) override
 
virtual void cmp__finalize (void) override
 
pane_proxy get_pane (size_t _idx)
 Returns a pane_proxy instance which facilitates setting numerous chart pane properties. A pane_proxy is a 'handle' on an internally managed pane object.
 
int max_bars_per_chart (void) const
 Returns the maximum number of bars to be displayed on a chart when saving as a chart 'book'.
 
void max_bars_per_chart (int)
 Sets the maximum number of bars to be displayed on a chart when saving as a chart 'book'. See save_png_book().
 
int max_charts_to_save (void) const
 Returns the maximum number of charts the will be saved when saving as a chart 'book'. See max_charts_to_save(int max_num_charts).
 
void max_charts_to_save (int max_num_charts)
 Sets the maximum number of charts to save when saving as a chart 'book'.
 
void name (const tsa::string &_s)
 Sets the chart name which is used to name the chart directory when saving the chart as a chart book.
 
const std::stringname (void) const
 Returns the chart name.
 
chartoperator<< (const chart::pane &pane)
 Adds the given pane to the chart. The pane settings are read once on the first bar, and is ignored on all subsequent bars.
 
chartoperator<< (const char *name)
 Adds a name to the object most recently added to the chart. This name is read once on the first bar, and is ignored on all subsequent bars.
 
chartoperator<< (const string &name)
 Adds a name to the object most recently added to the chart. This name is read once on the first bar, and is ignored on all subsequent bars.
 
chartoperator<< (double value)
 Adds a line plot to chart starting at given value. Same effect as inserting a plot::line object except that all line properties are left as default.
 
chartoperator<< (int64_t value)
 Adds a line plot to chart starting at given value. Same effect as inserting a plot::line object except that all line properties are left as default.
 
chartoperator<< (const plot::plot_base &)
 Adds a plot object to the chart. (e.g. plot::area)
 
chartoperator<< (const functor::auto_plot &functor)
 Used to plot a functor object (if derived from auto_plot)
 
template<typename T >
chartoperator<< (const functor::parent< T > &_functor)
 Used to plot a functor object (if derived from functor::parent)
 
void save_png (const tsa::os::path &path)
 Saves the chart under the given path.
 
void save_png (const tsa::os::path &path, const tsa::date_time &start, const tsa::date_time &end)
 Saves the chart under the given path. The chart is limited to displaying data only between the start and end timespan.
 
size_t save_png_book (const tsa::os::path &dir_path, size_t bars_per_page=0)
 Saves the chart as a chart 'book' composed of a number of charts each one limited to displaying a number of bars given by bars_per_page. If bars_per_page is 0, the system automatically picks an appropriate value. The function will create a directory at given dir_path. If the path already exists, it will modify the given path by adding a number postfix to make it unique before creating the directory. The existing directory is not touched.
 
void set_color (DefaultColorID id, const color &c)
 x
 
void width (int width)
 Sets the chart width to width.
 
int width (void) const
 Returns the chart width.
 
- 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...
 
- Public Member Functions inherited from tsa::component
virtual void cmp__post_evaluate_bar (const date_time &)
 
bool is_registered_with_strategy (void) const
 
void register_with_strategy (strategy *)
 

Detailed Description

Class representing a timeseries chart.