條件必需限制只在第一根棒有效,其他根棒則採用 交叉穿越的條件去檢定
過濾每天的第一根棒,採用下列語法
if date<>date[1] then begin
if open>某區域上限 then buy this bar on close;
if open<某區域下限 then sell this bar on close;
end;
後續程式碼,直接 用穿越去檢驗條件
if ...... and ..... and ...... then buy .............
if ...... and ..... and ...... then sell .............
註:收盤那根 檢驗出 上下匡 數據後,於開盤那一根掛 STOP單,不是 LIMIT單。
收盤那一根,掛
Buy ("Stp1") 1 contracts next bar at XXXX stop;
SellShort ("Stp2") 1 contracts next bar at XXXX stop;