load_candle_universe_from_parquet#

API documentation for tradeexecutor.strategy.pandas_trader.alternative_market_data.load_candle_universe_from_parquet Python function.

load_candle_universe_from_parquet(file, column_map={'close': 'close', 'high': 'high', 'low': 'low', 'open': 'open', 'volume': 'volume'}, resample=None, include_as_trigger_signal=True, identifier_column='pair_id', pair=None)[source]#

Load a single pair price feed from an alternative file.

Overrides the current price candle feed with an alternative version, usually from a centralised exchange. This allows strategy testing to see there is no price feed data issues or specificity with it.

For example see replace_candles().

Parameters:
  • pair (tradeexecutor.state.identifier.TradingPairIdentifier | None) –

    The trading pair data this Parquet file contains.

    E.g. ticker symbols and trading fee are read from this argument.

  • resample (tradingstrategy.timebucket.TimeBucket | None) – Resample OHLCV data to a higher timeframe

  • include_as_trigger_signal

    Create take profit/stop loss signal from the data.

    For this, any upsampling is not used.

  • pair – Trading pair identifier. Legacy option for backwards compatibility, no need for this anymore.

  • file (Path) –

  • column_map (Dict[str, str]) –

  • identifier_column (str) –

Raises:

NoMatchingBucket – Could not match candle time frame to any of our timeframes.

Returns:

(Price feed universe, stop loss trigger candls universe) tuple.

Stop loss data is only generated if include_as_trigger_signal is True. Stop loss data is never resampled and is in the most accurate available resolution.

Return type:

Tuple[GroupedCandleUniverse, tradingstrategy.candle.GroupedCandleUniverse | None]