Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    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.

    General Code/Help
    1
    1
    51
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kemoduodejuxi
      kemoduodejuxi last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
      $(document).ready(function () { app.coldLoad(); }); }