MA.S.R_Trading_02

Author: FORTRADER.RU
Profit factor:
2.41
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
4 Views
0 Downloads
0 Favorites
MA.S.R_Trading_02
//+------------------------------------------------------------------+
//|                                            MA.S.R_Trading_02.mq4 |
//|                                                     FORTRADER.RU |
//|                                          http://www.fortrader.ru |
//+------------------------------------------------------------------+
#property copyright "FORTRADER.RU"
#property link      "http://www.fortrader.ru"

double maximum[100000];
double minimum[100000];
int l,m,flopen,b,s,total,cnt,flopens;
extern int perma=5;
extern int maxi_per=5;
extern int mini_per=5;


int start()
  {
    total=OrdersTotal();
       b=0;s=0;
      for(cnt=0;cnt<total;cnt++)
         {
           OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
            if(OrderType()==OP_BUY)
            { b=1;}
          if(OrderType()==OP_SELL)
            { s=1;}
          }  
  /*--------------------------------------------------*/        
          
  
      double ma1=iMA(NULL,0,perma,0,MODE_SMA,PRICE_CLOSE,1);
      double ma2=iMA(NULL,0,perma,0,MODE_SMA,PRICE_CLOSE,2);
      double ma3=iMA(NULL,0,perma,0,MODE_SMA,PRICE_CLOSE,3);
      
      if(ma1<ma2 && ma2>ma3)
      {
      maximum[m]=High[iHighest(NULL,0,MODE_HIGH,maxi_per,1)];
      m++;  
      }
      
      if(ma1>ma2 && ma2<ma3)
      {
      minimum[l]=Low[iLowest(NULL,0,MODE_LOW,mini_per,1)];
      l++;  
      }
      
      if(ma1<ma2 && ma2>ma3 && s==0)
      {
      OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"",Green);
      }
      
       if(ma1>ma2 && ma2<ma3 && b==0)
      {
      OrderSend(Symbol(),OP_BUY,0.1,Bid,3,0,0,"",Red);
      }

      
         for(int cnt=0;cnt<OrdersTotal();cnt++)
        {
          OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
           if(OrderType()==OP_SELL)
           {
              if(maximum[m-1]>Close[1])
              {
              OrderModify(OrderTicket(),OrderOpenPrice(),maximum[m-1],0,0,Yellow);
              }
              else{m--;}
           }
              
           if(OrderType()==OP_BUY)
           {
              if(minimum[l-1]<Close[1])
              {
              OrderModify(OrderTicket(),OrderOpenPrice(),minimum[l-1],0,0,Yellow);
              }else{l--;} 
            }     
       }
        
   return(0);
}

Profitability Reports

EUR/USD Jan 2025 - Jul 2025
0.00
Total Trades 251
Won Trades 11
Lost trades 240
Win Rate 4.38 %
Expected payoff -382.79
Gross Profit 296.50
Gross Loss -96376.90
Total Net Profit -96080.40
-100%
-50%
0%
50%
100%
AUD/USD Jan 2025 - Jul 2025
0.19
Total Trades 260
Won Trades 14
Lost trades 246
Win Rate 5.38 %
Expected payoff -2.94
Gross Profit 177.20
Gross Loss -941.20
Total Net Profit -764.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.00
Total Trades 5
Won Trades 0
Lost trades 5
Win Rate 0.00 %
Expected payoff -119.09
Gross Profit 0.00
Gross Loss -595.45
Total Net Profit -595.45
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
2.04
Total Trades 158
Won Trades 5
Lost trades 153
Win Rate 3.16 %
Expected payoff 2.06
Gross Profit 640.40
Gross Loss -314.40
Total Net Profit 326.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
2.86
Total Trades 144
Won Trades 6
Lost trades 138
Win Rate 4.17 %
Expected payoff 3.55
Gross Profit 785.50
Gross Loss -274.40
Total Net Profit 511.10
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
9.39
Total Trades 17
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff 34.16
Gross Profit 649.90
Gross Loss -69.20
Total Net Profit 580.70
-100%
-50%
0%
50%
100%

Comments