金字塔Dual Thrust日內(nèi)策略模型源碼集錦 多個(gè)版本源碼[金字塔模型]
Dual Thrust與R-Breaker一樣,曾長期排名 Future Trust雜志最賺錢的策略。該策略在形式上和開盤區(qū)間突破策略類似。不同點(diǎn)主要體現(xiàn)在兩方面:Dual Thrust在Range(代碼中的浮動(dòng)區(qū)間)的設(shè)置上,引入前N日的四個(gè)價(jià)位,使得一定時(shí)期內(nèi)的Range相對穩(wěn)定,可以適用于日間的趨勢跟蹤;Dual Thrust對于多頭和空頭的觸發(fā)條件,考慮了非對稱的幅度,做多和做空參考的Range可以選擇不同的周期數(shù),也可以通過參數(shù)K1和K2來確定。 來源 www.tumamayizhan.com
當(dāng)K1<K2時(shí),多頭相對容易被觸發(fā),當(dāng)K1>K2時(shí),空頭相對容易被觸發(fā)。因此,投資者在使用該策略時(shí),一方面可以參考?xì)v史數(shù)據(jù)測試的最優(yōu)參數(shù),另一方面,則可以根據(jù)自己對后勢的判斷,或從其他大周期的技術(shù)指標(biāo)入手,階段性地動(dòng)態(tài)調(diào)整K1和K2的值。
此主題相關(guān)圖片如下:dual thrust.jpg
//修訂時(shí)間:2012.11.1
//Designed By Rogarz
////////////////////////=================================================
第二種版源碼:
適合日線以下 任何周期 中間直接調(diào)用 日線數(shù)據(jù) 不過每天要把畫面切換到 日線周期 刷新一個(gè)昨日的日線數(shù)據(jù)
還有注意費(fèi)率設(shè)置 要改成期貨 15% 合約單位 按該品種自己調(diào)整 手續(xù)費(fèi)自己調(diào)整
input:k(0.7,0.1,1,0.1);
predayhigh:=callstock(stklabel,vthigh,6,-1);//昨日最高價(jià)
predaylow:=callstock(stklabel,vtlow,6,-1);//昨日最低價(jià)
predayclose:=callstock(stklabel,vtclose,6,-1);//昨日收盤價(jià)
predayrange:=max(predayhigh-predayclose,predayclose-predaylow);//取大波動(dòng)值
dayopen:=callstock(stklabel,vtopen,6,0);//今天開盤價(jià)
upperband:intpart(dayopen+k*predayrange),colorred;//區(qū)間上沿
lowerband:intpart(dayopen-k*predayrange),colorgreen;//區(qū)間下沿
下日波動(dòng):max(callstock(stklabel,vthigh,6,0)-callstock(stklabel,vtclose,6,0),callstock(stklabel,vtclose,6,0)-callstock(stklabel,vtlow,6,0))*0.7;
if holding=0 then begin
if high>=upperband then
buy(1,volunit,limitr,max(open,upperband));
end
if holding=0 then begin
if low<=lowerband then
buyshort(1,volunit,limitr,min(open,lowerband));
end
if holding>0 then begin
if low<=lowerband then begin
sell(1,holding,limitr,min(open,lowerband));
buyshort(1,volunit,limitr,min(open,lowerband));
end
if time>=closetime(0) then
sell(1,holding,limitr,close);
end
if holding<0 then begin
if high>=upperband then begin
sellshort(1,holding,limitr,max(open,upperband));
buy(1,volunit,limitr,max(open,upperband));
end
//www.tumamayizhan.com
if time>=closetime(0) then
sellshort(1,holding,limitr,close);
end
資產(chǎn):ASSET,PRECISION0,NOAXIS,COLORFF00FF;
goodin:=(1-(asset/hhv(asset,5520)))*100;
資產(chǎn)回撤百分比:goodin;
資產(chǎn)實(shí)際虧損:hhv(asset,5520)-asset,COLORgreen;
//////////////=================================
第三版本源碼:
input:k(0.7,0.1,1,0.1);
dist1:=barslast(day>ref(day,1))+1;
dist2:=ref(dist1,dist1);
predayhigh:=ref(hhv(high,dist2),dist1);
predaylow:=ref(llv(low,dist2),dist1);
predayclose:=ref(close,dist1);
predayrange:=max(predayhigh-predayclose,predayclose-predaylow);
="Verdana">dayopen:=ref(open,dist1-1);
upperband:=dayopen+k*predayrange;
lowerband:=dayopen-k*predayrange;
if holding=0 then begin
if high>=upperband then
buy(1,volunit,limitr,max(open,upperband));
end
if holding=0 then begin
if low<=lowerband then
buyshort(1,volunit,limitr,min(open,lowerband));
end
if holding>0 then begin
if low<=lowerband then begin
sell(1,holding,limitr,min(open,lowerband));
buyshort(1,volunit,limitr,min(open,lowerband));
end
// www.tumamayizhan.com
if time>=closetime(0) then
sell(1,holding,limitr,close);
end
if holding<0 then begin
if high>=upperband then begin
sellshort(1,holding,limitr,max(open,upperband));
buy(1,volunit,limitr,max(open,upperband));
end
if time>=closetime(0) then
sellshort(1,holding,limitr,close);
end
資產(chǎn):asset,noaxis,colorred,linethick2;
{別忘了將本網(wǎng)告訴您身邊的朋友,向朋友傳達(dá)有用資料,也是一種人情,你朋友會(huì)感謝你的。}
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容