诚信为本
量力而为
当前位置:峰汇在线 > MetaTrader 4 > MT4 EA > 正文

欧美五分钟EA 1_Otkat_Sys eu m5.mq4

1_Otkat_Sys eu m5 EA用在欧美五分钟图表交易。

源码:

//+------------------------------------------------------------------+
//|                                             1_Otkat_Sys eu m5.mq4|
//|                  Copyright @1999-2007, MetaQuotes Software Corp. |
//+------------------------------------------------------------------+
#property copyright "Copyright @1999-2007, MetaQuotes Software Corp."
#property link      "http://www.125808047.com"

extern double TakeProfit=50;
extern double StopLoss=510;
extern double Lots=1.0;
extern double Otkat=20;
extern double KoridorOC=18;
extern double KoridorOt=3;

bool cg = false;

int OnInit()
  {  
   Comment("www.125808047.com");
   return(INIT_SUCCEEDED);
  }
     
void OnTick()
  {
   int cnt, ticket, total;
   double OpCl=0,ClOp=0,ClLo=0,HiCl=0,OpD=0;

   total=OrdersTotal();
   for(cnt=0;cnt<total;cnt++)
     {
       cg = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL &&   
         OrderSymbol()==Symbol())  
        {
         if(OrderType()==OP_BUY)   
           {
            if(total>0 && Hour()==22 && Minute()>45)
              {
                cg = OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); 
              }
           }
         else 
           {
            if(total>0 && Hour()==22 && Minute()>45)
              {
                cg = OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); 
              }
           }
        }
     } 
   if(total<1)
     {
      OpCl=Open[24]-Close[1];
      ClOp=Close[1]-Open[24];
      ClLo=Close[1]-Low[Lowest(NULL,60,MODE_LOW,24,0)];
      HiCl=High[Highest(NULL,60,MODE_HIGH,24,0)]-Close[1];
      OpD=Open[0];
      if(AccountFreeMargin()<(Ask*1000*Lots))
        {
         Print("We have no money. Free Margin = ", AccountFreeMargin());
        }
      if(Hour()==0 && Minute()<=3 && DayOfWeek()!=1 && DayOfWeek()!=5 && OpCl>KoridorOC*Point && ClLo<(Otkat-KoridorOt)*Point)
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,OpD,10,OpD-StopLoss*Point,OpD+(TakeProfit+3)*Point,"73_Sys",16384,0,LawnGreen);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print("Error opening BUY order : ",GetLastError());
        }
      if(Hour()==0 && Minute()<=3 && DayOfWeek()!=1 && DayOfWeek()!=5 && ClOp>KoridorOC*Point && HiCl>(Otkat+KoridorOt)*Point)
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,OpD,10,OpD-StopLoss*Point,OpD+(TakeProfit+3)*Point,"73_Sys",16384,0,LawnGreen);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print("Error opening BUY order : ",GetLastError());
        }
      if(Hour()==0 && Minute()<=3 && DayOfWeek()!=1 && DayOfWeek()!=5 && ClOp>KoridorOC*Point && HiCl<(Otkat-KoridorOt)*Point)
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,OpD,10,OpD+StopLoss*Point,OpD-TakeProfit*Point,"73_Sys",16384,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
           }
         else Print("Error opening SELL order : ",GetLastError());
        }
      if(Hour()==0 && Minute()<=3 && DayOfWeek()!=1 && DayOfWeek()!=5 && OpCl>KoridorOC*Point && ClLo>(Otkat+KoridorOt)*Point)
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,OpD,10,OpD+StopLoss*Point,OpD-TakeProfit*Point,"73_Sys",16384,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
           }
         else Print("Error opening SELL order : ",GetLastError());
        }
     }
  }
打赏
版权所有转载请注明标题及链接:峰汇在线 » 欧美五分钟EA 1_Otkat_Sys eu m5.mq4
上一篇:
下一篇:
分享到: 更多 (0)

如您觉得此文不错请扫码打赏!

支付宝扫一扫打赏

微信扫一扫打赏