generate_ohlcv_candles#

API documentation for tradeexecutor.testing.synthetic_price_data.generate_ohlcv_candles Python function.

generate_ohlcv_candles(bucket, start, end, start_price=1800, daily_drift=(0.95, 1.05), high_drift=1.05, low_drift=0.9, random_seed=1, pair_id=1, exchange_id=1)[source]#

Generate some sample time series data.

The output candles are deterministic: the same input parameters result to the same output parameters.

Parameters:
  • bucket (TimeBucket) – Time bucket to use for the candles

  • start (datetime) – Start time for the candles

  • end (datetime) – End time for the candles

  • start_price (int | float) – Starting price for the candles

  • daily_drift – Tuple of (min, max) daily drift for the candles

  • high_drift – High drift for the candles

  • low_drift – Low drift for the candles

  • random_seed – Random seed to use for the candles

  • pair_id – Pair ID to use for the candles

  • exchange_id – Exchange ID to use for the candles

Return type:

DataFrame