相關(guān)標(biāo)簽:外匯交易mt4如何平倉(cāng),平倉(cāng)交易,交易開(kāi)拓者 平倉(cāng)效率,貴金屬交易平倉(cāng)是什么,內(nèi)海直子迅雷原創(chuàng)專(zhuān)區(qū),晚中晚bt原創(chuàng)專(zhuān)區(qū),原創(chuàng)專(zhuān)區(qū),網(wǎng)賺原創(chuàng)教程專(zhuān)區(qū),惠比特交易和配種專(zhuān)區(qū),
開(kāi)倉(cāng)條件為A對(duì)應(yīng)平倉(cāng)條件A1。開(kāi)倉(cāng)條件為B的話(huà)對(duì)應(yīng)平倉(cāng)條件為B1。
模型策略源碼:
VARIABLE:aa=0;
VARIABLE:bb=0;
if holding=0 then aa:=0;
if holding=0 then bb:=0;
h20:ref(hhv(h,20),1);
l20:ref(llv(l,20),1);
ma2:ma(c,30);
A:=cross(c,h20);
A1:=cross(l20,c);
B:=cross(c,ma2);
B1:=cross(ma2,c);
if aa=1 and holding>0 and A1 then sell(1,holding,limitr,c);
if bb=1 and holding>0 and B1 then sell(1,holding,limitr,c);
if A and holding=0 then
begin
buy(1,1,limitr,c);
IF A and holding>0 THEN aa:=1;
end
if B and holding=0 then
begin
buy(1,1,limitr,c);
IF B and holding>0 THEN bb:=1;
end
{別忘了將本網(wǎng)告訴您身邊的朋友,向朋友傳達(dá)有用資料,也是一種人情,你朋友會(huì)感謝你的。}