For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Indicator on Indicator (EMA smoothing on RSI)
-
Hi everyone, I am trying to apply some EMA smoothing on the RSI indicator. But so far, no luck. Would really appreciate if someone can point me to the right direction...
class RSI(bt.Strategy): params = (('period', 14),) def __init__(self): self.rsi = bt.indicators.RSI_Safe(self.close, period=14) def __init__(self): self.smooth_rsi = bt.indicators.ExpSmoothing(self.rsi, period=8)
-
When you pass close to RSI indicator.. its self.data.close not self.close
class RSI(bt.Strategy): params = (('period', 14),) def __init__(self): self.rsi = bt.indicators.RSI_Safe(self.data0.close, period=14) self.smooth_rsi = bt.indicators.ExpSmoothing(self.rsi, period=8)
-
@rajanprabu thank you so much, that makes sense and it's working great!