Trade with IB paper account that not subscribed to Live Data
-
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.pyEnd getting below error:
<error id=16777217, errorCode=10168, errorMsg=Requested market data is not subscribed. Delayed market data is not enabledAny idea how can I run it even if if i'm not subscribed - to run it on delayed data..
Thanks,
Arik -
@arikenig
I'm using below arguments:
ibtest.py --port 7497 --data0 AAPL-STK-SMART-USD --resample --timeframe Seconds --broker --tradeand 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>
-
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: