plotly.figure_factory.create_candlestick() function in Python
Plotly library of Python can be very useful for data visualization and understanding the data simply and easily.
The candlestick chart is a style of financial chart that describes o for a given x coordinate (most likely time). The boxes represent the spread between the open and close values and the lines represent the spread between the low and high values.
Syntax: plotly.figure_factory.create_candlestick(open, high, low, close, dates=None, direction=’both’, **kwargs)
open: it is used for opening values
high: it is used for high values
low: it is used for low values
close: it is used for closing values
dates: it is used for list of datetime objects. Default: None
direction: it can be used for both increasing and decreasing. When the direction is ‘increasing’, the returned figure consists of all candlesticks where the close value is greater than the corresponding open value, and when the direction is ‘decreasing’, the returned figure consists of all candlesticks where the close value is less than or equal to the corresponding open value. When the direction is ‘both’, both increasing and decreasing candlesticks are returned. Default: ‘both’
kwargs – it describe other attributes about the ohlc Scatter trace such as the color or the legend name. For more information on valid kwargs call help(plotly.graph_objects.Scatter)
Example 1: With datetime Objects
Example 2: Candlestick chart with datetime objects
Please Login to comment...