用于股指期貨的突破交易策略源碼及解析[金字塔模型]
- 源碼內(nèi)容:
input:n1(32,6,50,1);
W1:=-100*(HHV(H,N1)-C)/(HHV(H,N1)-LLV(L,N1))+50;
T1:=TIME>093000 AND TIME<143500;
T2:=TIME>150500;if W1>45 AND REF(ANY(W1>45,9),1) then begin
sellshort(holding<0, 0, thisclose);
buy(holding=0 AND T1, 1, thisclose);
endif HHV(H,5)>1.0094*C OR T2 then sell(holding>0, 0, thisclose);
if W1<-45 AND REF(ANY(W1<-45,9),1) then begin
sell(holding>0, 0, thisclose);
buyshort(holding=0 AND T1, 1, thisclose);
endif C>1.0094*LLV(L,5) OR T2 then sellshort(holding<0, 0, thisclose);
- 源碼解析:
input:n1(32,6,50,1);//參數(shù)n1,默認(rèn)值為32
W1:=-100*(HHV(H,N1)-C)/(HHV(H,N1)-LLV(L,N1))+50;//定義w1
T1:=TIME>093000 AND TIME<143500;//時(shí)間段1,下單時(shí)間T2:=TIME>150500;//時(shí)間段2,強(qiáng)平時(shí)間
if W1>45 AND REF(ANY(W1>45,9),1) then begin//滿足w1>45和 前9個(gè)周期中任意一個(gè)周期滿足w1>45 則平空開多
sellshort(holding<0, 0, thisclose);
buy(holding=0 AND T1, 1, thisclose);//開多還需要在T1時(shí)間內(nèi)
endif HHV(H,5)>1.0094*C OR T2 then sell(holding>0, 0, thisclose);//5周期最高價(jià)> 收盤價(jià)*1.0094 或者 T1時(shí)間時(shí),平倉(cāng)
if W1<-45 AND REF(ANY(W1<-45,9),1) then begin//滿足w1<-45 和 前9個(gè)周期中任意一個(gè)周期滿足w2<-45,則平多開空
sell(holding>0, 0, thisclose);
buyshort(holding=0 AND T1, 1, thisclose);//開空還要在T1時(shí)間內(nèi)
endif C>1.0094*LLV(L,5) OR T2 then sellshort(holding<0, 0, thisclose);//收盤價(jià)>5周期最低價(jià)*1.0094 或者在T2時(shí)間時(shí),平空
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容