For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
why does panda calculate different sma than btlib ot ta-lib
-
Hi everyone,
hopefully someone can enlighten me why the difference.
I'm retrieving data from Polygon and using python, calculating SMA20, SMA50 and EMA8 on the fly and store them along with the ohlc data in a sqlite3 table.
the default python calculations
sma20 = barsets['close'].rolling(window=20).mean()
VS
self.sma_20 = bt.indicators.SimpleMovingAverage( self.datas[0], period=20)
I am using my Schwab account charts to compare my results and the default python values have always been exactly the same and because these are my benchmarks.
I don't think this is a Backtrader thing but it does force me to use pre calculated values
any ideas?