API documentation for tradingstrategy.charting.candle_chart.visualise_ohlcv Python function.
- visualise_ohlcv(candles, chart_name=None, y_axis_name='Price USD', volume_axis_name='Volume USD', height=800, theme='plotly_white', volume_bar_colour='rgba(128,128,128,0.5)', volume_bar_mode=VolumeBarMode.overlay, labels=None, num_detached_indicators=0, vertical_spacing=0.05, relative_sizing=None, subplot_names=None, subplot_font_size=11)#
Draw a candlestick chart.
If the candles has label column this will be used as the mouse hover text for candles.
If the candles has volume column, draw also this column.
We remove the default “minimap” scrolling as it has pretty bad usability.
height (int) – Chart height in pixels
theme (str) –
Plotly colour scheme for the chart.
volume_bar_colour (str) – Override the default colour for volume bars
Draw volume chart as a separate chart under the candlestick chart.
If not set, draw as an overlay.
Note that Plotly does not allow reodering of tracing, and the volume bars will always be on the top of the candlesticks.
Tooltip labels for candles.
Sizing of subplots relative to the main price chart. Price chart is regarded as 1.0, so subplots should be smaller than 1.0. Should include size for volume subplot if volume is separate.
If it is overlayed, volume will naturally be the same size as the price chart, since they’re on the same chart.
Names of subplots. Used as titles for subplots.
Should include name for main candle chart. Recommended to leave candle chart name as “” or None
Should include volume if volume is separate.
candles (DataFrame) –
subplot_font_size (int) –
Plotly figure object
- Return type: