我使用Amibroker使用Index过滤器对布林带突破策略进行了编码,
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;
如果在过去7天里有bollinger波段突破,并且今天的收盘价更高,我想对其进行修改以产生买入。有什么建议吗?
答案 0 :(得分:1)
您可以尝试:
//close 7 days ago
C7 = Ref(C,-7);
//high 7 days ago
H7 = Ref(H,-7);
//Bollinger band top 7 days ago
B7 = Ref(BollyTop, -7);
Buy = C >= C7 and H7 >= B7;