📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    mgt2008突破交易系统A.mq4

    2011-10-30 · 6309 阅读
    mgt2008突破交易系统A.mq4
      //+------------------------------------------------------------------+
      //|                                         mgt2008突破交易系统A.mq4 |
      //|                       Copyright ?2009, MetaQuotes Software Corp. |
      //|                                        http://www.metaquotes.net |
      //+------------------------------------------------------------------+
      #property copyright \"Copyright ?2009, MetaQuotes Software Corp.\"
      #property link      \"http://www.metaquotes.net\"
      
      //+------------------------------------------------------------------+
      //| expert initialization function                                   |
      //+------------------------------------------------------------------+
      //---- 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()BE
                  if(TrailingStop==0){
                     if(OrderType()==OP_BUY){
                        if(High[0]-OrderOpenPrice()>=BreakEven*Point && OrderStopLoss()=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;iPoint
               || MathAbs(OrderStopLoss()-SLShort)>Point || MathAbs(OrderTakeProfit()-TPShort)>Point))
                  OrderModify(OrderTicket(),EntryShort,SLShort,TPShort,0,Magenta);
            }
         }
      }
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 16 个

    小豆芽2012 LV5

    发表于 2012-11-22 01:12:18 | 显示全部楼层

    (*^__^*) 嘻嘻……   

    曾先生 LV4

    发表于 2012-11-22 01:12:18 | 显示全部楼层

    经过你的指点 我还是没找到在哪 ~~~  

    lljia LV4

    发表于 2012-11-22 00:28:10 | 显示全部楼层

    厉害!强~~~~没的说了!  

    相亲 LV5

    发表于 2012-11-22 00:28:10 | 显示全部楼层

    i love you

    EA定制 LV6

    发表于 2012-11-22 00:28:10 | 显示全部楼层

    看或者不看,贴子就在这里,不急不忙  

    爻爻 LV5

    发表于 2012-11-22 00:28:10 | 显示全部楼层

    操盘做单还是要靠自己  

    盛满我的思念 LV5

    发表于 2012-11-22 00:28:10 | 显示全部楼层

    这个不可信,没有保险的保赚钱的软件   

    rainmaker LV6

    发表于 2012-11-22 00:28:10 | 显示全部楼层

    没人理我。。。。  

    q543777345 LV5

    发表于 2012-11-22 00:28:10 | 显示全部楼层

    请发一个试试,谢谢!RongYuanQiong@163.com 。。。  
    12下一页
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服