Day Trading

Profit factor:
0.37
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 strategy
Indicators Used
Stochastic oscillatorMomentum indicatorMACD HistogramParabolic Stop and Reverse system
7 Views
0 Downloads
0 Favorites
Day Trading
//+------------------------------------------------------------------+
//|                                                  Day Trading.mq4 |
//|                               Copyright © 2005, NazFunds Company |
//|                                          http://www.nazfunds.com |
//+------------------------------------------------------------------+

extern double TakeProfit = 25;
extern double Lots = 1;
extern double TrailingStop = 0;
extern double StopLoss = 50;

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  double rsi1_1, rsi1_0;
  double stoc2d_1, stoc2d_0, stoc2k_1, stoc2k_0;
  double MacdCurrent, MacdPrevious, SignalCurrent;
  double sar1_1, sar1_0;
  double mom3_1, mom3_0;
  int cnt, ticket, total;
  
// 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
stoc2d_1=iStochastic(NULL,0,10,7,3,MODE_SMA,NULL,MODE_SIGNAL,1);
stoc2d_0=iStochastic(NULL,0,10,7,3,MODE_SMA,NULL,MODE_SIGNAL,0);
stoc2k_1=iStochastic(NULL,0,10,7,3,MODE_SMA,NULL,MODE_MAIN,1);
stoc2k_0=iStochastic(NULL,0,10,7,3,MODE_SMA,NULL,MODE_MAIN,0);
mom3_1=iMomentum(NULL,0,14,PRICE_OPEN,1);
mom3_0=iMomentum(NULL,0,14,PRICE_OPEN,0);
MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_TYPICAL,MODE_MAIN,0);
MacdPrevious=iMACD(NULL,0,12,26,9,PRICE_TYPICAL,MODE_MAIN,1);
SignalCurrent=iMACD(NULL,0,12,26,9,PRICE_TYPICAL,MODE_SIGNAL,0);
sar1_1 =iSAR(NULL,0,0.02,0.2,1);
sar1_0 =iSAR(NULL,0,0.02,0.2,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(sar1_0 <= Ask && sar1_1>sar1_0 && mom3_0<100 && MacdCurrent>SignalCurrent && stoc2k_0<=20)
   {
   ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,0,0,Green);
   if(ticket>0)
   Print("Day Trading Buying : ", Symbol());
   {
   if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
   } 
   return(0);
   }
   
// check for short position (SELL) possibility
   if(sar1_0 >= Ask && sar1_1<sar1_0 && mom3_0>100 && MacdCurrent<SignalCurrent && stoc2k_0>=20)
   {
   ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,0,0,Red);
   if(ticket>0)
   Print("Day Trading 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(sar1_0 >= Ask && sar1_1<sar1_0 && mom3_0>100 && MacdCurrent<SignalCurrent && 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(sar1_0<=Ask && sar1_1>sar1_0 && mom3_0<100 && MacdCurrent>SignalCurrent && 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);
   }
   
//+------------------------------------------------------------------+

Profitability Reports

USD/JPY Jul 2025 - Sep 2025
0.00
Total Trades 47
Won Trades 47
Lost trades 0
Win Rate 100.00 %
Expected payoff 16.94
Gross Profit 796.01
Gross Loss 0.00
Total Net Profit 796.01
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.90
Total Trades 18
Won Trades 17
Lost trades 1
Win Rate 94.44 %
Expected payoff -3.35
Gross Profit 532.84
Gross Loss -593.07
Total Net Profit -60.23
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.57
Total Trades 25
Won Trades 24
Lost trades 1
Win Rate 96.00 %
Expected payoff -12.91
Gross Profit 434.71
Gross Loss -757.49
Total Net Profit -322.78
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.00
Total Trades 15
Won Trades 15
Lost trades 0
Win Rate 100.00 %
Expected payoff 25.00
Gross Profit 375.00
Gross Loss 0.00
Total Net Profit 375.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.45
Total Trades 26
Won Trades 25
Lost trades 1
Win Rate 96.15 %
Expected payoff -28.96
Gross Profit 625.00
Gross Loss -1378.00
Total Net Profit -753.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.08
Total Trades 15
Won Trades 14
Lost trades 1
Win Rate 93.33 %
Expected payoff -182.43
Gross Profit 252.94
Gross Loss -2989.38
Total Net Profit -2736.44
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.00
Total Trades 27
Won Trades 27
Lost trades 0
Win Rate 100.00 %
Expected payoff 16.50
Gross Profit 445.48
Gross Loss 0.00
Total Net Profit 445.48
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
1.12
Total Trades 32
Won Trades 31
Lost trades 1
Win Rate 96.88 %
Expected payoff 2.66
Gross Profit 775.00
Gross Loss -690.00
Total Net Profit 85.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
1.24
Total Trades 15
Won Trades 14
Lost trades 1
Win Rate 93.33 %
Expected payoff 4.53
Gross Profit 350.00
Gross Loss -282.00
Total Net Profit 68.00
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
0.00
Total Trades 101
Won Trades 101
Lost trades 0
Win Rate 100.00 %
Expected payoff 16.76
Gross Profit 1692.65
Gross Loss 0.00
Total Net Profit 1692.65
-100%
-50%
0%
50%
100%

Comments