三均線指路交易系統(tǒng)[金字塔模型]
相關(guān)標(biāo)簽:現(xiàn)貨均線交易系統(tǒng),期貨簡(jiǎn)單均線交易系統(tǒng),5種均線交易系統(tǒng),最好的均線交易系統(tǒng),均線交易系統(tǒng),外匯均線交易系統(tǒng),最簡(jiǎn)單均線交易系統(tǒng),我的外匯均線交易系統(tǒng),外匯120均線交易系統(tǒng),
三均線指路交易系統(tǒng)源碼:
runmode:0;
input:period1(4,1,100,1);
input:period2(9,1,100,1);
input:period3(18,1,100,1);
variable:myasset=30000;
entertime:=time>=092500 and time<=145500;
exittime:=time>=150000;
ma1:=ma(close,period1);
ma2:=ma(close,period2);
ma3:=ma(close,period3);
buycond:=entertime and ref(close>ma1 and ma1>ma2 and ma2>ma3,1);
buyprice:=open;
buyshortcond:=entertime and ref(close<ma1 and ma1<ma2 and ma2<ma3,1);
buyshortprice:=open;
if holding=0 and buycond then begin
buy(1,1,limitr,buyprice);
end
if holding=0 and buyshortcond then begin
buyshort(1,1,limitr,buyshortprice);
end
if holding>0 and exittime then begin
sell(1,holding,limitr,close);
end
if holding<0 and exittime then begin
sellshort(1,holding,limitr,close);
end
if exittime then
myasset:=asset;
資產(chǎn):myasset,noaxis,colormagenta;
次數(shù):totaltrade,linethick0;
收益:(myasset-30000)/30000,linethick0;
勝率:percentwin,linethick0;
出擊:totaltrade/(count(date<>ref(date,1),0)+1),linethick0;
連虧:maxseqloss,linethick0;
連贏:maxseqwin,linethick0;
{別忘了將本網(wǎng)告訴您身邊的朋友,向朋友傳達(dá)有用資料,也是一種人情,你朋友會(huì)感謝你的。}
源碼解析:
輸出 RUNMODE:0
輸出 INPUT:PERIOD1(4,1,100,1)
輸出 INPUT:PERIOD2(9,1,100,1)
輸出 INPUT:PERIOD3(18,1,100,1)
輸出 VARIABLE:MYASSET=30000
ENTERTIME賦值:TIME>=092500 AND TIME<=145500
EXITTIME賦值:TIME>=150000
MA1賦值:收盤價(jià)的PERIOD1日簡(jiǎn)單移動(dòng)平均
MA2賦值:收盤價(jià)的PERIOD2日簡(jiǎn)單移動(dòng)平均
MA3賦值:收盤價(jià)的PERIOD3日簡(jiǎn)單移動(dòng)平均
BUYCOND賦值:ENTERTIME AND 昨日CLOSE>MA1ANDMA1>MA2ANDMA2>MA3
BUYPRICE賦值:開(kāi)盤價(jià)
BUYSHORTCOND賦值:ENTERTIME AND 昨日CLOSE<MA1ANDMA1<MA2ANDMA2<MA3
BUYSHORTPRICE賦值:開(kāi)盤價(jià)
邏輯判斷 HOLDING=0 AND BUYCOND THEN BEGIN BUY(1,1,LIMITR,BUYPRICE)
END 邏輯判斷 HOLDING=0 AND BUYSHORTCOND THEN BEGIN BUYSHORT(1,1,LIMITR,BUYSHORTPRICE)
END 邏輯判斷 HOLDING>0 AND EXITTIME THEN BEGIN SELL(1,HOLDING,LIMITR,收盤價(jià))
END 邏輯判斷 HOLDING<0 AND EXITTIME THEN BEGIN SELLSHORT(1,HOLDING,LIMITR,收盤價(jià))
MYASSET賦值:ASSET
輸出 資產(chǎn):MYASSET,NOAXIS,畫洋紅色
輸出 次數(shù):TOTALTRADE,線寬為0
輸出 收益:(MYASSET-30000)/30000,線寬為0
輸出 勝率:PERCENTWIN,線寬為0
輸出 出擊:TOTALTRADE/(統(tǒng)計(jì)0日中滿足DATE<>REF(日期,1)的天數(shù)+1),線寬為0
輸出 連虧:MAXSEQLOSS,線寬為0
輸出 連贏:MAXSEQWIN,線寬為0
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容