3sma_www.forex-instruments.info

Author: emsjoflo
Profit factor:
0.52
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
Indicators Used
Moving average indicator
9 Views
0 Downloads
0 Favorites
3sma_www.forex-instruments.info
//+------------------------------------------------------------------+
//|                                                         3sma.mq4 |
//|                                                         emsjoflo |
//|                                  automaticforex.invisionzone.com |
//+------------------------------------------------------------------+
#property copyright "emsjoflo"
#property link      "automaticforex.invisionzone.com"
//---- input parameters
extern int       SMA1=9;
extern int       SMA2=14;
extern int       SMA3=29;
extern double    lots=0.1;
extern int       SMAspread=0;
extern int       StopLoss=0;
extern int       Slippage=4;
double   ma1,ma2,ma3;
int      i, buys, sells;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   //get moving average info
   ma1=iMA(Symbol(),0,SMA1,1,MODE_SMA,PRICE_CLOSE,0);
   ma2=iMA(NULL,0,SMA2,1,MODE_SMA,PRICE_CLOSE,0);
   ma3=iMA(NULL,0,SMA3,1,MODE_SMA,PRICE_CLOSE,0);
   //check for open orders first 
   if (OrdersTotal()>0)
     {
      buys=0;
      sells=0;
      for(i=0;i<OrdersTotal();i++)
        {
         OrderSelect(i,SELECT_BY_POS);
         if (OrderSymbol()==Symbol())
           {
            if (OrderType()== OP_BUY)
              {
               if (ma1 < ma2) OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Orange);
               else buys++;
              }
            if (OrderType()== OP_SELL)
              {
               if (ma1 > ma2) OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Yellow);
               else sells++;
              }
           }
        }
     }
   if (ma1>(ma2+SMAspread*Point) && ma2 > (ma3+SMAspread*Point) && buys==0)
     {
      Print("Buy condition");
   OrderSend(Symbol(),OP_BUY,lots,Ask,Slippage,0/*(Ask-StopLoss*Point)*/,0,"3SMA",123,0,Green);
     }
   if (ma1<(ma2-SMAspread*Point) && ma2 < (ma3-SMAspread*Point) && sells ==0)
     {
      Print ("Sell condition");
   OrderSend(Symbol(),OP_SELL,lots,Bid,Slippage,0/*(Bid+StopLoss*Point)*/,0,"3SMA",123,0,Red);
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Profitability Reports

USD/CAD Jul 2025 - Sep 2025
0.67
Total Trades 166
Won Trades 52
Lost trades 114
Win Rate 31.33 %
Expected payoff -2.00
Gross Profit 663.55
Gross Loss -996.34
Total Net Profit -332.79
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.86
Total Trades 158
Won Trades 57
Lost trades 101
Win Rate 36.08 %
Expected payoff -0.77
Gross Profit 738.60
Gross Loss -859.80
Total Net Profit -121.20
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.65
Total Trades 162
Won Trades 50
Lost trades 112
Win Rate 30.86 %
Expected payoff -4.09
Gross Profit 1246.20
Gross Loss -1908.00
Total Net Profit -661.80
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.25
Total Trades 171
Won Trades 26
Lost trades 145
Win Rate 15.20 %
Expected payoff -10.66
Gross Profit 619.47
Gross Loss -2442.36
Total Net Profit -1822.89
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.70
Total Trades 151
Won Trades 54
Lost trades 97
Win Rate 35.76 %
Expected payoff -2.91
Gross Profit 1040.17
Gross Loss -1479.72
Total Net Profit -439.55
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 21
Won Trades 6
Lost trades 15
Win Rate 28.57 %
Expected payoff -5025.31
Gross Profit 83.00
Gross Loss -105614.60
Total Net Profit -105531.60
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.63
Total Trades 174
Won Trades 59
Lost trades 115
Win Rate 33.91 %
Expected payoff -2.27
Gross Profit 665.70
Gross Loss -1060.50
Total Net Profit -394.80
-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%
USD/CAD Oct 2024 - Jan 2025
0.69
Total Trades 90
Won Trades 28
Lost trades 62
Win Rate 31.11 %
Expected payoff -3.06
Gross Profit 610.55
Gross Loss -886.14
Total Net Profit -275.59
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.55
Total Trades 98
Won Trades 28
Lost trades 70
Win Rate 28.57 %
Expected payoff -4.35
Gross Profit 525.60
Gross Loss -951.70
Total Net Profit -426.10
-100%
-50%
0%
50%
100%

Comments