For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
I'm trying real-time trading.But there seems to be a slight problem.
-
code
broker = bt.brokers.CCXTBroker(exchange='bitmex', currency='BTC/USD', config=broker_config) cerebro.setbroker(broker) hist_start_date = datetime.utcnow() - timedelta(minutes=1000) data = bt.feeds.CCXT( exchange='bitmex', symbol='BTC/USD', timeframe=bt.TimeFrame.Minutes, fromdate=hist_start_date, historical='True', compression = 5, )
It worked fine at first, but halfway through it, an error was reported.
out put:2020-11-22, price, 18715.00 2020-11-22, price, 18696.00 2020-11-22, price, 18670.50 2020-11-22, price, 18604.50 2020-11-22, price, 18575.00 2020-11-22, price, 18605.50 Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\backtrader\stores\ccxtstore.py", line 122, in retry_method return method(self, *args, **kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\backtrader\stores\ccxtstore.py", line 144, in create_order amount=amount, price=price, params=params) File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\bitmex.py", line 1256, in create_order 'ordType': self.capitalize(type), File "C:\ProgramData\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 788, in capitalize if len(string) > 1: TypeError: object of type 'NoneType' has no len()
Is this a network issue or is bitmex not supported?
Thx.