For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Only Close data being plotted
-
Hi,
I am trying to plot Open,High,Low,Close using GenericCSVData, but all I get is the close being plotted as a line.
Here's a line of code of the csv:
1577836800.0,7195.24000000,7196.25000000,7178.64000000,7179.78000000,95.50913300,1577837099999,686317.13625177,1127,32.77324500,235537.29504531,0
Here's my code:
import backtrader as bt cerebro = bt.Cerebro() data = bt.feeds.GenericCSVData(dataname='data/1jan2020.csv', dtformat=2) cerebro.adddata(data) cerebro.run() cerebro.plot()
How do I plot the open,high,low,close too like :
-
You need to instruct cerebro to plot candlestick. Use cerebro.plot(style='candlestick').
-
@rajanprabu thanks!