Back to Posts
Listen to Thread

I've been using the pandas resampling method to derive daily close data from the minute data in a batch transform and I've found a difference between the close price from the daily data and minute data.

If the strategy is run with daily data using the "Build Algorithm" button, the log gives

2012-01-06print_data:13 INFO 422.45  
2012-01-06print_data:15 INFO 2012-01-03 00:00:00+00:00 411.10 2012-01-04 00:00:00+00:00 413.44 2012-01-05 00:00:00+00:00 417.96 2012-01-06 00:00:00+00:00 422.45 Freq: B  

The closing price for the 4th day is $422.45. Now, running a full backtest with minute data gives
2012-01-06 print_data:13 INFO 419.541 2012-01-06 print_data:15 INFO 2012-01-03 00:00:00+00:00 411.100 2012-01-04 00:00:00+00:00 413.440 2012-01-05 00:00:00+00:00 417.960 2012-01-06 00:00:00+00:00 419.541 Freq: B Here the closing price for the 4th day is $419.541. Looking at the second lines of both log outputs, the close price for the daily and minute data is the same for the first 3 days. It's only the close price on the last day in the batch transform that has a discrepancy.

I'm guessing this is likely caused by an incomplete dataset being passed to the batch transform during a full backtest with minute data.

Aidan

Clone Algorithm
6
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

Thanks Aidan. I think you've found something here, but I don't recognize the problem right away. We opened a bug, and we'll look at it and get back to you in a day or two.

We really appreciate the bug reports.

Dan

I wanted to let you know that this is still in queue - we haven't gotten to it yet. I hope/expect it will be the top item shortly.

Aidan, we were going through old bugs and found this one. Sorry for the slow response, but we think this is fixed now!

Log in to reply to this thread.
Not a member? Sign up!