Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
rand_ohlcv Class Reference

Class for generating pseudo random price series (o,h,l,c,v). More...

Detailed Description

Class for generating pseudo random price series (o,h,l,c,v).

Price changes (close to close) have a near normal distribution. There is a small tendency to 'trend' which is enabled by default, but can be disabled (see trend_factor()). This class does not act as scheduler for strategies (see strategy::schedule()). This means that it is suitable to work with any type of scheduling.

A strategy will require an object of type sequence_daily or sequence_intra for scheduling purposes. If a series with a daily sequence is required, use class rand_ohlcv_daily as it also comprises a scheduler of daily intervals.

Settings
There are various properties to control how the price series is generated. These properties can be changed with various member functions. The default settings are:
  • start_price: Set to 100.0 by default.
  • trend_factor: Set to 0.15 by default. (Probability of overriding the direction of price changes to promote 'trending')
  • close_close_mult: Standard deviation of close to close price changes in percent. 0.8 by default.
  • close_open_mult: Standard deviation of open to close (same bar) price changes in percent. 0.4 by default.
  • mean_high_mult: Standard deviation of (high-low)/2 to high price changes in percent. 1.0 by default.
  • low_mean_mult: Standard deviation of (high-low)/2 to low price changes in percent. 1.0 by default.
  • inflation_mult: 0.0 by default. A small percentage that will be added to every bar (e.g. 3.0pct/num_bars_per_year). Keep compounding effect in mind.