ADXCROSSautotrade3

Author: Perky_z@yahoo.com
Profit factor:
0.36
Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategyIt Closes Orders by itself It automatically opens orders when conditions are reached
Indicators Used
Movement directional index
8 Views
0 Downloads
0 Favorites
ADXCROSSautotrade3
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                             ADXcross EXPERT      |
//|                                                     Perky_z      |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Perky_z@yahoo.com                                    "
#property link      "http://groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/"
//+--------------------------------------------------------------------------------------------------+
//|  Alerts in hand with ADXcrosses Indicator they dont need to be run together                       |
//+--------------------------------------------------------------------------------------------------+
// Alerts on cross of + and - DI lines
// I use it on 15 min charts
// though looks good on any time frame
// use other indicators to confirm this trigger tho

//---- input parameters


extern double    Lots=0.1;
extern int       Stoploss=50;
extern int       TakeProfit=999;
extern double    TrailingStop = 0;
extern int       Slip=5;



//----
double b4plusdi,b4minusdi,nowplusdi,nowminusdi,Opentrades,cnt,total,TradesInThisSymbol,NoTouchBar;


//---- indicators




//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//| Setting internal variables for quick access to data              |
//+------------------------------------------------------------------+
int start()
  {
  
  if (iTime(Symbol(),0,0)==NoTouchBar) return(0);
  
   //if (Opentrades!=0)  //and iATR(5,2)<StopLoss*Point 
   
     //{
      total=OrdersTotal();
   TradesInThisSymbol=0;
     
      for(cnt=0;cnt<total;cnt++)
        {
         if ( OrderSelect (cnt, SELECT_BY_POS) == false )  continue;
         if ( OrderSymbol() != Symbol())  continue;
         if((OrderType() == OP_BUY || OrderType() == OP_BUYSTOP) && (OrderSymbol()==Symbol()))
             {
                TradesInThisSymbol++;
                if(TrailingStop>0) 
                  {                
                   if(Bid-OrderOpenPrice()>Point*TrailingStop)
                     {
                      if(OrderStopLoss()<Bid-Point*TrailingStop)
                        {
                         OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Aqua);
                         //return(0);
                        }
                     }
                  }
                break;
             }
         if((OrderType() == OP_SELL || OrderType() == OP_SELLSTOP) && (OrderSymbol()==Symbol()))
             {
                TradesInThisSymbol++;
                if(TrailingStop>0)  
                  {                
                   if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                     {
                      if(OrderStopLoss()==0.0 || 
                         OrderStopLoss()>(Ask+Point*TrailingStop))
                        {
                         OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Aqua);
                         //return(0);
                        }
                     }
                  }
               break;
             }
        }
   
   //if (Opentrades==0)  //and iATR(5,2)<StopLoss*Point 
   
     //{
  
   
  
         b4plusdi=iADX(NULL,0,14,PRICE_CLOSE,MODE_PLUSDI,1);
         nowplusdi=iADX(NULL,0,14,PRICE_CLOSE,MODE_PLUSDI,0);
   
         b4minusdi=iADX(NULL,0,14,PRICE_CLOSE,MODE_MINUSDI,1);
         nowminusdi=iADX(NULL,0,14,PRICE_CLOSE,MODE_MINUSDI,0);
   
      //Comment (nowplusdi);
      //+------------------------------------------------------------------+
      //| Money Management mm=0(lots) mm=-1(Mini) mm=1(full compounding)   |
      //+------------------------------------------------------------------+   
   
   
      //----

      //+------------------------------------------------------------------+
      //|                                                                  |
      //+------------------------------------------------------------------+
   
   
         if(nowplusdi<nowminusdi)
            {
            //Alert(Symbol()," ",Period()," ADX SELLING");
            if (TradesInThisSymbol>0)
               {
               if(OrderType() == OP_BUY)
                  {
                  OrderClose(OrderTicket(),OrderLots(),Bid,Slip,Violet); 
                  //return(0);
                  }
                  else return(0);
               }
            if(b4plusdi>b4minusdi)
               {
               OrderSend(Symbol(),OP_SELL,Lots,Bid,Slip,Bid+Stoploss*Point,Bid-TakeProfit*Point,"ADX",0,0,Red);
               NoTouchBar=iTime(Symbol(),0,0);
               return(0);
               }
            }   
         if(nowplusdi>nowminusdi)
             {
            if (TradesInThisSymbol>0)
               {
               if(OrderType() == OP_SELL)
                  {
                  OrderClose(OrderTicket(),OrderLots(),Ask,Slip,Violet); 
                  //return(0);
                  }
                  else return(0);
               }
               //Alert(Symbol()," ",Period()," ADX BUYING");
            if(b4plusdi<b4minusdi)
                {
                OrderSend(Symbol(),OP_BUY,Lots,Ask,Slip,Ask-Stoploss*Point,Ask+TakeProfit*Point,"ADX",0,0,White);
                NoTouchBar=iTime(Symbol(),0,0);
                return(0);
                }
              }
        
     
            //}
      //}
   return(0);
   }
  // }
   
  
 


Profitability Reports

NZD/USD Jul 2025 - Sep 2025
0.52
Total Trades 516
Won Trades 82
Lost trades 434
Win Rate 15.89 %
Expected payoff -1.72
Gross Profit 976.10
Gross Loss -1865.50
Total Net Profit -889.40
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.42
Total Trades 510
Won Trades 55
Lost trades 455
Win Rate 10.78 %
Expected payoff -2.43
Gross Profit 912.90
Gross Loss -2154.60
Total Net Profit -1241.70
-100%
-50%
0%
50%
100%
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.23
Total Trades 508
Won Trades 12
Lost trades 496
Win Rate 2.36 %
Expected payoff -2.42
Gross Profit 373.08
Gross Loss -1602.38
Total Net Profit -1229.30
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.60
Total Trades 534
Won Trades 84
Lost trades 450
Win Rate 15.73 %
Expected payoff -1.54
Gross Profit 1221.70
Gross Loss -2045.00
Total Net Profit -823.30
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.45
Total Trades 531
Won Trades 77
Lost trades 454
Win Rate 14.50 %
Expected payoff -1.95
Gross Profit 834.00
Gross Loss -1871.50
Total Net Profit -1037.50
-100%
-50%
0%
50%
100%
USD/CHF Oct 2024 - Jan 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%
USD/CAD Oct 2024 - Jan 2025
0.68
Total Trades 250
Won Trades 35
Lost trades 215
Win Rate 14.00 %
Expected payoff -0.94
Gross Profit 508.39
Gross Loss -743.04
Total Net Profit -234.65
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.26
Total Trades 265
Won Trades 16
Lost trades 249
Win Rate 6.04 %
Expected payoff -3.43
Gross Profit 312.20
Gross Loss -1222.40
Total Net Profit -910.20
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.46
Total Trades 311
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -2.45
Gross Profit 641.00
Gross Loss -1403.70
Total Net Profit -762.70
-100%
-50%
0%
50%
100%

Comments