紅黑三兵交易系統源碼[金字塔模型]
相關標簽:惠比特交易和配種專區,夢三國交易專區,夢三國交易專區速秒,靈緹格力交易專區,中京交易市場下載專區,古幣銀元交易專區,長毛德牧交易專區,夢三國交易專區在哪里,qq交易專區,
模型策略源碼:
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
{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}
==================================
源碼解析:
輸出 RUNMODE:0
輸出 VARIABLE:MYHOLDING=0
BUYCOND賦值:昨日ALL(ISUP,3)
BUYSHORTCOND賦值:昨日ALL(ISDOWN,3)
LOTS賦值:CASH(0)/(開盤價*MULTIPLIER*0.1)
BUY(1,LOTS,LIMITR,開盤價)
MYHOLDING賦值:LOTS
LOTS賦值:CASH(0)/(開盤價*MULTIPLIER*0.1)
BUYSHORT(1,LOTS,LIMITR,開盤價)
MYHOLDING賦值:-LOTS
END 邏輯判斷 MYHOLDING>0 AND 時間=CLOSETIME(0) THEN BEGIN SELL(1,MYHOLDING,LIMITR,收盤價)
MYHOLDING賦值:0
END 邏輯判斷 MYHOLDING<0 AND 時間=CLOSETIME(0) THEN BEGIN SELLSHORT(1,MYHOLDING,LIMITR,收盤價)
MYHOLDING賦值:0
END
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容