|
為了實驗方便 ,把手工設定價為改成浮動這樣 +100 -100也是浮動
這樣人工下單 ,機器幫忙看家的方式就自行發揮了~~~~
input: FirstLots(30),handkeyprice(7800),starttime(0845),endtime(1344),TP(100),SL(50) ;
var: aa(0),mp(0),counter(0),ename(""),counter2(0);
mp=marketposition*currentcontracts;
if mp=0 and time>starttime and time<endtime then begin
once(close=handkeyprice)begin
buy ("firstentry") FirstLots contract next bar at handkeyprice limit;
aa=handkeyprice;
end;
end;
if mp>0 and time>starttime and time<endtime then begin
if close-aa<-SL then begin
buy("Buy") 1 contract next bar at market;
counter2=counter2+1;
aa=aa-SL;
end else if close-aa>TP then begin
If counter2<=0 then begin
counter=counter+1;
ename="S"+NumtoStr(counter,0);
sell(ename) 1 contract total next bar at market;
end else begin
sell from entry("Buy") 1 contract total next bar at market;
counter2=counter2-1;
end;
aa=aa+TP;
end;
end;
|
評分
-
查看全部評分
|