load_candles_from_dataframe#

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

load_candles_from_dataframe(column_map, df, resample, identifier_column='pair_id')[source]#

Load OHLCV candle data from a DataFrame.

Parameters:
  • column_map (Dict[str, str]) –

    Column name mapping from the DataFrame to our internal format.

    E.g. { “open”: “open”, “high”: “high”, … }

  • df (DataFrame) – DataFrame to load from

  • pair_id – Pair id to set for the DataFrame

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

  • identifier_column (str) –

Returns:

Tuple (Original dataframe, processed candles dataframe, resampled time bucket, original time bucket) tuple