For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Live Trading Example



  • Hi, I am just wondering if anyone will be kind enough to provide an example on how to access live data on backtrader. Thank you.





  • I tried the first link, however I am getting the error below

    Server Version: 76
    TWS Time at connection:20200505 12:36:00 PST
    --------------------------------------------------
    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:usfarm.nj>
    ***** 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:ushmds>
    ***** STORE NOTIF: <error id=-1, errorCode=2158, errorMsg=Sec-def data farm connection is OK:secdefil>
    ***** DATA NOTIF: DELAYED
    ***** DATA NOTIF: NOTSUBSCRIBED
    ***** STORE NOTIF: <error id=16777217, errorCode=354, errorMsg=Requested market data is not subscribed.Delayed market data is available.Error&BEST/STK/Top&BEST/STK/Top>
    

    and here is my interactive brokers api configuration page
    607d58b0-33e5-465f-b720-04623b36dc68-image.png
    can you help? Thank you



  • 93dc2c9d-f7ae-494f-b26e-9c098586c195-image.png
    I am using the demo of interactive brokers



  • The subscription to data services is required for getting the live data from InteractiveBrokers. Please see the following post:
    https://community.backtrader.com/topic/2091/starting-with-interactive-brokers-ib-no-data-feed


Log in to reply
 

});