http://www.7klian.com

点宽专栏-DualThrust生意业务计策

1.Dual Thrust?生意业务计策

1.1Dual Thrust计策先容

Dual Thrust是一个趋势跟踪系统,由Michael Chalek在20世纪80年月开拓,曾被Future Thruth杂志评为最赚钱的计策之一。Dual Thrust系统具有简朴易用、适费用广的特点,其思路简朴、参数很少,共同差异的参数、止盈止损和仓位打点,可觉得投资者带来恒久不变的收益,被投资者遍及应用于股票、钱币、贵金属、债券、能源及股指期货市场等。在Dual Thrust生意业务系统中,对付震荡区间的界说很是要害,这也是该生意业务系统的焦点和精华。Dual Thrust系统利用Range = Max(HH-LC,HC-LL)来描写震荡区间的巨细。个中HH是N日High的最高价,LC是N日Close的最低价,HC是N日Close的最高价,LL是N日Low的最低价。

1.2详细道理公式:

1、首先计较:(1)N日High的最高价HH, N日Close的最低价LC;(2)N日Close的最高价HC,N日Low的最低价LL;(3)Range = Max(HH-LC,HC-LL)(4)BuyLine = Open + K1×Range(5)SellLine = Open + K2×Range

2.结构系统(1)当价值向上打破上轨时,假如其时持有空仓,则先平仓,再开多仓;假如没有仓位,则直接开多仓;(2)当价值向下打破下轨时,假如其时持有多仓,泽县平川,再开空仓;假如没有仓位,则直接开空仓;

2.本计策思路

1.当打破上界(Buyline),做多,,并加均线过滤条件与生意业务量突变。2.当打破下界(Sellline),做空,并加均线过滤条件与生意业务量突变。3.进场利用转动平均价止盈止损

3.计策代码分享

function DualThrust( N,freq,K1,K2,stop_rate )%DualThrust思想加均线过滤条件加生意业务量变换% ? Detailed explanation goes hereHandleList=traderGetHandleList();TargetList=traderGetTargetList();global TTglobal epriceif?isempty(TT)||isempty(eprice)? ?TT=zeros(length(TargetList),1);? ? eprice=zeros(length(TargetList),1);end[ValidCash,MarketCap,OrderFrozen,MarginFrozen,PositionProfit] = traderGetAccountInfo(HandleList);lags=60;for?i=1:length(TargetList)? ?[name,lastTD,Multiple,MinMove,TradingFeeOpen,TradingFeeClose,TradingFeeCloseToday,LongMargin,ShortMargin] = traderGetFutureInfo(TargetList(i).Market,TargetList(i).Code);? ? [time,open,high,low,close,volume,turnover,openinterest]=traderGetKData(TargetList(i).Market,TargetList(i).Code,'day',freq,0-lags,0,false,'FWard');? ?[Position,Frozen,AvgPrice] = traderGetAccountPosition(HandleList,TargetList(i).Market,TargetList(i).Code);? ?if?length(close)<lags? ? ? ?continue;? ?end? ?sharenum=floor((ValidCash+MarketCap)*0.8/length(TargetList)/close(end)/Multiple);? ?HH=max(high(end-N:end-1));? ?HC=max(close(end-N:end-1));? ?LC=min(close(end-N:end-1));? ?LL=min(low(end-N:end-1));? ?Range=max(HH-LC,HC-LL);? ?buyline=open(end)+K1*Range;? ?sellline=open(end)-K2*Range;? ?if?TT(i)==1? ? ? ?eprice(i)=AvgPrice;? ? ? ?TT(i)=0;? ?end? ?if?Position==0? ? ? ?if?close(end)>buyline&&close(end)>mean(close(end-4:end))&&volume(end)>mean(volume(end-5:end))? ? ? ? ? ? orderID=traderBuy(HandleList,TargetList(i).Market,TargetList(i).Code,sharenum,0,'Market','buy');? ? ? ? ? ??if?orderID~=0? ? ? ? ? ? ? ? TT(i)=1;? ? ? ? ? ??end? ? ? ?elseif close(end)<sellline&&close(end)<mean(close(end-4:end))&&volume(end)>mean(volume(end-5:end))? ? ? ? ? ? orderID=traderSellShort(HandleList,TargetList(i).Market,TargetList(i).Code,sharenum,0,'Market','sell');? ? ? ? ? ? ?if?orderID~=0? ? ? ? ? ? ? ? TT(i)=1;? ? ? ? ? ??end? ? ? ?end? ?elseif Position>0? ? ? ?if?close(end)>eprice(i)*(1+3*stop_rate)? ? ? ? ? ?eprice(i)=close(end);? ? ? ?elseif close(end)<eprice(i)*(1-stop_rate)? ? ? ? ? ?traderPositionTo(HandleList,TargetList(i).Market,TargetList(i).Code,0,0,'Market','stoplong');? ? ? ?end? ?else? ? ? ?if?close(end)<eprice(i)*(1-3*stop_rate)? ? ? ? ? ?eprice(i)=close(end);? ? ? ?elseif close(end)>eprice(i)*(1+stop_rate)? ? ? ? ? ?traderPositionTo(HandleList,TargetList(i).Market,TargetList(i).Code,0,0,'Market','stoplong');? ? ? ?end? ?endendend3.2执行文件targetList1 = traderGetCodeList('dce000');targetList2 =traderGetCodeList('czce000');targetList3 = traderGetCodeList('shfe000');targetList=[targetList1,targetList2,targetList3];targetList=targetList([2??7?8?10??33??40??43?44?45??47]);K1=0.5;K2=0.5;stop_rate=0.05;freq=1;N=10;AccountList(1) = {'FutureBackReplay'};traderRunBacktest('DualThrust',@DualThrust,{ N,freq,K1,K2,stop_rate },AccountList(1),targetList,'day',1,20100103,20161101,'FWard');

4.回测表示

随机挑选十支生意业务量活泼差异品种的期货自2010年1月至2016年11月举办日频回测

点宽专栏-DualThrust买卖战略

点宽专栏-DualThrust买卖战略

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。