For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Data Resampling Creating Entry Delay
-
I have daily data in a csv file and all is working well.
I used the following code to resample it to weekly data:
data_resampled = cerebro.resampledata( dataname=data, timeframe=bt.TimeFrame.Weeks, compression=1)
But I have noticed that there is now a 1 bar delay between 'Buy Create' and 'Buy Executed'. This was not happening on the daily data prior to adding the resampling.
e.g. Weekly (resampled):
2012-10-19, BUY CREATE, 3.00
2012-11-02, BUY EXECUTED, Size: 10, Price: 2.93, Cost: 29.30, Comm 0.00So it has skipped the 2012-10-26 bar altogether and entered at the opening price of the next bar.
This is happening on all buy signals.
Why would this be occurring?
-
Too little information to draw any meaningful conclusion. Some context code and sample data could really be helpful.