新手請教AFL語法
如果想寫一個當沖突破策略某一分鐘的價格突破或跌破EMA 10
但每日第二次突破才買入或賣出
請問應如何寫?
例如 10:00 第一次突破EMA 10, 10:30 第二次突破EMA 10 (這時才買入)
我寫了一下, 但好像不太對耶{:4_161:}
EMA1 = EMA(Close, 10);
Buy1 = Cross(H, EMA1);
Short1 = Cross(L, EMA1);
BuyNum = Cum(Buy1);
Buy = Buy1 AND BuyNum == 2;
ShortNum = Cum(Short1);
Short = Short1 AND ShortNum == 2;
頁:
[1]