For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
typo found in indicators documentation.
-
If a user was to copy and paste the example found midway down this page for indicators. They'll get an error that buy_sig is not defined. Inside
def init (self):
and
def next (self):buy_sig needs to be self.buy_sig to function properly.
-
@Tom-Porter said in typo found in indicators documentation.:
class MyStrategy(bt.Strategy): def __init__(self): sma1 = btind.SimpleMovingAverage(self.data) ema1 = btind.ExponentialMovingAverage() close_over_sma = self.data.close > sma1 close_over_ema = self.data.close > ema1 sma_ema_diff = sma1 - ema1 self.buy_sig = bt.And(...) def next(self): if self.buy_sig: self.buy()
Absolutely. Thanks for pointing it out Tom.