怎么捕捉開(kāi)盤(pán)30分鐘的高點(diǎn)和低點(diǎn)? [MC]
-
MC用戶求助:
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í),以開(kāi)盤(pán)30分鐘的最高價(jià)發(fā)送停損買(mǎi)單,以開(kāi)盤(pán)30分鐘的最低價(jià)發(fā)送停損賣(mài)單。
一、關(guān)于買(mǎi)賣(mài)語(yǔ)句的使用,看一下這個(gè)帖子http://forums.icetech.com.cn/for ... 3125&extra=page%3D6
二、close>value1或者close<vvalue2返回的是布爾值,您將它用于計(jì)算委托單價(jià)格,編譯沒(méi)有問(wèn)題,但是價(jià)格就是0或者1?
-
MC回復(fù)討論一:
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í),以開(kāi)盤(pán)30分鐘的最高價(jià)發(fā)送停損買(mǎi)單,以開(kāi)盤(pán)30分鐘的最低價(jià)發(fā)送停損賣(mài)單。
一、關(guān)于買(mǎi)賣(mài)語(yǔ)句的使用,看一下這個(gè)帖子http://forums.icetech.com.cn/for ... 3125&extra=page%3D6
二、close>value1或者close<vvalue2返回的是布爾值,您將它用于計(jì)算委托單價(jià)格,編譯沒(méi)有問(wèn)題,但是價(jià)格就是0或者1
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容