GBPUSDADR14

Author: Copyright � 2007, MetaQuotes Software Corp.
Profit factor:
0.33
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
6 Views
0 Downloads
0 Favorites
GBPUSDADR14
//+------------------------------------------------------------------+
//|                                                  GBPUSDADR14.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

int barant = 999999999;
int Lote = 1;
int ticket = 0;
int media14 = 0;
double soma14 = 0;
int aberturaVenda;
int aberturaCompra;
bool isComprou;
bool isVendeu;
int sl100 = 15;
int tp100 = 30;
int sl175 = 20;
int tp175 = 40;
int sl200 = 25;
int tp200 = 50;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   if(barant != Bars){
   
      for(int i = 1; i<=14; i++){
         soma14 += High[i] - Low[i];        
      }
      
      media14 = (soma14/14)/Point;
      Print("Media dos 14 dias é: "+media14);
   }
   
   soma14 = 0;
   barant = Bars;
   
   if(Hour() == 17 && Minute() == 0){
      for(int j=0; j<OrdersTotal(); j++){
         if(OrderSelect(j,SELECT_BY_POS) == true){
            OrderClose(OrderTicket(), 1, Ask, 3, Red);
         }
      }
      isComprou = false;
      isVendeu = false;
      return(0);
   }
   
   if(media14 < 100)
      return(0);
      
   if(media14 >= 100 && media14 < 175){
      aberturaVenda = (Low[1]/Point) - (Bid/Point);
      aberturaCompra = (High[1]/Point) - (Ask/Point);
      
      if(aberturaCompra == 0 && !isComprou){
         ticket=OrderSend(Symbol(),OP_BUY, Lote,Ask, 3,Ask - sl100*Point,Ask + tp100*Point,"Comprando GBP",0,0,Red);
            if(ticket<0)
               Print("OrderSend failed with error #",GetLastError());
         isComprou = true;      
         return(0);
      }
      
      if(aberturaVenda == 0 && !isVendeu){
         ticket=OrderSend(Symbol(),OP_SELL, Lote,Bid, 3,Bid + sl100*Point,Bid - tp100*Point,"Vendendo GBP",0,0,Red);
            if(ticket<0)
               Print("OrderSend failed with error #",GetLastError());
         isVendeu = true;
         return(0);
      }
   }
   
   if(media14 >= 175 && media14 <= 199){
      aberturaVenda = (Low[1]/Point) - (Bid/Point);
      aberturaCompra = (High[1]/Point) - (Ask/Point);
      
      if(aberturaCompra == 0 && !isComprou){
         ticket=OrderSend(Symbol(),OP_BUY, Lote,Ask, 3,Ask - sl175*Point,Ask + tp175*Point,"Comprando GBP",0,0,Red);
            if(ticket<0)
               Print("OrderSend failed with error #",GetLastError());
         isComprou = true;      
         return(0);
      }
      
      if(aberturaVenda == 0 && !isVendeu){
         ticket=OrderSend(Symbol(),OP_SELL, Lote,Bid, 3,Bid + sl175*Point,Bid - tp175*Point,"Vendendo GBP",0,0,Red);
            if(ticket<0)
               Print("OrderSend failed with error #",GetLastError());
         isVendeu = true;
         return(0);
      }
   }
   
   if(media14 >= 200){
      aberturaVenda = (Low[1]/Point) - (Bid/Point);
      aberturaCompra = (High[1]/Point) - (Ask/Point);
      
      if(aberturaCompra == 0 && !isComprou){
         ticket=OrderSend(Symbol(),OP_BUY, Lote,Ask, 3,Ask - sl200*Point,Ask + tp200*Point,"Comprando GBP",0,0,Red);
            if(ticket<0)
               Print("OrderSend failed with error #",GetLastError());
         isComprou = true;      
         return(0);
      }
      
      if(aberturaVenda == 0 && !isVendeu){
         ticket=OrderSend(Symbol(),OP_SELL, Lote,Bid, 3,Bid + sl200*Point,Bid - tp200*Point,"Vendendo GBP",0,0,Red);
            if(ticket<0)
               Print("OrderSend failed with error #",GetLastError());
         isVendeu = true;
         return(0);
      }      
   }

   return(0);
  }
//+------------------------------------------------------------------+

Profitability Reports

USD/JPY Jan 2025 - Jul 2025
1.09
Total Trades 258
Won Trades 89
Lost trades 169
Win Rate 34.50 %
Expected payoff 0.98
Gross Profit 3032.31
Gross Loss -2779.00
Total Net Profit 253.31
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.15
Total Trades 60
Won Trades 4
Lost trades 56
Win Rate 6.67 %
Expected payoff -21.43
Gross Profit 232.98
Gross Loss -1518.88
Total Net Profit -1285.90
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.75
Total Trades 79
Won Trades 21
Lost trades 58
Win Rate 26.58 %
Expected payoff -2.96
Gross Profit 706.65
Gross Loss -940.24
Total Net Profit -233.59
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.57
Total Trades 19
Won Trades 4
Lost trades 15
Win Rate 21.05 %
Expected payoff -7.89
Gross Profit 200.00
Gross Loss -350.00
Total Net Profit -150.00
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
EUR/USD Jan 2025 - Jul 2025
0.23
Total Trades 257
Won Trades 23
Lost trades 234
Win Rate 8.95 %
Expected payoff -13.27
Gross Profit 1020.00
Gross Loss -4430.00
Total Net Profit -3410.00
-100%
-50%
0%
50%
100%
AUD/USD Jan 2025 - Jul 2025
0.09
Total Trades 239
Won Trades 9
Lost trades 230
Win Rate 3.77 %
Expected payoff -13.83
Gross Profit 310.00
Gross Loss -3615.00
Total Net Profit -3305.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%

Comments