visualise_multiple_pairs#

API documentation for tradeexecutor.visual.multiple_pairs.visualise_multiple_pairs Python function.

visualise_multiple_pairs(state, candle_universe, execution_context, start_at=None, end_at=None, pair_ids=None, height=2000, width=1000, axes=True, technical_indicators=True, title=True, theme='plotly_white', volume_bar_modes=None, vertical_spacing=0.03, subplot_font_size=11, relative_sizing=None, volume_axis_name='Volume USD', candle_decimals=4, show_trades=True, detached_indicators=True, include_credit_supply_positions=False, legend=True)[source]#

Visualise single-pair trade execution.

Note

Volume has been disabled for now for multipair visualisation. Using volume_bar_modes or volume_axis_name currently has no effect.

Parameters:
  • state (State) –

    The recorded state of the strategy execution.

    You must give either state or positions.

  • pair_ids (Optional[list[int]]) –

    The visualised pairs.

    If the user would like to visualise all pairs this is not needed.

  • candle_universe (tradingstrategy.candle.GroupedCandleUniverse | pandas.core.frame.DataFrame) – Price candles we used for the strategy

  • height – Chart height in pixels

  • start_at (Optional[Union[Timestamp, datetime]]) – When the backtest started or when we crop the content

  • end_at (Optional[Union[Timestamp, datetime]]) – When the backtest ended or when we crop the content

  • axes – Draw axes labels

  • technical_indicators

    Extract technical indicators from the state and overlay them on the price action.

    Only makes sense if the indicators were drawn against the price action of this pair.

  • title (Union[str, bool]) –

    Draw the chart title.

    Set to string to give your own name.

    Set True to use the state name as a title. TODO: True is a legacy option and will be removed.

  • theme – Plotly colour scheme to use

  • volume_bar_mode – How to draw the volume bars. By default, volume is hidden.

  • vertical_spacing – Vertical spacing between the subplots. Default is 0.05.

  • subplot_font_size – Font size of the subplot titles. Default is 11.

  • relative_sizing (list[float]) –

    Optional relative sizes of each plot. Starts with first main candle plot, then the volume plot if it is detached, then the other detached technical indicators.

    e.g. [1, 0.2, 0.3, 0.3] would mean the second plot is 20% the size of the first, and the third and fourth plots are 30% the size of the first.

    Remember to account for whether the volume subplot is detached or not. If it is detached, it should take up the second element in the list.

  • volume_axis_name (str) – Name of the volume axis. Default is “Volume USD”.

  • candle_decimals (int) – Number of decimal places to round the candlesticks to. Default is 4.

  • detached_indicators (bool) – If set, draw detached indicators. Has no effect if technical_indicators is False.

  • show_trades (bool) – If set, show trades on the chart.

  • execution_context (ExecutionContext) –

  • volume_bar_modes (Optional[list[tradingstrategy.charting.candle_chart.VolumeBarMode]]) –

  • include_credit_supply_positions (bool) –

  • legend (bool) –

Returns:

Plotly figure object

Return type:

Figure