分享

趋势突破系统--hans123 详解

 真圆易行 2012-11-10
  • 授权形式
  • 更新时间:2009-01-03 09:38:27
  • 前测记录: 暂无
  • 货 币 对
  • 时 间 段
  • 文件大小:17.62 KB
  • 评论等级:★★★☆☆
  • 下载次数336(今日:1,本周:1,本月:1
软件简介

国际上著名的著名的趋势突破系统 hans
引起了广泛的关注
已经发展更新了多种版本
当初也引起了国人的关注
但草草研究的结果
认为程序跑不通或者亏损
就把它盖棺定论枪毙了
但是国外仍然仍然持续研究发展它
版本从v1.0到v9.0
测试报告也从几个月到几年
甚至有从1999年开始的至今的测试报告
我因研究的需要从浩瀚的资料中选取了一些重要的部分
公诸同好
我看了国内的一些网站
这里目前是比较详细的
重要的是澄清了对它的一些误解
应该是不错的值得研究发展的方向
对一些原来用于盘整的ea
它是可以提供改进完善使之扩大也用于单边趋势的思路

这里是开始的原始资料
Simple Combined Breakout System for EUR/USD and GBP/USD  * Determine the 06.00 CET – 10.00 CET High Low on EUR/USD and GBP/USD
  * Determine the 10.00 CET – 14.00 CET High Low on EUR/USD and GBP/USD
  * Set BuyStop at High + 5 pips and SellStop at Low - 5 pips for both  frames and both currencies
  * Set Target Price at entry + 80 pips for EUR/USD and entry + 120 pips for GBP/USD
  * Set StopLoss at entry - 50 pips for EUR/USD and entry - 70 pips for GBP/USD. If the other side of the breakout is within 50 pips for EUR/USD or within 70 pips for GBP/USD then the StopLoss will be that level (Longtrade: SL = Low range - 5 pips = SellStop; Shorttrade: SL = High range + 5 pips = BuyStop)
  * Move the SL to breakeven after a gain of 30 pips for EUR/USD and a gain of 40 pips for GBP/USD
  * If a certain position is taken and price turns agains you and it breaks the other side of the breakout channel then turn. If the breakout channel is broader then the stoploss first the stoploss will be hit. If the breakout channel is narrower then the stoploss then hitting the other side means that you have to turn your position. There is only one turn per  frame possible
  * At 24.00 CET all orders expiring and close all trades at market. On Friday we do the same at 23.00 CET.
This link displays the  in every major city in the world: http://www.qlock.com./ I am using CET time (Amsterdam, Frankfurt).
Results October 2005:
10/03 : -22 pips
10/04: -61 pips
10/05: -103 pips
10/06: +168 pips
10/07: +156 pips
10/10: +135 pips
10/11: +61 pips
10/12: +108 pips
10/13: +97 pips
10/14: +274 pips
10/17: +178 pips
Total: +991 pips
The results this month are extreme. In general the system gives you an average return of 600 pips a month from March 2005.
On monthly basis the results are:
March 2005: +721 pips
April 2005: +940 pips
May 2005: +296 pips
June 2005: +857 pips
July 2005: +1,352 pips
August 2005: + 35 pips
September 2005: -20 pips
October 2005: +1,825 pips
November 2005: +554 pips
December 2005: +345 pips
January 2006: +73 pips
February 2006: -13 pips
March 2006: +633 pips
April 2006: +617 pips
May 2006: +1,319 pips
June 2006: +251 pips
August 2006: -322 pips
All calculations before October 2005 are done by hand, so it is possible that there is a small deviation. It is only to show the power of such a simple system.
I don't trade an EA, so please don't ask.
This is the current version of Hans123, so please don't ask.
Use the thread's search facility before you ask.对上面文字大致的翻译(感谢iPG):【交易之路http://www./收集整理】
一个简单有效的短线系统...
每日17点,找到今日13点到17点的最高价和最低价,下单BuyStop和SellStop。
每日21点,找到今日17点到21点的最高价和最低价,下单BuyStop和SellStop。
EUR/USD:
Buy Stop = 最高价 + 5;
止盈 = Buy Stop + 80;
止损 = Buy Stop - 50;
Sell Stop = 最低价 - 5;
止盈 = Sell Stop - 80;
止损 = Sell Stop + 50;
有30点浮动利润时将止损移至开仓价位。
GBP/USD:
Buy Stop = 最高价 + 5;
止盈 = Buy Stop + 120;
止损 = Buy Stop - 70;
Sell Stop = 最低价 - 5;
止盈 = Sell Stop - 120;
止损 = Sell Stop + 70;有40点浮动利润时将止损移至开仓价位。
每日早7点,平掉手上所有单子。一下是找来的按照Hans123的简单突破系统写的智能交易系统及指标系统,有兴趣可以试试看

这里是比较早的两个版本
欢喜研究它趋势突破原理的
和以后的版本比较
从此可以看出它的思路和变化
发展自己的ea

//+------------------------------------------------------------------+
//|      Hans123MV22 |
//|    Copyright ?2006, Milan Volf |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, Milan Volf"

//---- input parameters
extern int       Start1=10;           //begin of the first session;  adjust by your broker
extern int       Start2=14;           //begin of the second session
extern int       EOD=24;              // for closing orders at end of day
extern int       FridayClosing=23;    //broker friday closing time
extern bool      FirstSessionOnly=0;  //if it equals 1, it trades the first range only (for testing)
extern int       Length=4;            //length of range for determining high/low
extern int       Pips=5;              //trigger above/bellow range
extern int       StopLoss=50;
extern int       BreakEven=30;
extern int       TrailingStop=0;      //if equals 0, it uses breakeven
extern int       TakeProfit=80;
extern double    Lots=1;

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   //----
   int i,Ticket,MN;
  
   //Normalize times
   if(EOD==24) EOD=0;
   if(FridayClosing==0) FridayClosing=24;
  
   //Setup comment
   string Text="Hans123"+Symbol();

   //Setup orders
   if(Hour()==Start1 && Minute()<10){
      MN=1;
      SetOrders(Text,MN);
   }
   if(Hour()==Start2 && Minute()<10 && FirstSessionOnly==0){
      MN=2;
      SetOrders(Text,MN);
   }
  
   //Manage opened orders
   for (i=0;i<OrdersTotal();i++){
      OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderComment()==Text){
         //close open positions at EOD
         if(Hour()==EOD || (DayOfWeek()>=5 && Hour()==FridayClosing-1 && Minute()>=50)){
            switch (OrderType()){
               case OP_BUY: OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
               break;
               case OP_SELL: OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
               break;
               default: OrderDelete(OrderTicket());
               break;
            }
            Sleep(10000);
         }
         else {
            //move at BE if profit>BE
            if(TrailingStop==0){
               if(OrderType()==OP_BUY){
                  if(High[0]-OrderOpenPrice()>=BreakEven*Point && OrderStopLoss()<OrderOpenPrice()){
                     OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
                     Sleep(10000);
                  }  
               }  
               if(OrderType()==OP_SELL){
                  if(OrderOpenPrice()-Low[0]>=BreakEven*Point && OrderStopLoss()>OrderOpenPrice()){
                     OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
                     Sleep(10000);
                  }
               }
            }
            //use trailing stop
            else {                 
               if(OrderType()==OP_BUY){
                  if(High[0]-OrderStopLoss()>TrailingStop*Point){
                     OrderModify(OrderTicket(),OrderOpenPrice(),High[0]-TrailingStop*Point,OrderTakeProfit(),0,Green);
                     Sleep(10000);
                  }  
               }  
               if(OrderType()==OP_SELL){
                  if(OrderStopLoss()-Low[0]>TrailingStop*Point){
                     OrderModify(OrderTicket(),OrderOpenPrice(),Low[0]+TrailingStop*Point,OrderTakeProfit(),0,Green);
                     Sleep(10000);
                  }
               }
            }
         }
      }
   }
  
   return(0);
   }
//+------------------------------------------------------------------+

void SetOrders(string Text,int MN){
   int i,Ticket,Bought,Sold;
   double EntryLong,EntryShort,SLLong,SLShort,TPLong,TPShort;

   //Determine range
   EntryLong   =iHigh(NULL,60,Highest(NULL,60,MODE_HIGH,Length,1))+(Pips/*+MarketInfo(Symbol(),MODE_SPREAD)*/)*Point;
   EntryShort  =iLow (NULL,60,Lowest (NULL,60,MODE_LOW, Length,1))-Pips*Point;
   SLLong      =MathMax(EntryLong-StopLoss*Point,EntryShort);
   SLShort     =MathMin(EntryShort+StopLoss*Point,EntryLong);
   TPLong      =EntryLong+TakeProfit*Point;
   TPShort     =EntryShort-TakeProfit*Point;
  
   //Send orders
   for (i=0;i<OrdersTotal();i++){
      OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderComment()==Text && OrderMagicNumber()==MN){
         if(OrderType()==OP_BUYSTOP || OrderType()==OP_BUY) Bought++;
         if(OrderType()==OP_SELLSTOP || OrderType()==OP_SELL) Sold++;
      }
   }
   if(Bought==0){ //no buy order
      Ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,EntryLong,3,SLLong,TPLong,Text,MN,0,Blue);
      if(Ticket<0 && High[0]>=EntryLong)
         Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SLLong,TPLong,Text,MN,0,Blue);
         Sleep(10000);
   }
   if(Sold==0){ //no sell order
      Ticket=OrderSend(Symbol(),OP_SELLSTOP,Lots,EntryShort,3,SLShort,TPShort,Text,MN,0,Magenta);
      if(Ticket<0 && Low[0]<=EntryShort)
         Ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SLShort,TPShort,Text,MN,0,Magenta);
         Sleep(10000);
   }
   //Check orders
   for (i=0;i<OrdersTotal();i++){
      OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderComment()==Text && OrderMagicNumber()==MN){
         if(OrderType()==OP_BUYSTOP && (MathAbs(OrderOpenPrice()-EntryLong)>Point
         || MathAbs(OrderStopLoss()-SLLong)>Point || MathAbs(OrderTakeProfit()-TPLong)>Point))
            OrderModify(OrderTicket(),EntryLong,SLLong,TPLong,0,Blue);
         if(OrderType()==OP_SELLSTOP && (MathAbs(OrderOpenPrice()-EntryShort)>Point
         || MathAbs(OrderStopLoss()-SLShort)>Point || MathAbs(OrderTakeProfit()-TPShort)>Point))
            OrderModify(OrderTicket(),EntryShort,SLShort,TPShort,0,Magenta);
      }
   }
}
 
这里是早期的另一个版本

//+------------------------------------------------------------------+
//|   Hans Breakout.mq4                              |
//|   Copyright ?2006  Scorpion@fxfisherman.com        |
//+------------------------------------------------------------------+
#property copyright "WWW.FXFISH.com"
#property link      "http://www."

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Blue

extern int       Breakout_Pips=5;
extern int       Exit_Hour = 23;
extern int       From_Hour_1 = 6;
extern int       From_Minute_1 = 0;
extern int       To_Hour_1   = 9;
extern int       To_Minute_1 = 59;
extern int       From_Hour_2 = 10;
extern int       From_Minute_2 = 0;
extern int       To_Hour_2   = 13;
extern int       To_Minute_2 = 59;
extern int Bars_Count= 10000;

//---- buffers
double v1[];
double v2[];
double v3[];
double v4[];
 
int init()
  {

   IndicatorBuffers(4);
 
   SetIndexArrow(0, 159);
   SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1,Red);
   SetIndexDrawBegin(0,-1);
   SetIndexBuffer(0, v1);
   SetIndexLabel(0,"High1");
  
   SetIndexArrow(1, 159);
   SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1,Blue);
   SetIndexDrawBegin(1,-1);
   SetIndexBuffer(1, v2);
   SetIndexLabel(1,"Low1");
  
   SetIndexArrow(2, 159);
   SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,1,Red);
   SetIndexDrawBegin(2,-1);
   SetIndexBuffer(2, v3);
   SetIndexLabel(2,"High2");
  
   SetIndexArrow(3, 159);
   SetIndexStyle(3,DRAW_ARROW,STYLE_SOLID,1,Blue);
   SetIndexDrawBegin(3,-1);
   SetIndexBuffer(3, v4);
   SetIndexLabel(3,"Low2");
  
   watermark();

   return(0);
  }

int start()
{
  int i;
  int shift;
  double price;
  date calculated1, calculated2;
  double pipsBreakout = Breakout_Pips * Point;
  i = Bars_Count;
  while(i>=0)
   {
    // High/Low 1
    date today = StripTime(Time);
    int nowMins = TimeHour(Time) * 60 + TimeMinute(Time);
    if (calculated1 < today && nowMins > (To_Hour_1 * 60) + To_Minute_1)
    {
      calculated1 = today;
      double highest1 = High[GetHighest(Symbol(), Period(), MODE_HIGH, Time, From_Hour_1, From_Minute_1, To_Hour_1, To_Minute_1)];
      double lowest1 = Low[GetLowest(Symbol(), Period(), MODE_LOW, Time, From_Hour_1, From_Minute_1, To_Hour_1, To_Minute_1)];
    }
    if (calculated1 == today && nowMins < Exit_Hour * 60)
    {
      v1 = highest1 + pipsBreakout;
      v2 = lowest1 - pipsBreakout;
    }
   
    // High/Low 2
    if (calculated2 < today && nowMins > (To_Hour_2 * 60) + To_Minute_2)
    {
      calculated2 = today;
      double highest2 = High[GetHighest(Symbol(), Period(), MODE_HIGH, Time, From_Hour_2, From_Minute_2, To_Hour_2, To_Minute_2)];
      double lowest2 = Low[GetLowest(Symbol(), Period(), MODE_LOW, Time, From_Hour_2, From_Minute_2, To_Hour_2, To_Minute_2)];
    }
    if (calculated2 == today && nowMins < Exit_Hour * 60)
    {
      v3 = highest2 + pipsBreakout;
      v4 = lowest2 - pipsBreakout;
    }

   
    i--;
   }  
  return(0);
}

//+------------------------------------------------------------------+

date StripTime(datetime dt)
{
  return (dt - (TimeHour(dt)*3600) - (TimeMinute(dt)*60) - TimeSeconds(dt));
}

//+------------------------------------------------------------------+
//| Get highest/lowest bar between a time period.                    |
//+------------------------------------------------------------------+
int GetHighest(string symbol, int timeframe, int price_mode, datetime date, int from_hour, int from_minute, int to_hour, int to_minute)
{
  date = StripTime(date);
  datetime from_time = date + (from_hour * 3600) + (from_minute * 60);
  datetime to_time = date + (to_hour * 3600) + (to_minute * 60);
  int from_bar = iBarShift(symbol, timeframe, from_time, false);
  int to_bar = iBarShift(symbol, timeframe, to_time, false);
  int hh = Highest(symbol, timeframe, price_mode, from_bar - to_bar + 1, to_bar);
  return(hh);
}

int GetLowest(string symbol, int timeframe, int price_mode, datetime date, int from_hour, int from_minute, int to_hour, int to_minute)
{
  date = StripTime(date);
  datetime from_time = date + (from_hour * 3600) + (from_minute * 60);
  datetime to_time = date + (to_hour * 3600) + (to_minute * 60);
  int from_bar = iBarShift(symbol, timeframe, from_time, false);
  int to_bar = iBarShift(symbol, timeframe, to_time, false);
  int ll = Lowest(symbol, timeframe, price_mode, from_bar - to_bar + 1, to_bar);
  return(ll);
}

void watermark()
  {
   ObjectCreate("fxfisherman", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("fxfisherman", "WWW.FXFISH.COM", 11, "Lucida Handwriting", Snow);
   ObjectSet("fxfisherman", OBJPROP_CORNER, 2);
   ObjectSet("fxfisherman", OBJPROP_XDISTANCE, 5);
   ObjectSet("fxfisherman", OBJPROP_YDISTANCE, 10);
   return(0);
  }
 

关键词:hans123
0
顶一下0
踩一下

下载地址

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多