visualise_ohlcv#
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)[source]#
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.
- Parameters:
chart_name (Optional[str]) – Will be displayed at the top of the chart
y_axis_name (Optional[str]) – Will be displayed on an Y-axis
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
volume_bar_mode –
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.
num_detached_indicators (Optional[int]) – Number of indicators that will be drawn as separate charts. Includes volume if volume is separate.
vertical_spacing (Optional[float]) – Vertical spacing between charts.
relative_sizing (Optional[list[float]]) –
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.
subplot_names (Optional[list[str]]) –
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) –
- Returns:
Plotly figure object
- Return type:
Figure