Day Trading_PAMXA

Author: Copyright � 2009, SMERJ ORG
Profit factor:
0.39
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategyChecks for the total of closed orders
Indicators Used
Bill Williams Awesome oscillatorMovement directional indexStochastic oscillator
11 Views
0 Downloads
0 Favorites
Day Trading_PAMXA
//+------------------------------------------------------------------+
//|                                            Day Trading_PAMXA.mq4 |
//|                                      Copyright © 2009, SMERJ ORG |
//|                                            http://smerj.ucoz.org |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, SMERJ ORG"
#property link      "http://smerj.ucoz.org"

extern double TakeProfit = 25;
extern double Lots = 0;
extern double TrailingStop = 0;
extern double StopLoss = 50;
extern   bool     UseMM = true;
extern   bool     MicroAcct = false;
extern   double   Risk = 30;
double   var_96 = 0;
string   var_240 = "";

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  double stoc2k_0;
  double AO;
  double adx_0, adx_1;
  int cnt, ticket, total;

//server Time

Comment(var_240,"\nServer Time = ",TimeToStr(TimeCurrent(),TIME_MINUTES));
 
// initial data checks
   if(Bars<10)
     {
      Print("bars less than 10");
      return(0);  
     }
   if(TakeProfit<10)
     {
      Print("TakeProfit less than 10");
      return(0);
     }
     
// to simplify the coding and speed up access

AO=iAO(NULL,0,150);
adx_0=iADX(NULL,0,14,PRICE_TYPICAL,MODE_SIGNAL,0);
adx_1=iADX(NULL,0,14,PRICE_TYPICAL,MODE_SIGNAL,1);
stoc2k_0=iStochastic(NULL,0,5,3,3,MODE_SMA,NULL,MODE_MAIN,0);

// identifying open orders
   total=OrdersTotal();
   if(total<1)
   {
   if(AccountFreeMargin()<(1000*Lots))
   {
   Print("We have no money. Free Margin = ", AccountFreeMargin());
   return(0);  
   }
   
// check for long position (BUY) possibility
   if(AO<0 && adx_0 >= Ask && adx_1<adx_0 && stoc2k_0<20)
   {
   ticket=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,0,Ask+TakeProfit*Point,0,0,Green);
   if(ticket>0)
   Print("Day Trading_PAMXA Buying : ", Symbol());
   {
   if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
   } 
   return(0);
   }
   
// check for short position (SELL) possibility
   if(AO>0 && adx_0 >= Ask && adx_1<adx_0 && stoc2k_0>20)
   {
   ticket=OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,3,0,Bid-TakeProfit*Point,0,0,Red);
   if(ticket>0)
   Print("Day Trading_PAMXA Selling : ", Symbol());
   {
   if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
   }
   return(0);
   }
   return(0);
   }
   
// control of open orders
   for(cnt=0;cnt<total;cnt++)
   {
   OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
   if(OrderType()<=OP_SELL && 
   OrderSymbol()==Symbol())
   {
   if(OrderType()==OP_BUY)
   {

// long positions
   if(AO>0 && adx_0 >= Ask && adx_1<adx_0 && stoc2k_0>70)
   {
      OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
   return(0);
   }

// check for trailing stop
   if(TrailingStop>0)  
   {                 
   if(Bid-OrderOpenPrice()>Point*TrailingStop)
   {
   if(OrderStopLoss()<Bid-Point*TrailingStop)
   {
   OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
   return(0);
   }
   }
   }
   }
else

// short positions
   {
   if(AO<0 && adx_0 >= Ask && adx_1<adx_0 && stoc2k_0<35)
      {
   OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);
   return(0);
   }

// check for trailing stop
   if(TrailingStop>0)  
   {                 
   if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
   {
   if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
   {
   OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
   return(0);
   }
   }
   }
   }
   }
   }
   return(0);
   }
   
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

double LotsOptimized()
{
if (UseMM == false) return(Lots);

double lots = Lots;
int    ordtotal = OrdersHistoryTotal();
int    losscnt = 0;
double var_LotsOptimized_16 = 0;
int    digits = 1;

if (MarketInfo(Symbol(),MODE_LOTSTEP) == 1.0) digits = 1;
if (MicroAcct == true) digits = 2;

lots = NormalizeDouble(AccountFreeMargin() * Risk / 100.0 / 1000.0,digits);

if (var_96 > 0.0)
   {
   for (int i = ordtotal - 1; i >= 0; i--)
      {
      if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) == 0)
         {
         Print("Error in history!");
         break;
         }
      if ((OrderSymbol() != Symbol()) || (OrderType() > OP_SELL)) continue;
      if (OrderProfit() > 0.0) break;
      if (OrderProfit() < 0.0) losscnt++;
      }
   if (losscnt > 1) lots = NormalizeDouble(lots - lots * losscnt / var_96,1);
   }

if ((lots < 0.1) && (MicroAcct == false)) lots = 0.1;
if ((lots < 0.01) && (MicroAcct == true)) lots = 0.01;
if (lots > 50.0) lots = 50;
return(lots);
}

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
1.09
Total Trades 147
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff 7.72
Gross Profit 13813.70
Gross Loss -12679.40
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.80
Total Trades 202
Won Trades 177
Lost trades 25
Win Rate 87.62 %
Expected payoff -15.45
Gross Profit 12443.10
Gross Loss -15564.60
Total Net Profit -3121.50
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.80
Total Trades 202
Won Trades 176
Lost trades 26
Win Rate 87.13 %
Expected payoff -15.85
Gross Profit 12560.00
Gross Loss -15762.70
Total Net Profit -3202.70
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.70
Total Trades 454
Won Trades 423
Lost trades 31
Win Rate 93.17 %
Expected payoff -16.24
Gross Profit 16951.15
Gross Loss -24324.52
Total Net Profit -7373.37
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.70
Total Trades 248
Won Trades 227
Lost trades 21
Win Rate 91.53 %
Expected payoff -26.60
Gross Profit 15382.50
Gross Loss -21980.10
Total Net Profit -6597.60
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.69
Total Trades 126
Won Trades 116
Lost trades 10
Win Rate 92.06 %
Expected payoff -18.94
Gross Profit 5394.43
Gross Loss -7780.48
Total Net Profit -2386.05
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.66
Total Trades 159
Won Trades 146
Lost trades 13
Win Rate 91.82 %
Expected payoff -35.43
Gross Profit 10787.50
Gross Loss -16421.30
Total Net Profit -5633.80
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.63
Total Trades 119
Won Trades 113
Lost trades 6
Win Rate 94.96 %
Expected payoff -27.83
Gross Profit 5604.73
Gross Loss -8916.86
Total Net Profit -3312.13
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.62
Total Trades 128
Won Trades 108
Lost trades 20
Win Rate 84.38 %
Expected payoff -39.16
Gross Profit 8040.00
Gross Loss -13052.40
Total Net Profit -5012.40
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.55
Total Trades 211
Won Trades 183
Lost trades 28
Win Rate 86.73 %
Expected payoff -23.40
Gross Profit 5921.77
Gross Loss -10858.63
Total Net Profit -4936.86
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.51
Total Trades 194
Won Trades 179
Lost trades 15
Win Rate 92.27 %
Expected payoff -42.42
Gross Profit 8627.50
Gross Loss -16857.50
Total Net Profit -8230.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.46
Total Trades 125
Won Trades 116
Lost trades 9
Win Rate 92.80 %
Expected payoff -52.29
Gross Profit 5605.00
Gross Loss -12141.30
Total Net Profit -6536.30
-100%
-50%
0%
50%
100%
AUD/USD Jan 2025 - Jul 2025
0.44
Total Trades 156
Won Trades 142
Lost trades 14
Win Rate 91.03 %
Expected payoff -60.40
Gross Profit 7465.00
Gross Loss -16887.30
Total Net Profit -9422.30
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.43
Total Trades 180
Won Trades 150
Lost trades 30
Win Rate 83.33 %
Expected payoff -45.53
Gross Profit 6074.24
Gross Loss -14270.23
Total Net Profit -8195.99
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.41
Total Trades 111
Won Trades 98
Lost trades 13
Win Rate 88.29 %
Expected payoff -68.49
Gross Profit 5324.98
Gross Loss -12927.65
Total Net Profit -7602.67
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.39
Total Trades 152
Won Trades 140
Lost trades 12
Win Rate 92.11 %
Expected payoff -39.84
Gross Profit 3807.90
Gross Loss -9864.09
Total Net Profit -6056.19
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.38
Total Trades 368
Won Trades 341
Lost trades 27
Win Rate 92.66 %
Expected payoff -24.93
Gross Profit 5688.73
Gross Loss -14863.60
Total Net Profit -9174.87
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.38
Total Trades 228
Won Trades 201
Lost trades 27
Win Rate 88.16 %
Expected payoff -36.96
Gross Profit 5170.94
Gross Loss -13598.50
Total Net Profit -8427.56
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.27
Total Trades 303
Won Trades 283
Lost trades 20
Win Rate 93.40 %
Expected payoff -32.88
Gross Profit 3701.90
Gross Loss -13664.45
Total Net Profit -9962.55
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.24
Total Trades 107
Won Trades 98
Lost trades 9
Win Rate 91.59 %
Expected payoff -88.97
Gross Profit 3082.68
Gross Loss -12602.69
Total Net Profit -9520.01
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.23
Total Trades 166
Won Trades 149
Lost trades 17
Win Rate 89.76 %
Expected payoff -60.02
Gross Profit 2977.50
Gross Loss -12940.10
Total Net Profit -9962.60
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.16
Total Trades 83
Won Trades 68
Lost trades 15
Win Rate 81.93 %
Expected payoff -101.76
Gross Profit 1589.14
Gross Loss -10034.83
Total Net Profit -8445.69
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.15
Total Trades 116
Won Trades 93
Lost trades 23
Win Rate 80.17 %
Expected payoff -86.06
Gross Profit 1730.00
Gross Loss -11712.60
Total Net Profit -9982.60
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.11
Total Trades 113
Won Trades 79
Lost trades 34
Win Rate 69.91 %
Expected payoff -84.60
Gross Profit 1128.19
Gross Loss -10688.41
Total Net Profit -9560.22
-100%
-50%
0%
50%
100%
EUR/USD Jan 2025 - Jul 2025
0.01
Total Trades 100
Won Trades 88
Lost trades 12
Win Rate 88.00 %
Expected payoff -3910.86
Gross Profit 2560.00
Gross Loss -393645.70
Total Net Profit -391085.70
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 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
0.00
Total Trades 32
Won Trades 31
Lost trades 1
Win Rate 96.88 %
Expected payoff -125217.82
Gross Profit 2607.50
Gross Loss -4009577.60
Total Net Profit -4006970.10
-100%
-50%
0%
50%
100%
USD/JPY 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
0.00
Total Trades 56
Won Trades 53
Lost trades 3
Win Rate 94.64 %
Expected payoff -71421.93
Gross Profit 4232.50
Gross Loss -4003860.80
Total Net Profit -3999628.30
-100%
-50%
0%
50%
100%
USD/JPY 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%

Comments