//宣告
var: openHigh(0), openLow(0) ,closeAvg(0);
//定義K棒率
if barfreq<>"Min" and barInterval<>5 then raiseRunTimeError("只支援5分K");
//換日初始
if Date<>Date[1] then begin
openHigh=0;
openLow=0;
closeAvg=0;
end;
//取值
if time=133000 then begin
openHigh=High[1];
openLow=Low[1];
closeAvg= (openHigh+ openLow)/2;
end;
//進場條件
//filters 濾網自加
if open > closeAvg then condition1 = true;
if open < closeAvg then condition2 = true;
//進場
if position=0 and condition1 then setposition(1);
if position=0 and condition2 then setposition(-1);
//出場條件
if position<>0 and condition3 then setposition(0);
1 評論