I am trying to build a calendar spread backtester for grains. When I print the close of each bar, I get the same price for each future. For example, the current front contract for CBOT Wheat is "ZW 09-20" and the next future is "ZW 12-20". When I print the close of historical bars in the Output window during a backtester, the output of the two symbols is the same. (I set up Sep as the main Strategy Analyzer instrument and Dec as the added instrument in the file.)
Can someone recommend a way to build a backtester that allows me to look at the both the front wheat contract and the one-back wheat contract throughout a historical window for backtesting purposes?
Thank you,
Tim
Comment