I am trying to create code to Explore for a previous cross of SIGNAL over MACD on daily charts. I got this far which does find the cross for current data:
BuyPrice = 0;
SellPrice = 0;
ShortPrice = Open;
CoverPrice = Open;
Short =
Cross (Signal(),MACD());
Filter = short;
The plan is to look for that cross on previous days, but I cannot figure out where to place the -1 or -2 to indicate previous bars. I've tried every likely spot, but nothing works.
Thanks.