设为首页收藏本站

 找回密码
 注册
查看: 27874|回复: 41
打印 上一主题 下一主题

自适应动态突破系统(Dynamic Break Out II)tb版 [复制链接]

Rank: 7Rank: 7Rank: 7

精华
0
UID
397
积分
4818
帖子
87
主题
13
阅读权限
80
注册时间
2007-9-22
最后登录
2021-6-8
跳转到指定楼层
1#
发表于 2008-9-13 13:50:59 |只看该作者 |倒序浏览
Params
    Numeric ceilingAmt(60);
    Numeric floorAmt(20);
    Numeric bolBandTrig(2.00);
Vars
    Numeric lookBackDays(20);         
    Numeric todayVolatility(0);
    Numeric yesterDayVolatility(0);
    Numeric deltaVolatility(0);
    NumericSeries buyPoint(0);
    NumericSeries sellPoint(0);
    NumericSeries longLiqPoint(0);
    NumericSeries shortLiqPoint(0);
    Numeric upBand(0);
    Numeric dnBand(0);
    Numeric MidLine(0);
    Numeric Band(0);
Begin
    todayVolatility = StandardDev(Close,30,1);
    yesterDayVolatility = StandardDev(Close[1],30,1);
    deltaVolatility = (todayVolatility - yesterDayVolatility)/todayVolatility;
    lookBackDays = lookBackDays * (1 + deltaVolatility);
    lookBackDays = Round(lookBackDays,0);
    lookBackDays = Min(lookBackDays,ceilingAmt);
    lookBackDays = Max(lookBackDays,floorAmt);
    MidLine = AverageFC(Close,lookBackDays);
    Band = StandardDev(Close,lookBackDays,bolBandTrig);
    upBand = MidLine + bolBandTrig * Band;
    dnBand = MidLine - bolBandTrig * Band;
    buyPoint = Highest(High[1],lookBackDays);
    sellPoint = Lowest(Low[1],lookBackDays);
    longLiqPoint = Average(Close[1],lookBackDays);
    shortLiqPoint = Average(Close[1],lookBackDays);

if(Close > upBand)  
{
   If(CrossOver(high,buyPoint))   
  {
     Buy(1,max( buyPoint, Low ));

  }
Commentary("多头触发价:"+Text(buyPoint));

}

if(Close < dnBand)
{

   If(CrossUnder(Low,sellPoint ))
   {
      SellShort(1,min( sellPoint , High ));
   }
Commentary("空头触发价:"+Text(sellPoint));

}
if(MarketPosition == 1)
{  
   If(CrossUnder(Low,longLiqPoint ))
   {
      Sell(1,min( longLiqPoint , High ));
   }
Commentary("多头退出:"+Text(longLiqPoint));
}




if(MarketPosition == -1)

{
   If(CrossOver(high,shortLiqPoint))   
  {
     BuyToCover(1,max( shortLiqPoint, Low ));
  }
Commentary("多头退出:"+Text(shortLiqPoint));

}


End

[ 本帖最后由 ilian 于 2008-9-13 14:11 编辑 ]

Rank: 4

精华
0
UID
2276
积分
317
帖子
66
主题
20
阅读权限
50
注册时间
2008-9-4
最后登录
2008-10-20
2#
发表于 2008-9-13 19:21:56 |只看该作者
Tb的学习气氛越来越好了,鼓励一下,只有大家互相学习和交流,才能互相提高....
希望有一天能象学习MT的人一样多,一样交流啊...
交易开拓者交流
QQ-1群:38529330(已满)
QQ-2群:24771838

使用道具 举报

Rank: 4

精华
1
UID
213
积分
407
帖子
121
主题
32
阅读权限
50
注册时间
2007-8-28
最后登录
2019-4-5
3#
发表于 2008-9-14 10:10:46 |只看该作者
写的不错,鼓励一个

使用道具 举报

Rank: 10Rank: 10Rank: 10

精华
8
UID
2300
积分
66650
帖子
1956
主题
168
阅读权限
200
注册时间
2008-9-8
最后登录
2009-11-11
4#
发表于 2008-9-14 13:27:42 |只看该作者
MT是垃圾,特指国内的冒名MT,并非MT4

使用道具 举报

Rank: 6Rank: 6

精华
0
UID
427
积分
1600
帖子
175
主题
20
阅读权限
70
注册时间
2007-9-26
最后登录
2021-11-6
5#
发表于 2008-9-15 10:41:33 |只看该作者
非常好的系统  本人刚刚的在别的论坛上看到分析家版的这个系统。值得学习!!!

使用道具 举报

Rank: 7Rank: 7Rank: 7

精华
0
UID
644
积分
3332
帖子
284
主题
28
阅读权限
80
注册时间
2007-10-30
最后登录
2021-10-16
6#
发表于 2008-9-15 14:30:31 |只看该作者
效果不咋地

使用道具 举报

Rank: 2

精华
0
UID
2285
积分
117
帖子
15
主题
3
阅读权限
30
注册时间
2008-9-6
最后登录
2019-3-30
7#
发表于 2008-9-17 22:13:12 |只看该作者
努力学习中

使用道具 举报

Rank: 5Rank: 5

精华
0
UID
1384
积分
1102
帖子
212
主题
40
阅读权限
60
注册时间
2008-3-28
最后登录
2019-4-26
8#
发表于 2008-9-18 01:34:14 |只看该作者
文字表述呢?
这样一股脑上来代码  却不写思路 不易理解

使用道具 举报

Rank: 7Rank: 7Rank: 7

精华
0
UID
397
积分
4818
帖子
87
主题
13
阅读权限
80
注册时间
2007-9-22
最后登录
2021-6-8
9#
发表于 2008-9-18 11:15:05 |只看该作者
原帖由 bigbear2046 于 2008-9-18 01:34 发表
文字表述呢?
这样一股脑上来代码  却不写思路 不易理解

这里有一段解说

THE DYNAMIC BREAK OUT II STRATEGY
George Pruitt for Futures Magazine designed the original Dynamic Break Out
system in 1996. This version has done well since it was released for public consumption
in 1996. This version will be included in Appendix B. The newer
version of the Dynamic Break Out is just like the original, except we have
incorporated an additional adaptive filter.
The key to the Dynamic Break Out II system is its ability to adapt its
parameters to current market conditions. This system is based on the triedand-
tested Donchian channel system. Remember how the Donchian system
works; buy when the high of the day penetrates the highest high price of x bars
back, and sell when the low of the day penetrates the lowest low of x bars back.
If you optimize the number of bars to determine your best entry and exit levels,
you will discover that different markets work better with different parameters.
You will also discover that a particular market goes through different
cycles and works better with different parameters through time. For example,
the Japanese Yen may have performed better with a look back of 40 days in the
1980s, but now works better with a look back of 20 days. That is the major
problem with using a static parameter for all markets. The Dynamic Break Out
II system allows the number of look back days to change with the current market.
Instead of using a static parameter, this system changes the parameters
based on an aspect of the current market.
Before you can use an adaptive parameter, you must come up with a function
or adaptive engine that automatically changes the value of the once static
parameter. The input of this adaptive engine should be some form of market
statistic. In the case of the Dynamic Break Out II, we used market volatility.
When market volatility expands, so does the number of look back days in
our break out calculation. Increased market volatility usually equates to market
indecisiveness. By increasing the number of look back days when market
volatility increases, we make it more difficult for the system to initiate a trade.
When market volatility decreases, we reduce the number of look back days.
Low market volatility equates to a trending market. By decreasing the number
of look back days, we encourage the system to initiate a trade. This helps the
Dynamic Break Out II to lock into long-term profits and be on the look out
for a change in the long-term trend. We used market volatility to fuel our
adaptive engine, but you could use any market characteristic. We can visualize
an engine that uses a market’s overbought/oversold state. If we had a long
position in a market, and it became overbought, we could use an overbought/
oversold indicator to adapt the parameter that determines the sell point.
Once an adaptive engine is dreamed up and it is pumping out values, you
must maintain the values in an acceptable range. The Dynamic Break Out II
system will not let the look back days go above 60 or below 20. Through optimization,
we discovered that look back lengths that fell beyond these bound-

aries did not generate acceptable expectations. An adaptive engine that generates
useless values is useless in itself.
The Dynamic Break Out II initially looks back 20 days to determine its
buy and sell levels. So when you start trading this system, your first buy point
is the highest high of the past 20 days and your sell point is the lowest low of
the past 20 days. At the end of each day, you measure the current market
volatility by calculating the standard deviation of the past 30 day’s closing
prices. Market volatility can be measured using different calculations: average
range, average true range, standard deviation of change in closing prices, and
others. Once we determine today’s market volatility, we compare it with yesterday’s.
If the volatility increases, then the number of look back days also
increases. We change the number of look back days to the exact amount of the
change in market volatility; if volatility increases by ten percent, then so does
the number of look back days and vice versa.
The original Dynamic Break Out made its buying and selling decisions
solely based on the highest high and lowest low values that were generated by
our volatility-based adaptive engine. Once a position was initiated, a simple,
yet effective, $1500 money management stop was put into place. The newer
version uses the same entry technique in concert with an adaptive Bollinger
Band. The length of the Bollinger Band calculation is the same number of look
back days that is generated by the adaptive engine. The close of yesterday must
be above the upper band and today’s high must be greater than or equal to the
highest high of x bars back before a long position can be initiated (x bars back
is equal to our adaptive look back days value). Yesterday’s close must be below
the lower band and today’s low must be less than or equal to the lowest low of
x bars back before a short position can be taken. Instead of the simple money
management stop, we incorporated a dynamic trailing stop. As we have discussed,
the number of look back days changes on a daily basis. The adaptive
engine decides the amount of change. The liquidation point of an existing
trade is determined by calculating a simple moving average of closing prices for
the past look back days. The sell liquidation would be just the opposite of the
buy liquidation.

使用道具 举报

Rank: 2

精华
0
UID
1406
积分
98
帖子
19
主题
4
阅读权限
30
注册时间
2008-4-2
最后登录
2008-9-21
10#
发表于 2008-9-21 16:30:33 |只看该作者
longLiqPoint = Average(Close[1],lookBackDays);
    shortLiqPoint = Average(Close[1],lookBackDays);

请问什么意思?为何相同?

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-2 08:36

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部