Profit factor:
0.68
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt can change open orders parameters, due to possible stepping strategy
Indicators Used
Moving average indicator
16 Views
0 Downloads
0 Favorites
amer
//+------------------------------------------------------------------+
//|                                                         amer.mq4 |
//|                                                             Olek |
//|                                                                  |
//+------------------------------------------------------------------+
extern double Lots = 0.1;
extern int TrailingStop = 50;
extern int StopLoss=50;
extern int TakeProfit = 200;
extern int per = 700;
extern int vremya = 0;
extern int DayWeek = 2;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   double Mov1= 0, Mov2=0;
   int cnt, ticket, total;
   
   Mov1= iMA(0,0,per,0,0,0,1);
   Mov2= iMA(0,0,per,0,0,0,2);

   int  h=0; 

int       hour0=0; 
int       hour1=0; 
int       hour2=0; 
int       hour3=0; 
int       hour4=0; 
int       hour5=0; 
int       hour6=0; 
int       hour7=0; 
int       hour8=0; 
int       hour9=0; 
int       hour10=0; 
int       hour11=0; 
int       hour12=0; 
int       hour13=0; 
int       hour14=0; 
int       hour15=0; 
int       hour16=0; 
int       hour17=0; 
int       hour18=0; 
int       hour19=0; 
int       hour20=0; 
int       hour21=0; 
int       hour22=0; 
int       hour23=0; 

if (DayOfWeek() == 1)  {hour0=1;hour1=1;hour2=1;hour3=0;hour4=1;hour5=1;hour6=0;hour7=0;hour8=1;hour9=1;hour10=1;hour11=1; 
             hour12=0;hour13=1;hour14=0;hour15=1;hour16=1;hour17=1;hour18=0;hour19=0;hour20=0;hour21=0;hour22=0;hour23=1;} 
else   if (DayOfWeek() == 2)  {hour0=1;hour1=1;hour2=1;hour3=0;hour4=1;hour5=1;hour6=0;hour7=0;hour8=1;hour9=1;hour10=1;hour11=1; 
             hour12=0;hour13=1;hour14=0;hour15=1;hour16=1;hour17=1;hour18=0;hour19=0;hour20=0;hour21=0;hour22=0;hour23=1;} 
else   if (DayOfWeek() == 3)  {hour0=1;hour1=1;hour2=1;hour3=0;hour4=1;hour5=1;hour6=0;hour7=0;hour8=1;hour9=1;hour10=1;hour11=1; 
             hour12=0;hour13=1;hour14=0;hour15=1;hour16=1;hour17=1;hour18=0;hour19=0;hour20=0;hour21=0;hour22=0;hour23=1;} 
else   if (DayOfWeek() == 4)  {hour0=1;hour1=1;hour2=1;hour3=0;hour4=1;hour5=1;hour6=0;hour7=0;hour8=0;hour9=0;hour10=0;hour11=0; 
             hour12=0;hour13=0;hour14=0;hour15=0;hour16=0;hour17=0;hour18=0;hour19=0;hour20=0;hour21=0;hour22=0;hour23=1;} 
else   if (DayOfWeek() == 5)  {hour0=1;hour1=1;hour2=1;hour3=0;hour4=1;hour5=1;hour6=0;hour7=0;hour8=1;hour9=1;hour10=0;hour11=0; 
             hour12=0;hour13=0;hour14=0;hour15=0;hour16=0;hour17=0;hour18=0;hour19=0;hour20=0;hour21=0;hour22=0;hour23=0;} 
  
       if(Hour()== 0) h=hour0; 
else   if(Hour()== 1) h=hour1; 
else   if(Hour()== 2) h=hour2; 
else   if(Hour()== 3) h=hour3; 
else   if(Hour()== 4) h=hour4; 
else   if(Hour()== 5) h=hour5; 
else   if(Hour()== 6) h=hour6; 
else   if(Hour()== 7) h=hour7; 
else   if(Hour()== 8) h=hour8; 
else   if(Hour()== 9) h=hour9; 
else   if(Hour()== 10) h=hour10; 
else   if(Hour()== 11) h=hour11; 
else   if(Hour()== 12) h=hour12; 
else   if(Hour()== 13) h=hour13; 
else   if(Hour()== 14) h=hour14; 
else   if(Hour()== 15) h=hour15; 
else   if(Hour()== 16) h=hour16; 
else   if(Hour()== 17) h=hour17; 
else   if(Hour()== 18) h=hour18; 
else   if(Hour()== 19) h=hour19; 
else   if(Hour()== 20) h=hour20; 
else   if(Hour()== 21) h=hour21; 
else   if(Hour()== 22) h=hour22; 
else   if(Hour()== 23) h=hour23;    

if(  h==1 ) 

   total=OrdersTotal();
   if(total<1 && Hour() == vremya && DayOfWeek()>= DayWeek) 
     {
      
      if( Mov1 < Mov2 )
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,"",12,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print("Error opening BUY order : ",GetLastError()); 
         return(0); 
        }
      
      if(Mov1 > Mov2 )
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"",12,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()); 
         return(0); 
        }
      return(0);
     }
      
   for(cnt=0;cnt<total;cnt++)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL &&   
         OrderSymbol()==Symbol())  
        {
         if(OrderType()==OP_BUY)   
           {
            
            if(TrailingStop>0)  
              {                 
               if(Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(OrderStopLoss()<Bid-Point*TrailingStop)
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
                     return(0);
                    }
                 }
              }
           }
         else 
           {
            
            if(TrailingStop>0)  
              {                 
               if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
                     return(0);
                    }
                 }
              }
           }
        }
     }
   return(0);
  }

Profitability Reports

EUR/USD Jul 2025 - Sep 2025
2.09
Total Trades 145
Won Trades 70
Lost trades 75
Win Rate 48.28 %
Expected payoff 3.62
Gross Profit 1005.40
Gross Loss -480.00
Total Net Profit 525.40
-100%
-50%
0%
50%
100%
EUR/USD Jan 2025 - Jul 2025
1.79
Total Trades 307
Won Trades 148
Lost trades 159
Win Rate 48.21 %
Expected payoff 2.65
Gross Profit 1847.20
Gross Loss -1033.50
Total Net Profit 813.70
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
1.16
Total Trades 55
Won Trades 31
Lost trades 24
Win Rate 56.36 %
Expected payoff 0.32
Gross Profit 127.90
Gross Loss -110.35
Total Net Profit 17.55
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
1.08
Total Trades 252
Won Trades 118
Lost trades 134
Win Rate 46.83 %
Expected payoff 0.18
Gross Profit 610.23
Gross Loss -564.06
Total Net Profit 46.17
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
1.03
Total Trades 106
Won Trades 52
Lost trades 54
Win Rate 49.06 %
Expected payoff 0.09
Gross Profit 338.70
Gross Loss -329.40
Total Net Profit 9.30
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.95
Total Trades 93
Won Trades 47
Lost trades 46
Win Rate 50.54 %
Expected payoff -0.10
Gross Profit 190.37
Gross Loss -199.91
Total Net Profit -9.54
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.93
Total Trades 90
Won Trades 39
Lost trades 51
Win Rate 43.33 %
Expected payoff -0.17
Gross Profit 206.21
Gross Loss -221.65
Total Net Profit -15.44
-100%
-50%
0%
50%
100%
AUD/USD Jan 2025 - Jul 2025
0.85
Total Trades 168
Won Trades 88
Lost trades 80
Win Rate 52.38 %
Expected payoff -0.49
Gross Profit 454.00
Gross Loss -536.00
Total Net Profit -82.00
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.82
Total Trades 70
Won Trades 34
Lost trades 36
Win Rate 48.57 %
Expected payoff -0.60
Gross Profit 192.20
Gross Loss -234.00
Total Net Profit -41.80
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.79
Total Trades 190
Won Trades 99
Lost trades 91
Win Rate 52.11 %
Expected payoff -0.67
Gross Profit 490.80
Gross Loss -618.80
Total Net Profit -128.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.77
Total Trades 69
Won Trades 35
Lost trades 34
Win Rate 50.72 %
Expected payoff -0.73
Gross Profit 164.00
Gross Loss -214.20
Total Net Profit -50.20
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.73
Total Trades 82
Won Trades 37
Lost trades 45
Win Rate 45.12 %
Expected payoff -0.73
Gross Profit 165.69
Gross Loss -225.72
Total Net Profit -60.03
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.61
Total Trades 223
Won Trades 103
Lost trades 120
Win Rate 46.19 %
Expected payoff -1.03
Gross Profit 357.04
Gross Loss -586.54
Total Net Profit -229.50
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.61
Total Trades 353
Won Trades 183
Lost trades 170
Win Rate 51.84 %
Expected payoff -1.43
Gross Profit 801.13
Gross Loss -1306.92
Total Net Profit -505.79
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.60
Total Trades 38
Won Trades 16
Lost trades 22
Win Rate 42.11 %
Expected payoff -2.01
Gross Profit 112.90
Gross Loss -189.20
Total Net Profit -76.30
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.60
Total Trades 118
Won Trades 45
Lost trades 73
Win Rate 38.14 %
Expected payoff -2.14
Gross Profit 386.39
Gross Loss -638.86
Total Net Profit -252.47
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.58
Total Trades 79
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -1.40
Gross Profit 155.60
Gross Loss -266.50
Total Net Profit -110.90
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.49
Total Trades 500
Won Trades 208
Lost trades 292
Win Rate 41.60 %
Expected payoff -1.83
Gross Profit 878.87
Gross Loss -1792.36
Total Net Profit -913.49
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.49
Total Trades 287
Won Trades 127
Lost trades 160
Win Rate 44.25 %
Expected payoff -2.40
Gross Profit 654.40
Gross Loss -1344.00
Total Net Profit -689.60
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.42
Total Trades 651
Won Trades 235
Lost trades 416
Win Rate 36.10 %
Expected payoff -2.36
Gross Profit 1093.74
Gross Loss -2632.07
Total Net Profit -1538.33
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.39
Total Trades 86
Won Trades 37
Lost trades 49
Win Rate 43.02 %
Expected payoff -1.66
Gross Profit 92.57
Gross Loss -234.99
Total Net Profit -142.42
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.39
Total Trades 141
Won Trades 52
Lost trades 89
Win Rate 36.88 %
Expected payoff -3.34
Gross Profit 306.92
Gross Loss -778.20
Total Net Profit -471.28
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.33
Total Trades 146
Won Trades 50
Lost trades 96
Win Rate 34.25 %
Expected payoff -3.21
Gross Profit 233.25
Gross Loss -701.22
Total Net Profit -467.97
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.24
Total Trades 254
Won Trades 80
Lost trades 174
Win Rate 31.50 %
Expected payoff -3.22
Gross Profit 256.45
Gross Loss -1075.56
Total Net Profit -819.11
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.21
Total Trades 234
Won Trades 71
Lost trades 163
Win Rate 30.34 %
Expected payoff -3.43
Gross Profit 218.79
Gross Loss -1021.86
Total Net Profit -803.07
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.11
Total Trades 118
Won Trades 32
Lost trades 86
Win Rate 27.12 %
Expected payoff -8.71
Gross Profit 132.68
Gross Loss -1160.88
Total Net Profit -1028.20
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.06
Total Trades 60
Won Trades 10
Lost trades 50
Win Rate 16.67 %
Expected payoff -11.14
Gross Profit 46.40
Gross Loss -715.00
Total Net Profit -668.60
-100%
-50%
0%
50%
100%
USD/CHF 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