Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. nooby_mcnoob
    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/
    N
    • Profile
    • Following 0
    • Followers 1
    • Topics 5
    • Posts 27
    • Best 3
    • Groups 0

    Topics created by nooby_mcnoob

    • N

      Weekly resampling, set cutoff to a different weekday?
      General Discussion • • nooby_mcnoob

      3
      0
      Votes
      3
      Posts
      574
      Views

      B

      @nooby_mcnoob The cut-off is actually set to identifying a new week-number which is a bit more agnostic than looking for specific days.

      Using a trading calendar as you have also added to your own answer has 2 advantages:

      The actual cut-off day for every week is right The delivery of the resampled bar can be done 1 bar earlier (because the system doesn't need to wait to identify the new week)
    • N

      Brain limitations: position sizing for forex
      General Discussion • • nooby_mcnoob

      5
      0
      Votes
      5
      Posts
      1387
      Views

      B

      See this other thread: Community - Backtesting oanda/forex

    • N

      Live data does not match historical data for ibtest.py #359
      General Discussion • • nooby_mcnoob

      6
      0
      Votes
      6
      Posts
      1548
      Views

      N

      @dasch @backtrader

      Thanks for your help. The PEBKAC is resolved :-)

      I guess it is obvious to you, but perhaps a default mode of "backtest bars should match live bars" would follow the principle of least surprise? In any case, here are some live resampled bars, followed by the corresponding historical resampled bars with a timeframe of 5 minutes with rightedge=False. This shows that live bars match historical bars. Now the question I have to answer myself is: "why did righedge=False not work in my system when I tried it live?"

      Live

      Data0, 0196, 736793.5625, 2018-04-09T09:30:00.000000, 1.27725, 1.27794, 1.27709, 1.27773, -1.0, 0, 1.277366 Data0, 0197, 736793.5659722222, 2018-04-09T09:35:00.000000, 1.27773, 1.27882, 1.27745, 1.27874, -1.0, 0, 1.277632 Data0, 0198, 736793.5694444445, 2018-04-09T09:40:00.000000, 1.27874, 1.27876, 1.27756, 1.27769, -1.0, 0, 1.27775 Data0, 0199, 736793.5729166666, 2018-04-09T09:45:00.000000, 1.27769, 1.27791, 1.27729, 1.27751, -1.0, 0, 1.277784 Data0, 0200, 736793.5763888889, 2018-04-09T09:50:00.000000, 1.27751, 1.27751, 1.2765, 1.27675, -1.0, 0, 1.277684 Data0, 0201, 736793.5798611111, 2018-04-09T09:55:00.000000, 1.27675, 1.27726, 1.27634, 1.27681, -1.0, 0, 1.2775 Data0, 0202, 736793.5833333334, 2018-04-09T10:00:00.000000, 1.27681, 1.27716, 1.27641, 1.27712, -1.0, 0, 1.277176 Data0, 0203, 736793.5868055555, 2018-04-09T10:05:00.000000, 1.27712, 1.27748, 1.27683, 1.27736, -1.0, 0, 1.27711 Data0, 0204, 736793.5902777778, 2018-04-09T10:10:00.000000, 1.27736, 1.27757, 1.27725, 1.27736, -1.0, 0, 1.2770800000000002 Data0, 0205, 736793.59375, 2018-04-09T10:15:00.000000, 1.27736, 1.2774, 1.27652, 1.27652, -1.0, 0, 1.277034

      Historical

      Data0, 0196, 736793.5625, 2018-04-09T09:30:00.000000, 1.27725, 1.27794, 1.27709, 1.27773, -1.0, 0, 1.277366 Data0, 0197, 736793.5659722222, 2018-04-09T09:35:00.000000, 1.27773, 1.27882, 1.27745, 1.27874, -1.0, 0, 1.277632 Data0, 0198, 736793.5694444445, 2018-04-09T09:40:00.000000, 1.27874, 1.27876, 1.27756, 1.27769, -1.0, 0, 1.27775 Data0, 0199, 736793.5729166666, 2018-04-09T09:45:00.000000, 1.27769, 1.27791, 1.27729, 1.27751, -1.0, 0, 1.277784 Data0, 0200, 736793.5763888889, 2018-04-09T09:50:00.000000, 1.27751, 1.27751, 1.2765, 1.27675, -1.0, 0, 1.277684 Data0, 0201, 736793.5798611111, 2018-04-09T09:55:00.000000, 1.27675, 1.27726, 1.27634, 1.27681, -1.0, 0, 1.2775 Data0, 0202, 736793.5833333334, 2018-04-09T10:00:00.000000, 1.27681, 1.27716, 1.27641, 1.27712, -1.0, 0, 1.277176 Data0, 0203, 736793.5868055555, 2018-04-09T10:05:00.000000, 1.27712, 1.27748, 1.27683, 1.27736, -1.0, 0, 1.27711 Data0, 0204, 736793.5902777778, 2018-04-09T10:10:00.000000, 1.27736, 1.27757, 1.27725, 1.27736, -1.0, 0, 1.2770800000000002 Data0, 0205, 736793.59375, 2018-04-09T10:15:00.000000, 1.27736, 1.2774, 1.27652, 1.27652, -1.0, 0, 1.277034
    • N

      Does your backtesting match your live trades?
      General Discussion • • nooby_mcnoob

      1
      0
      Votes
      1
      Posts
      592
      Views

      No one has replied

    • N

      Backtest vs live bars "off-by-1" discrepancy?
      General Discussion • • nooby_mcnoob

      29
      0
      Votes
      29
      Posts
      4000
      Views

      stevetree

      @Squirrel-Singing I can confirm that. Unfortunately, I have the same problem.

    • 1 / 1