var: max_open(0), min_open(0), mp(0);
if time>=900 and time<=930 then begin
if high>value1 then value1=high;
if value2>low or value2=0 then value2=low;
end
else if time[1]>=900 and time[1]<=930 then begin
max_open=value1;
min_open=value2;
value1=0;
value2=0;
end;
mp=marketposition;
if time>930 and time<2130 and mp=0 then begin
buy next bar at max_open stop;
sellshort next bar at min_open stop;
end;
以上是幫您調(diào)整的代碼,當(dāng)時(shí)間在9:30到21:30之間時(shí),以開盤30分鐘的最高價(jià)發(fā)送停損買單,以開盤30分鐘的最低價(jià)發(fā)送停損賣單。
一、關(guān)于買賣語(yǔ)句的使用,看一下這個(gè)帖子http://forums.icetech.com.cn/for ... 3125&extra=page%3D6
二、close>value1或者close<vvalue2返回的是布爾值,您將它用于計(jì)算委托單價(jià)格,編譯沒有問(wèn)題,但是價(jià)格就是0或者1
?
var: max_open(0), min_open(0), mp(0);
if time>=900 and time<=930 then begin
if high>value1 then value1=high;
if value2>low or value2=0 then value2=low;
end
else if time[1]>=900 and time[1]<=930 then begin
max_open=value1;
min_open=value2;
value1=0;
value2=0;
end;
mp=marketposition;
if time>930 and time<2130 and mp=0 then begin
buy next bar at max_open stop;
sellshort next bar at min_open stop;
end;
以上是幫您調(diào)整的代碼,當(dāng)時(shí)間在9:30到21:30之間時(shí),以開盤30分鐘的最高價(jià)發(fā)送停損買單,以開盤30分鐘的最低價(jià)發(fā)送停損賣單。
一、關(guān)于買賣語(yǔ)句的使用,看一下這個(gè)帖子http://forums.icetech.com.cn/for ... 3125&extra=page%3D6
二、close>value1或者close<vvalue2返回的是布爾值,您將它用于計(jì)算委托單價(jià)格,編譯沒有問(wèn)題,但是價(jià)格就是0或者1