MA-R-S-EUR-USD-h4-5

Author: ������� �. Leus79@yandex.ru
Profit factor:
0.98
Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategyIt Closes Orders by itself
Indicators Used
Moving average indicatorRelative strength indexStochastic oscillatorParabolic Stop and Reverse system
10 Views
0 Downloads
0 Favorites
MA-R-S-EUR-USD-h4-5

#property copyright "Åâãåíèé Ë. Leus79@yandex.ru"

extern int tp=1450;
extern int sl=650;
extern double Lot=0.1;
extern int perma1=5;
extern int perma2=8;
 int Us1=70;
 int Us2=30;
 int Ur1=70;
 int Ur2=30;
extern int perst=5;
extern int slowst=3;
extern int perrsi=5;
extern bool Tral=true;
 double SARstep=0.02;
 double SARmax=0.2;
extern int TrailingStep=950;
 int Ust=70;






//---------------------------------------------------------------------
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {    
   return(0);
  }
  
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
  
  
bool New_Bar;
int tick,tick2;
//------------------------------------------------------------------------------------------------------

int start()
{


New_Bar=false ;
Fun_New_Bar();


if ( New_Bar==true){
tick=0; tick2=0;}
HideTestIndicators(true);

double slb,sls,tpb,tps;
double m1=iMA(NULL,0,perma1,0,1,0,0);
double m2=iMA(NULL,0,perma2,0,1,0,0);

//---------------------------------
double m11=iMA(NULL,0,perma1,0,1,0,1);
double m22=iMA(NULL,0,perma2,0,1,0,1);

//---------------------------------     

double r=iRSI(NULL,0,perrsi,0,0);    
double s=iStochastic(NULL,0,perst,3,slowst,0,0,0,0); 
double s1=iStochastic(NULL,0,perst,3,slowst,0,0,0,1);




        
  
if (OrderSelect(tick,SELECT_BY_TICKET)==false ){


if (m1>=m2 && m11<m22  && s>s1 && s<Us1 && r>50 && r<Ur1 && High[1]<Close[0] && High[2]<Close[0]) {         
                                     
slb=Ask-sl*Point ; tpb=Ask+tp*Point;
   while(tick<=0){   
   tick=OrderSend ( Symbol(),OP_BUY,Lot, Ask, 5,slb,tpb,"buy",5903442);
   }
   }
   }
   
if (OrderSelect(tick2,SELECT_BY_TICKET)==false ){        

//--------------------


if (m1<=m2 && m11>m22  && s<s1 && s>Us2 && r<50 && r>Ur2 && Low[1]>Close[0] && Low[2]>Close[0]) {



  sls=Bid+sl*Point; tps=Bid-tp*Point; 
   while(tick2<=0){  
   tick2=OrderSend ( Symbol(),OP_SELL,Lot, Bid, 5,sls,tps,"sel",5903442);
   }
   }
   }
                
   

 SarTrailingStop();
 close();

//-----------------------------------------------------------------------------------------------

   return(0);
  }

void Fun_New_Bar()
{

 static datetime New_Time=0;
 New_Bar=false;
 if(New_Time!=Time[0])
       {
        New_Time=Time[0];
        New_Bar=true; 
       }
}

//Òðåéäèíã ñòîï ================================================================================


int  SarTrailingStop()
{
double sar=iSAR(NULL,0,SARstep,SARmax,1);

        for(int  i=0; i<OrdersTotal(); i++)        
       {
        if(OrderSelect(i,SELECT_BY_POS)==true)
       {  
        if(Tral==true && OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderMagicNumber()==5903442)  
       {                
        if(sar>OrderStopLoss())
       {
        if((sar-OrderStopLoss())>=TrailingStep*Point && (Bid-sar)>MarketInfo(Symbol(),MODE_STOPLEVEL)*Point)
       {
        OrderModify(OrderTicket(),OrderOpenPrice(),sar,OrderTakeProfit(),0);
       }
       }
       }
       }    
        if(OrderSelect(i-1,SELECT_BY_POS)==true)
       {
        if(Tral==true && OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==5903442)  
       {        
        if(OrderStopLoss()>sar)
       {
        if((OrderStopLoss()-sar)>TrailingStep*Point  && (sar-Ask)>MarketInfo(Symbol(),MODE_STOPLEVEL)*Point)
       {   
        OrderModify(OrderTicket(),OrderOpenPrice(),sar,OrderTakeProfit(),0);
       }
       }
       } 
       }
       }
return(0);
}
//çàêðûòèå===========================================================================
 int close()
 {
 double M1=iMA(NULL,0,5,0,1,0,0);
 double M2=iMA(NULL,0,5,0,1,1,0);
 double M11=iMA(NULL,0,5,0,1,0,1);
 double M21=iMA(NULL,0,5,0,1,1,1);
 
      for(int  y=0; y<OrdersTotal(); y++)        
       {
        if(OrderSelect(y,SELECT_BY_POS,MODE_TRADES)==true && OrderMagicNumber()==5903442){
        if (OrderType()==OP_BUY && M1<M2-(Ust*Point) && M11>M2 && Bid<Low[1] && OrderProfit()>0){
        OrderClose(OrderTicket(),OrderLots(),Bid,5);}
        if (OrderType()==OP_SELL && M1>M2+(Ust*Point) && M11<M2 && Ask>High[1] && OrderProfit()>0){
        OrderClose(OrderTicket(),OrderLots(),Ask,5);}
       }
       }
  }      

Profitability Reports

GBP/USD Oct 2024 - Jan 2025
1.42
Total Trades 130
Won Trades 81
Lost trades 49
Win Rate 62.31 %
Expected payoff 10.38
Gross Profit 4534.30
Gross Loss -3185.00
Total Net Profit 1349.30
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
1.39
Total Trades 183
Won Trades 116
Lost trades 67
Win Rate 63.39 %
Expected payoff 9.37
Gross Profit 6069.50
Gross Loss -4355.00
Total Net Profit 1714.50
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
1.37
Total Trades 97
Won Trades 57
Lost trades 40
Win Rate 58.76 %
Expected payoff 9.90
Gross Profit 3560.00
Gross Loss -2600.00
Total Net Profit 960.00
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
1.28
Total Trades 112
Won Trades 70
Lost trades 42
Win Rate 62.50 %
Expected payoff 4.85
Gross Profit 2514.54
Gross Loss -1971.18
Total Net Profit 543.36
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
1.26
Total Trades 119
Won Trades 64
Lost trades 55
Win Rate 53.78 %
Expected payoff 7.94
Gross Profit 4520.10
Gross Loss -3575.00
Total Net Profit 945.10
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
1.15
Total Trades 83
Won Trades 53
Lost trades 30
Win Rate 63.86 %
Expected payoff 3.63
Gross Profit 2251.70
Gross Loss -1950.00
Total Net Profit 301.70
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
1.15
Total Trades 197
Won Trades 127
Lost trades 70
Win Rate 64.47 %
Expected payoff 4.27
Gross Profit 6524.86
Gross Loss -5683.55
Total Net Profit 841.31
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
1.10
Total Trades 91
Won Trades 41
Lost trades 50
Win Rate 45.05 %
Expected payoff 2.31
Gross Profit 2415.63
Gross Loss -2205.34
Total Net Profit 210.29
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
1.04
Total Trades 231
Won Trades 140
Lost trades 91
Win Rate 60.61 %
Expected payoff 1.10
Gross Profit 6168.40
Gross Loss -5915.00
Total Net Profit 253.40
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
1.03
Total Trades 202
Won Trades 123
Lost trades 79
Win Rate 60.89 %
Expected payoff 0.76
Gross Profit 5210.80
Gross Loss -5056.40
Total Net Profit 154.40
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
1.01
Total Trades 243
Won Trades 122
Lost trades 121
Win Rate 50.21 %
Expected payoff 0.30
Gross Profit 9288.43
Gross Loss -9215.13
Total Net Profit 73.30
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
1.00
Total Trades 206
Won Trades 98
Lost trades 108
Win Rate 47.57 %
Expected payoff 0.11
Gross Profit 4736.33
Gross Loss -4714.44
Total Net Profit 21.89
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.98
Total Trades 94
Won Trades 57
Lost trades 37
Win Rate 60.64 %
Expected payoff -0.63
Gross Profit 2943.81
Gross Loss -3002.87
Total Net Profit -59.06
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.97
Total Trades 237
Won Trades 121
Lost trades 116
Win Rate 51.05 %
Expected payoff -0.62
Gross Profit 4760.22
Gross Loss -4907.65
Total Net Profit -147.43
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.93
Total Trades 106
Won Trades 50
Lost trades 56
Win Rate 47.17 %
Expected payoff -1.63
Gross Profit 2192.13
Gross Loss -2364.77
Total Net Profit -172.64
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.90
Total Trades 243
Won Trades 119
Lost trades 124
Win Rate 48.97 %
Expected payoff -2.27
Gross Profit 4816.17
Gross Loss -5368.81
Total Net Profit -552.64
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.90
Total Trades 206
Won Trades 104
Lost trades 102
Win Rate 50.49 %
Expected payoff -2.08
Gross Profit 4070.29
Gross Loss -4498.29
Total Net Profit -428.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.87
Total Trades 125
Won Trades 65
Lost trades 60
Win Rate 52.00 %
Expected payoff -2.83
Gross Profit 2393.05
Gross Loss -2746.85
Total Net Profit -353.80
-100%
-50%
0%
50%
100%
EUR/USD Jan 2025 - Jul 2025
0.87
Total Trades 226
Won Trades 117
Lost trades 109
Win Rate 51.77 %
Expected payoff -4.00
Gross Profit 6182.10
Gross Loss -7085.00
Total Net Profit -902.90
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.87
Total Trades 238
Won Trades 114
Lost trades 124
Win Rate 47.90 %
Expected payoff -4.25
Gross Profit 6882.00
Gross Loss -7892.40
Total Net Profit -1010.40
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.85
Total Trades 120
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -3.71
Gross Profit 2566.30
Gross Loss -3012.00
Total Net Profit -445.70
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.85
Total Trades 246
Won Trades 139
Lost trades 107
Win Rate 56.50 %
Expected payoff -2.94
Gross Profit 4177.90
Gross Loss -4902.18
Total Net Profit -724.28
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.76
Total Trades 283
Won Trades 121
Lost trades 162
Win Rate 42.76 %
Expected payoff -6.48
Gross Profit 5771.13
Gross Loss -7605.13
Total Net Profit -1834.00
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.75
Total Trades 133
Won Trades 79
Lost trades 54
Win Rate 59.40 %
Expected payoff -6.60
Gross Profit 2632.40
Gross Loss -3510.00
Total Net Profit -877.60
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.72
Total Trades 108
Won Trades 52
Lost trades 56
Win Rate 48.15 %
Expected payoff -6.80
Gross Profit 1899.10
Gross Loss -2632.98
Total Net Profit -733.88
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.61
Total Trades 250
Won Trades 116
Lost trades 134
Win Rate 46.40 %
Expected payoff -9.60
Gross Profit 3819.78
Gross Loss -6220.29
Total Net Profit -2400.51
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.48
Total Trades 124
Won Trades 58
Lost trades 66
Win Rate 46.77 %
Expected payoff -18.00
Gross Profit 2057.80
Gross Loss -4290.00
Total Net Profit -2232.20
-100%
-50%
0%
50%
100%

Comments