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