Backtrader Community

    • 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/

    Trade with IB paper account that not subscribed to Live Data

    General Discussion
    2
    3
    516
    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.
    • A
      arikenig last edited by

      Hi backtraders,

      I manage to backtest my strategy using IB Live account (port-7497).
      But when trying to run my strategy on the paper account I'm getting below message:
      *****STORE NOTIF:<error id=16777217, errorCode=10168, errorMsg=Requested market data is not subscribed. Delayed market data is not enabled>

      I'm using the test code that in
      https://github.com/mementum/backtrader/blob/master/samples/ibtest/ibtest.py

      End getting below error:
      <error id=16777217, errorCode=10168, errorMsg=Requested market data is not subscribed. Delayed market data is not enabled

      Any idea how can I run it even if if i'm not subscribed - to run it on delayed data..

      Thanks,
      Arik

      A 1 Reply Last reply Reply Quote 0
      • A
        arikenig @arikenig last edited by

        @arikenig
        I'm using below arguments:
        ibtest.py --port 7497 --data0 AAPL-STK-SMART-USD --resample --timeframe Seconds --broker --trade

        and below is the full output:
        
        --------------------------------------------------
        Strategy Created
        --------------------------------------------------
        Timezone from ContractDetails: EST (Eastern Standard Time)
        Datetime, Open, High, Low, Close, Volume, OpenInterest, SMA
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:usfuture.nj>
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:hfarm>
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:usfarm.nj>
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:eufarm>
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:jfarm>
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:usfuture>
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:cashfarm>
        ***** STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:usfarm>
        ***** STORE NOTIF: <error id=-1, errorCode=2106, errorMsg=HMDS data farm connection is OK:euhmds>
        ***** STORE NOTIF: <error id=-1, errorCode=2106, errorMsg=HMDS data farm connection is OK:ushmds.nj>
        ***** STORE NOTIF: <error id=-1, errorCode=2106, errorMsg=HMDS data farm connection is OK:fundfarm>
        ***** STORE NOTIF: <error id=-1, errorCode=2106, errorMsg=HMDS data farm connection is OK:ushmds>
        ***** STORE NOTIF: <error id=-1, errorCode=2158, errorMsg=Sec-def data farm connection is OK:secdefnj>
        ***** DATA NOTIF: DELAYED
        ***** STORE NOTIF: <error id=16777217, errorCode=10168, errorMsg=Requested market data is not subscribed. Delayed market data is not enabled>
        
        1 Reply Last reply Reply Quote 0
        • A
          arikenig last edited by

          Thanks EMR for your comment,

          I searched where backtrader use reqMarketDataType & added a breakpoint there
          I checked the flow of the test strategy and I don't see that it call ...Python38\site-packages\ib\ext\EClientSocket.py - method: reqMarketDataType
          I've also opened both Live & paper in my machine but still getting the same error - errorCode=10168, errorMsg=Requested market data is not subscribed
          which after that it not continue.
          I'm expecting to get into next method but it stucked in load data:
          below the stack that it never get out of it:

          _load, ibdata.py:446
          load, feed.py:479
          next, feed.py:407
          _runnext, cerebro.py:1542
          runstrategies, cerebro.py:1298
          run, cerebro.py:1127
          runstrategy, ibtest.py:336
          <module>, ibtest.py:558
          

          It never exit line 1506 in cerebro.py file:

          code_text
          ```        while d0ret or d0ret is None:
          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors