expand_timeline(exchange_universe, pair_universe, timeline, vmin=- 0.3, vmax=0.2, timestamp_format='%Y-%m-%d', hidden_columns=['Id', 'PnL % raw'])[source]#

Expand trade history timeline to human readable table.

This will the outputting much easier in Python Notebooks.

Currently does not incrementing/decreasing positions gradually.

Instaqd of applying styles or returning a styled dataframe, we return a callable that applies the styles. This is because of Pandas issue https://github.com/pandas-dev/pandas/issues/40675 - hidden indexes, columns, etc. are not exported.

  • vmax – Trade success % to have the extreme green color.

  • vmin – The % of lost capital on the trade to have the extreme red color.

  • timestamp_format – How to format Opened at column, as passed to strftime()

  • hidden_columns – Hide columns in the output table

  • exchange_universe (ExchangeUniverse) –

  • pair_universe (PandasPairUniverse) –

  • timeline (DataFrame) –


DataFrame with human readable position win/loss information, having DF indexed by timestamps and a styler function

Return type

Tuple[DataFrame, Callable]