软件名称:[B]金字塔Dual Thrust日内策略模型源码集锦 多个版本源码[金字塔模型][/B]
软件类型:国产软件
运行环境:Win2000/WinXP/Win2003/WinVista
软件语言:简体中文
授权方式:共享软件
软件大小:0 Bytes
官方主页:Home Page
更新时间:2013-11-08 00:36:48
软件简介:
Dual Thrust与R-Breaker一样,曾长期排名 Future Trust杂志最赚钱的策略。该策略在形式上和开盘区间突破策略类似。不同点主要体现在两方面:Dual Thrust在Range(代码中的浮动区间)的设置上,引入前N日的四个价位,使得一定时期内的Range相对稳定,可以适用于日间的趋势跟踪;Dual Thrust对于多头和空头的触发条件,考虑了非对称的幅度,做多和做空参考的Range可以选择不同的周期数,也可以通过参数K1和K2来确定。 来源 www.70822.com
当K1<K2时,多头相对容易被触发,当K1>K2时,空头相对容易被触发。因此,投资者在使用该策略时,一方面可以参考历史数据测试的最优参数,另一方面,则可以根据自己对后势的判断,或从其他大周期的技术指标入手,阶段性地动态调整K1和K2的值。
//修订时间:2012.11.1
//Designed By Rogarz
////////////////////////=================================================
第二种版源码:
适合日线以下 任何周期 中间直接调用 日线数据 不过每天要把画面切换到 日线周期 刷新一个昨日的日线数据
还有注意费率设置 要改成期货 15% 合约单位 按该品种自己调整 手续费自己调整
input:k(0.7,0.1,1,0.1);
predayhigh:=callstock(stklabel,vthigh,6,-1);//昨日最高价
predaylow:=callstock(stklabel,vtlow,6,-1);//昨日最低价
predayclose:=callstock(stklabel,vtclose,6,-1);//昨日收盘价
predayrange:=max(predayhigh-predayclose,predayclose-predaylow);//取大波动值
dayopen:=callstock(stklabel,vtopen,6,0);//今天开盘价
upperband:intpart(dayopen+k*predayrange),colorred;//区间上沿
lowerband:intpart(dayopen-k*predayrange),colorgreen;//区间下沿
下日波动: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.70822.com
if time>=closetime(0) then
sellshort(1,holding,limitr,close);
end
资产:ASSET,PRECISION0,NOAXIS,COLORFF00FF;
goodin:=(1-(asset/hhv(asset,5520)))*100;
资产回撤百分比:goodin;
资产实际亏损: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.70822.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));
&nb
[url=http://www.70822.com/soft/sort013/sort068/down-66997.html]金字塔Dual Thrust日内策略模型源码集锦 多个版本源码[金字塔模型][/url]