Profit factor:
0.14
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
Indicators Used
Moving average indicator
1 Views
0 Downloads
0 Favorites
MARE5[1].1
//+------------------------------------------------------------------+
//|                                                      MARE5.1.mq4 |
//|                                        Author: Kvant & Reshetov  |
//|                                                                  |
//+------------------------------------------------------------------+
extern double Lots         = 7.8;
extern double TakeProfit   = 110;
extern double TrailingStop = 10;
extern double StopLoss     = 80;
extern int    MAFastPeriod = 13; 
extern int    MASlowPeriod = 55;
extern double MovingShift  = 2;
extern double cnt          = 0;
extern double TimeOpen     = 08;
extern double TimeClose    = 14;
//+------------------------------------------------------------------+
//| Start function                                                   |
//+------------------------------------------------------------------+
int start()
  {
   double FastMa = 0;
   double FastMa2 = 0;
   double FastMa5 = 0;
   double SlowMa = 0;
   double SlowMa2 = 0;
   double SlowMa5 = 0;
   FastMa = iMA(NULL, 1, MAFastPeriod, MovingShift, MODE_SMA, PRICE_CLOSE, 0);
   FastMa2 = iMA(NULL, 1, MAFastPeriod, MovingShift, MODE_SMA, PRICE_CLOSE, 2);
   FastMa5 = iMA(NULL, 1, MAFastPeriod, MovingShift, MODE_SMA, PRICE_CLOSE, 5);
   SlowMa = iMA(NULL, 1, MASlowPeriod, MovingShift, MODE_SMA, PRICE_CLOSE, 0);
   SlowMa2 = iMA(NULL, 1, MASlowPeriod, MovingShift, MODE_SMA, PRICE_CLOSE, 2); 
   SlowMa5 = iMA(NULL, 1, MASlowPeriod, MovingShift, MODE_SMA, PRICE_CLOSE, 5);
   if(Hour() >= TimeOpen && Hour() <= TimeClose) 
     {
       for(cnt = 0; cnt < OrdersTotal(); cnt++) 
         { 
           if(OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES) == false)
               break; 
           //if(CurTime()-OrderOpenTime()<300) return(0); 
         }
       if(OrdersTotal() < 1)
       //---- sell conditions
       if((SlowMa - FastMa) >= Point && (FastMa2 - SlowMa2) >= Point && 
          (FastMa5 - SlowMa5) >= Point && Close[1] < Open[1])  
         {
           OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, Bid + StopLoss*Point, 
                     Bid - TakeProfit*Point, 0, 0, Red);
           return;
         }
       //---- buy conditions
       if((FastMa - SlowMa) >= Point && (SlowMa2 - FastMa2) >= Point && 
          (SlowMa5 - FastMa5) >= Point && Close[1] > Open[1])  
         {
           OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, Ask - StopLoss*Point, 
                     Ask + TakeProfit*Point, 0, 0, Blue);
           return;
         }
     }
  }
//+------------------------------------------------------------------+

Profitability Reports

NZD/USD Oct 2024 - Jan 2025
0.00
Total Trades 3
Won Trades 0
Lost trades 3
Win Rate 0.00 %
Expected payoff -283.40
Gross Profit 0.00
Gross Loss -850.20
Total Net Profit -850.20
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.41
Total Trades 5
Won Trades 1
Lost trades 4
Win Rate 20.00 %
Expected payoff -246.48
Gross Profit 858.00
Gross Loss -2090.40
Total Net Profit -1232.40
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.00
Total Trades 10
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -591.24
Gross Profit 0.00
Gross Loss -5912.40
Total Net Profit -5912.40
-100%
-50%
0%
50%
100%

Comments