LinePlotterIndicator - how to change color, line width etc.?
-
I have a custom indicator with several lines. One of the line I would like to plot in a separate subplot.
I can do it using the SMA trick where I create a new instance of an SMA indicator then pass in my line.
I can also use the LinePlotterIndicator method.
My question is - how can I change line colour / plot type etc.?
Many thanks
-
Docs - Plotting - Section: Line specific plotting options
-
I've already checked that
-
If you have checked that, what's missing? Unless you are a bit more specific ... adding some code with your own attempt at something does usually help.
-
So I have this in my strategy:
my_indicator = bt.LinePlotterIndicator(self.indicator.my_indicator_line, "ABC")
...and I don't know where to interface with this thing to tell it I want a green histogram
-
A
LinePlotterIndicator
is only meant to be an aid for quickly plotting a line. If you really want to customize it, you should go for a custom indicator in which you can define all properties of a line usingplotlines
class MyCustomIndicator(bt.Indicator): lines = ('abc',) plotlines = dict(abc=dict(ls='--'))
As indicated in Docs - Plotting - Section: Line specific plotting options, customizations like line colors or line style (like in the above example) are from
matplotlib
and you have to refer to its documentation. -
@backtrader said in LinePlotterIndicator - how to change color, line width etc.?:
Line specific plotting options, customiz
thank you very much.