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/

    IB live: access data directly at 5min intervals (instead of resampling it)

    General Code/Help
    1
    1
    21
    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.
    • M
      mkdear last edited by

      For live trading currently I am getting data at 1 minute interval and resampling it to 5 mins.

          store = bt.stores.IBStore(port=4002)
          stockkwargs_mins = dict(tz=pytz.timezone('US/Eastern'),
                                  timeframe=bt.TimeFrame.Minutes,
                                  rtbar=True, historical=false,
                                  qcheck=0.5, backfill_start=True, backfill=True)
          stock = args.ticker + "-STK-SMART-USD"
          data_mins = store.getdata(dataname=stock, **stockkwargs_mins)
         cerebro.resampledata(data_mins, timeframe=bt.TimeFrame.Minutes, compression=5)
      

      But I want to access data directly at 5min intervals from interactive broker and don't want to use resampling. Can someone help me with this ?

      Thank you!

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors