For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How to plot open and close prices together
-
By default Backtrader plot close price on chart, I like to see open and close price lines together on plot.
-
Use a 2nd data feed in which you use the
open
price of your main data feed as theclose
price.You can then plot both data feeds on the same axis.
-
@backtrader Thanks, Could you provide code sample if you have. I could't find samples of two feed from same data stream.
-
There are some uses of clone there, but it basically comes down to either of these:
Option A
- You use
GenericCSVData
orPandasData
. You can tell those feeds in which part of the original data theclose
andopen
prices are. Open a 2nd stream and play with the config - See Docs - PandasData Example and Docs - Datafeed Reference
Option B
- You can clone the existing
data
(with the methodclone
) - Add a filter and manipulate the
open
price to be theclose
price - See Docs - Filters
- You use