相關(guān)標(biāo)簽:惠比特交易和配種專區(qū),夢(mèng)三國(guó)交易專區(qū),夢(mèng)三國(guó)交易專區(qū)速秒,靈緹格力交易專區(qū),中京交易市場(chǎng)下載專區(qū),古幣銀元交易專區(qū),長(zhǎng)毛德牧交易專區(qū),夢(mèng)三國(guó)交易專區(qū)在哪里,qq交易專區(qū),
模型策略源碼:
runmode:0;
variable:myholding=0;
buycond:=ref(all(isup,3),1);
buyshortcond:=ref(all(isdown,3),1);
if myholding=0 and buycond then begin
lots:=cash(0)/(open*multiplier*0.1);
buy(1,lots,limitr,open);
myholding:=lots;
end
if myholding=0 and buyshortcond then begin
lots:=cash(0)/(open*multiplier*0.1);
buyshort(1,lots,limitr,open);
myholding:=-lots;
end
if myholding>0 and time=closetime(0) then begin
sell(1,myholding,limitr,close);
myholding:=0;
end
if myholding<0 and time=closetime(0) then begin
sellshort(1,myholding,limitr,close);
myholding:=0;
end
{別忘了將本網(wǎng)告訴您身邊的朋友,向朋友傳達(dá)有用資料,也是一種人情,你朋友會(huì)感謝你的。}
==================================
源碼解析:
輸出 RUNMODE:0
輸出 VARIABLE:MYHOLDING=0
BUYCOND賦值:昨日ALL(ISUP,3)
BUYSHORTCOND賦值:昨日ALL(ISDOWN,3)
LOTS賦值:CASH(0)/(開(kāi)盤價(jià)*MULTIPLIER*0.1)
BUY(1,LOTS,LIMITR,開(kāi)盤價(jià))
MYHOLDING賦值:LOTS
LOTS賦值:CASH(0)/(開(kāi)盤價(jià)*MULTIPLIER*0.1)
BUYSHORT(1,LOTS,LIMITR,開(kāi)盤價(jià))
MYHOLDING賦值:-LOTS
END 邏輯判斷 MYHOLDING>0 AND 時(shí)間=CLOSETIME(0) THEN BEGIN SELL(1,MYHOLDING,LIMITR,收盤價(jià))
MYHOLDING賦值:0
END 邏輯判斷 MYHOLDING<0 AND 時(shí)間=CLOSETIME(0) THEN BEGIN SELLSHORT(1,MYHOLDING,LIMITR,收盤價(jià))
MYHOLDING賦值:0
END