I have coded a Bollinger Band breakout strategy with an Index filter using Amibroker as:
SetOption("MaxOpenPositions", 20);
SetPositionSize(5, spsPercentOfEquity);
Index = Foreign("$XAO", "C", True);
IndexMA = MA(Index, 75);
BollyTop = BBandTop(C, 100, 3);
BollyBot = BBandBot(C, 100, 1);
Buy = C >= BollyTop AND Index >= IndexMA;
Sell = C <= BollyBot;
I want to modify it to generate a buy if there was a bollinger band breakout in the previous 7 days and today's close is higher. Any suggestions?