有您的持续关注
我们会做得更好

20_200_expert EA



20_200_expert EA用在欧美一小时图表,属于超短交易。由于盈亏比严重失调,维持盈利似乎很难。

本网收集整理智能交易EA仅为MQL4编程爱好者提供语法及相关编程技巧的学习研究之用,智能交易存在极高的风险测试请用模拟盘,请勿用于实盘。20_200_expert EA源码:

//+------------------------------------------------------------------+
//|                                               20/200 expert.mq4  |
//|                                                    1H   EUR/USD  |
//|                                                    Smirnov Pavel |
//|                                                 www.autoforex.ru |
//+------------------------------------------------------------------+

#property copyright "Smirnov Pavel"
#property link      "www.autoforex.ru"

extern int TakeProfit = 20; 
extern int StopLoss = 200; 
extern int TradeTime=18;
extern int t1=7;
extern int t2=2;
extern int delta=7;
extern double lot = 0.1;

int ticket;
bool cantrade=true;

int OpenLong(double volume=0.1)
{
  int slippage=10;
  string comment="20/200 expert (Long)";
  color arrow_color=Red;
  int magic=0;

  ticket=OrderSend(Symbol(),OP_BUY,volume,Ask,slippage,Ask-StopLoss*Point,
                      Ask+TakeProfit*Point,comment,magic,0,arrow_color);
  if(ticket>0)
  {
    if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
    {
      Print("Buy order opened : ",OrderOpenPrice());
      return(0);
    }  
  }
  else 
  {
    Print("Error opening Buy order : ",GetLastError()); 
    return(-1);
  }
        return(0);
}
  
int OpenShort(double volume=0.1)
{
  int slippage=10;
  string comment="20/200 expert (Short)";
  color arrow_color=Red;
  int magic=0;  
  
  ticket=OrderSend(Symbol(),OP_SELL,volume,Bid,slippage,Bid+StopLoss*Point,
                      Bid-TakeProfit*Point,comment,magic,0,arrow_color);
  if(ticket>0)
  {
    if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
      {
        Print("Sell order opened : ",OrderOpenPrice());
        return(0);
      }  
  }
  else 
  {
    Print("Error opening Sell order : ",GetLastError()); 
    return(-1);
  }
        return(0);
}

int init()
{
  return(0);
}

int deinit()
{ 
Comment("www.125808047.com");  
  return(0);
}

int start()
{
  if((TimeHour(TimeCurrent())>TradeTime)) cantrade=true;  
  
  if(OrdersTotal()<1)
  {
  
    if((TimeHour(TimeCurrent())==TradeTime)&&(TimeMinute(TimeCurrent())>=0)&&(cantrade))
    {
      
      if ((Open[t1]-Open[t2])>delta*Point) 
      {
        
        if(AccountFreeMarginCheck(Symbol(),OP_SELL,lot)<=0 || GetLastError()==134)
        {
          Print("Not enough money");
          return(0);
        }
        OpenShort(lot);
        cantrade=false; 
        return(0);
      }
      if ((Open[t2]-Open[t1])>delta*Point) 
      {
        
        if(AccountFreeMarginCheck(Symbol(),OP_BUY,lot)<=0 || GetLastError()==134)
        {
          Print("Not enough money");
          return(0);
        }
        OpenLong(lot);
        cantrade=false;
        return(0);
      }
    }
  }   
  return(0);
}

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 20_200_expert EA
上一篇:
下一篇:
分享到:更多 ()