Author: FMW_1
Profit factor:
1.15
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
10 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

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%
GBP/USD Jul 2025 - Sep 2025
2.33
Total Trades 83
Won Trades 82
Lost trades 1
Win Rate 98.80 %
Expected payoff 2.00
Gross Profit 290.64
Gross Loss -124.80
Total Net Profit 165.84
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.20
Total Trades 34
Won Trades 33
Lost trades 1
Win Rate 97.06 %
Expected payoff -6.94
Gross Profit 60.07
Gross Loss -295.88
Total Net Profit -235.81
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.15
Total Trades 52
Won Trades 51
Lost trades 1
Win Rate 98.08 %
Expected payoff -8.27
Gross Profit 76.65
Gross Loss -506.84
Total Net Profit -430.19
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 29
Won Trades 28
Lost trades 1
Win Rate 96.55 %
Expected payoff -12378.50
Gross Profit 114.12
Gross Loss -359090.66
Total Net Profit -358976.54
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.86
Total Trades 63
Won Trades 62
Lost trades 1
Win Rate 98.41 %
Expected payoff -1.19
Gross Profit 463.68
Gross Loss -538.88
Total Net Profit -75.20
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
0.13
Total Trades 114
Won Trades 113
Lost trades 1
Win Rate 99.12 %
Expected payoff -12.58
Gross Profit 221.52
Gross Loss -1656.00
Total Net Profit -1434.48
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.07
Total Trades 70
Won Trades 69
Lost trades 1
Win Rate 98.57 %
Expected payoff -82.78
Gross Profit 408.06
Gross Loss -6202.83
Total Net Profit -5794.77
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
8.56
Total Trades 264
Won Trades 263
Lost trades 1
Win Rate 99.62 %
Expected payoff 2.15
Gross Profit 641.25
Gross Loss -74.94
Total Net Profit 566.31
-100%
-50%
0%
50%
100%

Comments