金字塔股指與300ETF之間的價差套利代碼[金字塔模型]
//股指與300ETF之間的價差套利代碼演示
//做空股指
VERTLINE(time=CLOSETIME(0),hhv(h,240/5),llv(l,240/5),coloryellow,1,vtDASH);
股指:"IF00$CLOSE",linethick0;
滬深300:"000300$CLOSE",linethick0;
差值:股指-滬深300,linethick0;
?
short:=差值>=20;
shortend:=差值<=10;
t1:=time>093500 and time<145500;
?
if holding=0 and t1 then begin
buyshort(short,1,thisclose);
end
?
if holding<0 and t1 then sellshort(shortend,1,thisclose);
?
?
?
//做多300ETF www.kzuj.com.cn
?
VERTLINE(time=CLOSETIME(0),hhv(h,240/5),llv(l,240/5),coloryellow,1,vtDASH);
股指:"IF00$CLOSE",linethick0;
滬深300:"000300$CLOSE",linethick0;
差值:股指-滬深300,linethick0;
?
long:=差值>=20;
longend:=差值<=10;
t1:=time>093500 and time<145500;
?
if holding=0 and t1 then begin
buy(long,1,thisclose);//www.kzuj.com.cn
end
?
if holding>0 and t1 then sell(longend,1,thisclose);
?
?
//特別提示,一手股指的合約金額比較大,對應(yīng)的ETF份數(shù)也比較大。這里需要自行調(diào)節(jié)買賣的ETF份數(shù)
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容