def smaShort(self):
while True:
ohlcv_candles = bitmex2.bitmex.fetch_ohlcv(self, symbol= 'XBTUSD', timeframe= '5m')
mas = []
mas = ohlcv_candles.rolling(window=5).mean()
return mas#[-1]
when trying to call smaShort function
logger.info("sma short value:" (self.smaShort()))
I get the error smaShort is not callable, anybody know what I am doing wrong?
XBTUSD
symbol, it's a market id not a symbol, as explained in the Manual: https://github.com/ccxt/ccxt/wiki/Manual#symbols-and-market-ids. The correct symbol isBTC/USD
.bitmex.fetch_ohlcv
will return the following structure: https://github.com/ccxt/ccxt/wiki/Manual#ohlcv-structure..rolling(window=5).mean()
on a list, you have to convert it to a DataFrame first, like shown above (or in any other way supported by Pandas).