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

Bug with live trading ibtest.py script?



  • Is there a bug with live trading when fetching the data feed when we use resample data? Especially with the high and low data.
    I am using the exact ibtest script in the samples without any changes to it.
    When I run the script for Seconds and compression 1 the desired data is received with no issues.
    I used this to run the code which is pretty standard.
    ./ibtest.py --port 4002 --data0 'TCS-STK-NSE-INR' --resample --timeframe Seconds --compression 1

    Data0, 1797, 737468.1806481482, 2020-02-13T04:20:08.000000, 2194.6, 2194.6, 2194.6, 2194.6, 6.0, 0, 2194.45
    Data0, 1798, 737468.1806597222, 2020-02-13T04:20:09.000000, 2194.6, 2194.6, 2194.6, 2194.6, 0.0, 0, 2194.3900000000003
    Data0, 1799, 737468.1806712963, 2020-02-13T04:20:10.000000, 2194.55, 2194.55, 2194.55, 2194.55, 11.0, 0, 2194.33
    Data0, 1800, 737468.1806828703, 2020-02-13T04:20:11.000000, 2194.2, 2194.2, 2194.2, 2194.2, 36.0, 0, 2194.3
    ***** DATA NOTIF: LIVE
    Data0, 1801, 737468.1807060185, 2020-02-13T04:20:13.000000, 2193.55, 2193.55, 2193.55, 2193.55, 133894.0, 0, 2194.3
    Data0, 1802, 737468.1807175926, 2020-02-13T04:20:14.000000, 2184.55, 2184.55, 2184.55, 2184.55, 165.0, 0, 2192.29
    Data0, 1803, 737468.1807291667, 2020-02-13T04:20:15.000000, 2180.9, 2180.9, 2180.9, 2180.9, 13.0, 0, 2189.55
    Data0, 1804, 737468.1807523149, 2020-02-13T04:20:17.000000, 2184.85, 2184.85, 2184.85, 2184.85, 145.0, 0, 2187.6099999999997
    Data0, 1805, 737468.180775463, 2020-02-13T04:20:19.000000, 2240.0, 2240.0, 2186.1, 2186.1, 95.0, 0, 2185.9900000000002
    

    Please notice the high and lows i.e. the 2nd and 3rd column after time when I use the code for Minutes with compression 1.
    I use this to run the code for minutes.
    ./ibtest.py --port 4002 --data0 'TCS-STK-NSE-INR' --resample --timeframe Minutes --compression 1

    Data0, 0036, 737468.1805555555, 2020-02-13T04:20:00.000000, 2193.35, 2195.0, 2193.35, 2194.6, 850.0, 0, 2194.45
    Data0, 0037, 737468.18125, 2020-02-13T04:21:00.000000, 2194.7, 2194.7, 2193.65, 2194.0, 623.0, 0, 2194.13
    Data0, 0038, 737468.1819444444, 2020-02-13T04:22:00.000000, 2194.2, 2194.2, 2193.45, 2193.65, 1027.0, 0, 2193.8599999999997
    Data0, 0039, 737468.182638889, 2020-02-13T04:23:00.000000, 2193.7, 2194.0, 2193.65, 2193.95, 138.0, 0, 2193.9
    ***** DATA NOTIF: LIVE
    Data0, 0040, 737468.1833333333, 2020-02-13T04:24:00.000000, 2194.05, 2273.9, 2176.0, 2185.15, 23071.0, 0, 2192.27
    Data0, 0041, 737468.1840277778, 2020-02-13T04:25:00.000000, 2184.8, 2228.8, 2176.0, 2185.6, 9375.0, 0, 2190.4700000000003
    Data0, 0042, 737468.1847222223, 2020-02-13T04:26:00.000000, 2176.0, 2230.25, 2176.0, 2185.5, 8036.0, 0, 2188.77
    
    

    The lows are constant i.e. the 3rd column and the highs i.e. the second column is not sensible. Just to cross check I opened Trader workstation and it has the right highs and lows. You can also compare the highs and lows with the historical data for further confirmation and this is 1 minute data so it is obvious.
    Can someone please help fixing this?



  • I forgot to mention the seconds run is working fine when I change timeframe to minutes or any other timeframe the problem occurs.



  • @Suraj-Thorat I was checking options for NSE live trading could you please help me with setup. Is interactivebroker account is the only option or do you have setup with india brokers (zerodha, upstrox etc. brokers)? Sorry for the out of the context message I am new to backtrader and I am trying hard from few weeks to explore options and for the setup but I am not able to do setup for live trading.


Log in to reply
 

});