I wonder if anyone can help me with this backtesting problem I've been having. I backtest in the daily frame, and as an extra filter, I use the slope of the weekly MACD historgram. I use the TimeFrameExpand function to bring the weekly data into the daily timeframe.
For ages, I noticed a discrepancy between my backtest results and my daily scan results, and yesterday I think I found the reason for it. What I have noticed is that, for example if the weekly MACD-H for IBM changes direction on Wednesday's close. This means that when I do my daily exploration before the Thursday open, IBM will become a stock buy candidate, if all other conditions are satisfied. However, when I backtest at the end of the week, IBM appears as a buy candidate on Monday, because the weekly MSCD-H condition is satisfied for the entire week. I went back to the User Manual, and found the explanation for the TimeFrameExpand function expandFirst and expandLast parameters. Does this mean that the calculated weekly value is made available on either Monday or Friday of the given week? Is there a way to correctly backtest the case where the weekly signal becomes valid in mid-week? Many thanks, Paul
