Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OHLCGenerator

OHLC data generator. Generates random OHLC data. The open value is derived from the previous close.

To create a new instance of OHLC data generator use createOHLCGenerator factory.

Hierarchy

Index

Constructors

constructor

Methods

generate

  • Generate new instance of DataHost with unique data. Data is added to the DataHost asynchronously.

    Returns DataHost<OHLCData>

    A new DataHost.

setDataFrequency

  • Returns a new Data generator with the new data frequency.

    Parameters

    • dataFreq: number

      How long the time between two timestamps is.

    Returns OHLCGenerator

setNumberOfPoints

  • Returns a new Data generator with the new numberOfPoints.

    Parameters

    • numberOfPoints: number

      How many points of data to generate

    Returns OHLCGenerator

setStart

  • Returns a new Data generator with the new starting value.

    Parameters

    • start: number

      What is the value the data generation should start from.

    Returns OHLCGenerator

setStartTimestamp

  • Returns a new Data generator with the new time stamp to start generating the data.

    Parameters

    • startTimestamp: number

      The timestamp for the first data point.

    Returns OHLCGenerator

setVolatility

  • Returns a new Data generator with the new volatility.

    Parameters

    • volatility: number

      How volatile the data is. How much the data changes between data points. For example volatility of 0.2 would allow maximum of 0.2 change up or down between datapoints.

    Returns OHLCGenerator