Extra column included in data for the indicator values - how to plot on candle stick chart? #764
-
I have already added my indicator price values in a column to my DataFrame used for data (one added column after "Volume"). I can call this column when defining my trading buy/sell strategy via: def next(self): However, is there any way I can plot it as a line on the candle bar chart please? In the standard examples using SMAs, they are plotted as lines on the candle stick chart. It would be really great to see my indicator values plotted on the chart in this way. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you see the examples, the SMAs are wrapped in
Therefore, you can plot your custom indicators with: class MyS(Strategy):
def __init__(self):
self.I(lambda: self.data.my_indicator) You need to wrap it behind a function simply because this is what |
Beta Was this translation helpful? Give feedback.
If you see the examples, the SMAs are wrapped in
self.I()
calls. If you further see the reference docs forStrategy.I()
, it says:Therefore, you can plot your custom indicators with:
You need to wrap it behind a function simply because this is what
Strategy.I()
takes.