Author: FMW_1
Profit factor:
1.22
Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategyIt automatically opens orders when conditions are reached
Indicators Used
Moving average indicatorFractalsLarry William percent range indicator
13 Views
0 Downloads
0 Favorites
FMW_1
//+------------------------------------------------------------------+
//|                                                        FMW_1.mq4 |
//|                                                                * |
//|                                                                * |
//+------------------------------------------------------------------+
#property copyright "FMW_1"
#property link "fraktalis@gmail.com"


//---- input parameters
extern   double  Lots=0.2;
extern   bool    RiskManagement=true;
extern   double  RiskPercent=20;
extern   int     StopLose=0;
extern   int     TakeProfit=12; 
extern   int     TrailingStop=0;
extern   int     WPRSell=10;
extern   int     WPRBuy=90;
extern   int     S=80; // EMA
extern   int     B=40; // EMA
int start()


  {
  
  double SL,TP;
  int Total=0;

  for(int cnt=0;cnt<OrdersTotal();cnt++)
   {
  OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
   if(OrderSymbol()==Symbol())
      {
      Total++;
      if(OrderType()==OP_BUY)
         {
         if(TrailingStop>0
         && Bid-OrderOpenPrice()>Point*TrailingStop
         && OrderStopLoss()<Bid-Point*TrailingStop)
            {
            OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0);
            return(0);
            }
         }
      if(OrderType()==OP_SELL)
         {
         if(TrailingStop>0
         && OrderOpenPrice()-Ask>Point*TrailingStop
         && (OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0))
            {
            OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0);
            return(0);
            }
         }
      }
   }
  
  if(OrdersTotal()==1)return(0);
  
    if(RiskManagement)
  {
      if(RiskPercent<0.1||RiskPercent>100)   
      {
      Comment("Invalid Risk Value.");
      return(0);
      }
      else
          {
          Lots=MathFloor((AccountFreeMargin()*AccountLeverage()*RiskPercent*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*
                MarketInfo(Symbol(),MODE_MINLOT)))*MarketInfo(Symbol(),MODE_MINLOT);
          }
  }
  if(Lots<0.01)Lots=0.01;//My min lots
  if(Lots>100)Lots=100;//My max lots  
  if(RiskManagement==false){Lots=Lots;}
  
         double SellMA=iMA(NULL,0,S,0,MODE_EMA,PRICE_OPEN,1);
         double BuyMA=iMA(NULL,0,B,0,MODE_EMA,PRICE_OPEN,1);
         double hight=iFractals(NULL,0,MODE_UPPER,3);
         double low=iFractals(NULL,0,MODE_LOWER,3);
         double R=iWPR(NULL,0,21,1);
        
            if(SellMA>BuyMA && R>-WPRSell)

               {
               if (TakeProfit>0) TP=Bid-TakeProfit*Point;
               if (StopLose>0) SL=Bid+StopLose*Point;
               OrderSend(Symbol(),OP_SELL,Lots,Bid,2,SL,TP,NULL,0,0);
               return(0);
               }
          
            if(SellMA<BuyMA && R<-WPRBuy)

               {
               if (TakeProfit>0) TP=Ask+TakeProfit*Point;
               if (StopLose>0) SL=Ask-StopLose*Point;
               OrderSend(Symbol(),OP_BUY,Lots,Ask,2,SL,TP,NULL,0,0);
               return(0);
               }
               
  return(0);  
  }
//+------------------------------------------------------------------+

Profitability Reports

NZD/USD Jul 2025 - Sep 2025
0.00
Total Trades 97
Won Trades 97
Lost trades 0
Win Rate 100.00 %
Expected payoff 8.33
Gross Profit 808.44
Gross Loss 0.00
Total Net Profit 808.44
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.00
Total Trades 25
Won Trades 25
Lost trades 0
Win Rate 100.00 %
Expected payoff 3.48
Gross Profit 87.00
Gross Loss 0.00
Total Net Profit 87.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.10
Total Trades 17
Won Trades 16
Lost trades 1
Win Rate 94.12 %
Expected payoff -14.91
Gross Profit 28.78
Gross Loss -282.22
Total Net Profit -253.44
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
1.11
Total Trades 89
Won Trades 88
Lost trades 1
Win Rate 98.88 %
Expected payoff 0.14
Gross Profit 130.37
Gross Loss -117.51
Total Net Profit 12.86
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 12
Won Trades 11
Lost trades 1
Win Rate 91.67 %
Expected payoff -29880.94
Gross Profit 44.04
Gross Loss -358615.34
Total Net Profit -358571.30
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
1.40
Total Trades 106
Won Trades 105
Lost trades 1
Win Rate 99.06 %
Expected payoff 2.14
Gross Profit 798.00
Gross Loss -570.90
Total Net Profit 227.10
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
1.74
Total Trades 184
Won Trades 183
Lost trades 1
Win Rate 99.46 %
Expected payoff 0.94
Gross Profit 405.83
Gross Loss -233.07
Total Net Profit 172.76
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
6.85
Total Trades 94
Won Trades 93
Lost trades 1
Win Rate 98.94 %
Expected payoff 6.45
Gross Profit 709.70
Gross Loss -103.57
Total Net Profit 606.13
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.11
Total Trades 16
Won Trades 15
Lost trades 1
Win Rate 93.75 %
Expected payoff -19.40
Gross Profit 38.28
Gross Loss -348.69
Total Net Profit -310.41
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.81
Total Trades 38
Won Trades 37
Lost trades 1
Win Rate 97.37 %
Expected payoff -1.90
Gross Profit 298.44
Gross Loss -370.53
Total Net Profit -72.09
-100%
-50%
0%
50%
100%

Comments