For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Use the EMA for ATR instead of the SmoothMovingAverage ?
-
Hi all!
I am a fairly new noob here with backtrader. First,I cannot get TA-Lib to install (tons of errors) because I need to use the SINE weighted moving average (SWMA), but nevertheless in using BT built in indicators, how/where can I change the ATR to calculate the EMA instead of the SMA?
-
I believe you can call it as follows to use EMA, but please test it:
self.atr = bt.indicators.ATR(period=14, movav=MovAv.Exponential)
-
This should be correct way:
self.atr = bt.indicators.ATR(period=14, movav=bt.indicators.MovAv.Exponential)
-
Yes, thank you!!