//if barfreq<>"Tick" then raiseruntimeerror("只適用於Tick")
if barfreq<>"Min" or barinterval<>1 then raiseruntimeerror("只適用於1分鐘線");
variable:count(0);
if date<>date[1] then count=0;
count=count+1;
input: OP(2.5);
input: EP(7.99);
setinputname(3,"開高下限%");
setinputname(4,"開高上限%");
if GetField("開盤價","D")>=GetField("收盤價","D")[1]*(1+OP/100)
and GetField("開盤價","D")<=GetField("收盤價","D")[1]*(1+EP/100)
and count>=1
and volume>0
then ret=1;
--------------------------------------------------------------------------------------------------------------------
//if barfreq<>"Tick" then ("只適用於Tick")
if barfreq="Min" and barinterval=1 then //"只適用於1分鐘線"
begin{A}
variable:count(0);
if date<>date[1] then count=0;
count=count+1;
input: OP(2.5);
input: EP(7.99);
setinputname(3,"開高下限%");
setinputname(4,"開高上限%");
if GetField("開盤價","D")>=GetField("收盤價","D")[1]*(1+OP/100)
and GetField("開盤價","D")<=GetField("收盤價","D")[1]*(1+EP/100)
and count>=1
and volume>0 then
retmsg="多單進場"; {設定策略的進場訊息}
ret=1; {策略觸發}
end //end{A}
--------------------------------------------------------------------------------------------------------------------
上方兩策略程式的差異,只差在下方的這個多單進場策略訊息...........
<<<<<<<<< retmsg="多單進場"; {設定策略的進場訊息} >>>>>>>>>>
回測出來的結果完全不一樣,蠻誇張的..........

5 評論