|
這個程式不知道哪裡錯誤?並不會執行移動停利 ,請知道的前輩指導一下 ,謝謝!
inputs:f1(0.2),Price( Close ), FastLength( 9 ), SlowLength( 18 ),Displace( 0 );
vars:s(0),f(0),var0(0),var1(0);
var0 =XAverage( Price, FastLength ) ;
var1 = XAverage( Price, SlowLength ) ;
setstoploss(50*35);
if marketposition =0 and time>845 and time<1200 and var0 crosses over var1 and c>o then begin
s=l-(h-l) ;
buy("B")NEXT bar at O ;
end;
if h>h[1] then f=f+f1;
sell("sellss") next bar at s=s+f*(h-s) stop ;
if time = 1330 then begin
sell this bar at close;
buytocover this bar at close;
end; |
|