Author: xxx
Profit factor:
38.46
Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest prices of each bar
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
13 Views
0 Downloads
0 Favorites
TrendS
//+------------------------------------------------------------------+
//|                                                       TrendS.mq4 |
//|                                      Copyright © 2006, xxx |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "xxx"
#property link      "http://www.xxx.ru/"


extern double    LotsIfNoMM=0.1;
extern int       StopLoss=50;
extern int       Slip=5;
extern int       MM_Mode=0;
extern int       MM_Risk=40;

double Opentrades,orders,first,mode,Ilo,sym,b,tmp,GridCellPoint,OpenOrderStopLoss;
double b4signal,Signal,Triggerline,b4Triggerline,Nowsignal,NowTriggerline,sl,LastOpByExpert,LastBarChecked;
int cnt,cnt2,OpenPosition,notouchbar,PendingOrderTicket,OpenOrderTicket; 
bool test;


//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//---- 


//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  
//return(0);
   
   //if ( ! IsTesting() ) Comment(" Trailingstop    ",  b, "\n","      Tick no. ", iVolume(NULL,0,0),"\n"," Lots    ",Ilo);


  

   if (MM_Mode < 0)  {
   Ilo = MathCeil(AccountBalance()*MM_Risk/10000)/10;
     if (Ilo > 100) {  
     Ilo = 100;  
     }
   } else {
   Ilo = LotsIfNoMM;
   }
   if (MM_Mode > 0)  
    {
   Ilo = MathCeil(AccountBalance()*MM_Risk/10000)/10;
    if (Ilo > 1)  
    {
    Ilo = MathCeil(Ilo);
    }
    if (Ilo < 1)  
    {
    Ilo = 1;
    }
    if (Ilo > 100)  
    {  
     Ilo = 100;  
     }
   }
 	      
Opentrades=0;
for (cnt=0;cnt<OrdersTotal();cnt++) 
   {
   if ( OrderSelect (cnt, SELECT_BY_POS) == false )  continue;
   if ( OrderSymbol()==Symbol()) 
      {
      Opentrades=Opentrades+1;
      }
   }

if (Opentrades!=0)
   {
   if (OrderType()==OP_BUY) 
      {
      if (Bid>=iHigh(Symbol(),0,Highest(Symbol(),0,MODE_HIGH,6,1)))
         {
         OrderClose(OrderTicket(),OrderLots(),Bid,Slip,Red); 
         Opentrades--;
         }
      }
      else if (OrderType()==OP_SELL)
      {
      if (Bid<=iLow(Symbol(),0,Lowest(Symbol(),0,MODE_LOW,6,1)))
         {
         OrderClose(OrderTicket(),OrderLots(),Ask,Slip,Red); 
         Opentrades--;
         }
      }
   }

if (Opentrades==0)
   {
   
   if (iMA(Symbol(),0,6,0,MODE_EMA,PRICE_CLOSE,1)>iMA(Symbol(),0,12,0,MODE_SMA,PRICE_CLOSE,1) && Bid<=iLow(Symbol(),0,Lowest(Symbol(),0,MODE_LOW,6,1)))
      {
      OrderSend(Symbol(),OP_BUY,Ilo,Ask,Slip,Ask-StopLoss*Point,0,"CP",0,0,Blue);
      }
      
   if (iMA(Symbol(),0,6,0,MODE_EMA,PRICE_CLOSE,1)<iMA(Symbol(),0,12,0,MODE_SMA,PRICE_CLOSE,1) && Bid>=iHigh(Symbol(),0,Highest(Symbol(),0,MODE_HIGH,6,1)))
      {
      OrderSend(Symbol(),OP_SELL,Ilo,Bid,Slip,Bid+StopLoss*Point,0,"CP",0,0,Blue);
      }
  
   }

   return(0);
  }


Profitability Reports

GBP/CAD Jul 2025 - Sep 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%
GBP/AUD Jul 2025 - Sep 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%
EUR/USD Jul 2025 - Sep 2025
304.72
Total Trades 648
Won Trades 93
Lost trades 555
Win Rate 14.35 %
Expected payoff 1300.65
Gross Profit 845594.30
Gross Loss -2775.00
Total Net Profit 842819.30
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.67
Total Trades 407
Won Trades 105
Lost trades 302
Win Rate 25.80 %
Expected payoff -1.24
Gross Profit 1004.60
Gross Loss -1510.00
Total Net Profit -505.40
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.57
Total Trades 393
Won Trades 49
Lost trades 344
Win Rate 12.47 %
Expected payoff -1.33
Gross Profit 698.63
Gross Loss -1222.62
Total Net Profit -523.99
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.55
Total Trades 356
Won Trades 52
Lost trades 304
Win Rate 14.61 %
Expected payoff -1.91
Gross Profit 840.20
Gross Loss -1520.00
Total Net Profit -679.80
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.52
Total Trades 492
Won Trades 42
Lost trades 450
Win Rate 8.54 %
Expected payoff -2.21
Gross Profit 1163.90
Gross Loss -2250.00
Total Net Profit -1086.10
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.65
Total Trades 344
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -1.49
Gross Profit 942.80
Gross Loss -1455.00
Total Net Profit -512.20
-100%
-50%
0%
50%
100%

Comments