Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Squirrel Singing
    3. Topics
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    • Profile
    • Following 2
    • Followers 0
    • Topics 5
    • Posts 20
    • Best 4
    • Controversial 0
    • Groups 0

    Topics created by Squirrel Singing

    • Squirrel Singing

      Buy Order Works on 1st Data Feed And Not on 2nd Data Feed
      General Code/Help • • Squirrel Singing

      4
      0
      Votes
      4
      Posts
      315
      Views

      Squirrel Singing

      @ab_trader I've up your reputation too!

    • Squirrel Singing

      Last Bar of Delayed Data from Interactive Brokers
      General Discussion • • Squirrel Singing

      1
      1
      Votes
      1
      Posts
      318
      Views

      No one has replied

    • Squirrel Singing

      Daily Resample Data
      General Code/Help • • Squirrel Singing

      2
      0
      Votes
      2
      Posts
      808
      Views

      Squirrel Singing

      Re: Daily Resample Data

      The problem is solved after I remove timeframe and compression parameter in getdata().

      Can I ask why would that resolve the problem?

      Is the inclusion of parameters, timeframe and compression, in ibstore.getdata() redundant if I were to specify a value for rtbar?

      See below correct code.

      import backtrader as bt import datetime as dt import pytz class Test_Strategy (bt.Strategy): def next (self): self.log (self.data.close[0]) def log (self, text): print (self.data.datetime.datetime(0),": ", text) if __name__ == '__main__': ibstore = bt.stores.IBStore (host = '127.0.0.1', clientId = 100, port = 7497) data = ibstore.getdata (dataname = 'GBP.USD-CASH-IDEALPRO', rtbar = False, historical = True, fromdate = dt.datetime (2019,4,25), todate = dt.datetime(2019,10,26), tz=pytz.timezone('US/Eastern'), ) cerebro = bt.Cerebro() cerebro.resampledata (data, timeframe = bt.TimeFrame.Days, compression = 1) cerebro.addstrategy (Test_Strategy) cerebro.run()
    • Squirrel Singing

      Tickstring vs Real Time Bar
      General Code/Help • • Squirrel Singing

      2
      0
      Votes
      2
      Posts
      400
      Views

      Squirrel Singing

      Just to rephrase my question,

      Besides the restriction of 5s or 250ms on the RealTimeBars and tickString, can I ask what other differences are there between RealTimeBars and tickString in Interactive Brokers?

      Is one more accurate than the other?

    • Squirrel Singing

      Question on Article: Interactive Brokers in Python with backtrader
      General Code/Help • live data delayed data resample • • Squirrel Singing

      1
      0
      Votes
      1
      Posts
      326
      Views

      No one has replied

    • 1 / 1