Author: Copyright � 2005, MetaQuotes Software Corp.
Profit factor:
0.61
Price Data Components
Series array that contains the highest prices of each barSeries array that contains the highest prices of each barSeries array that contains the lowest 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 can change open orders parameters, due to possible stepping strategyIt automatically opens orders when conditions are reached
10 Views
0 Downloads
0 Favorites
scalping
//+------------------------------------------------------------------+
//|                                                     scalping.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        http://www.scalping.nm.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.scalping.nm.ru"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
extern int SL=57,TP=100,TS=35; 
extern double UDayChanel=0.004;
extern int StartTime=6,EndTime=11;
extern double lots=1;
int init()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
int total,cnt;
double HighPrice,LowPrice,DayChanel;
//----
HighPrice=iHigh(Symbol(),PERIOD_D1,0);
LowPrice=iLow(Symbol(),PERIOD_D1,0);
DayChanel=HighPrice-LowPrice;

total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
   OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
   if(OrderType()<=OP_SELL && 
   OrderSymbol()==Symbol())   
   {
      if(OrderType()==OP_BUY)   
      {
         if(Hour()>EndTime)
         {
            OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); 
            return(0); 
         }
         if(TS>0)  
         {                
            if(Bid-OrderOpenPrice()>Point*TS)
            {
               if(OrderStopLoss()<Bid-Point*TS)
               {
                  OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TS,OrderTakeProfit(),0,Red);
                  return(0);
               }
            }
         }
      }
      else 
      {
         if(Hour()>EndTime)
         {
            OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); 
            return(0); 
         }
         if(TS>0)  
         {    
            if((OrderOpenPrice()-Ask)>(Point*TS))
            {
               if(OrderStopLoss()==0.0 || 
               OrderStopLoss()>(Ask+Point*TS))
               {
                  OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TS,OrderTakeProfit(),0,Red);
                  return(0);
               }
            }
          }
      }
   }
}
 
if (Hour()>=StartTime &&   Hour()<EndTime)
{
   if (AccountFreeMargin()>=2000) lots=1;
   if (AccountFreeMargin()>=3000) lots=1;
   if (AccountFreeMargin()>=4000) lots=2;
   if (AccountFreeMargin()>=5000) lots=3;
   if (AccountFreeMargin()>=6000) lots=4;
   if (AccountFreeMargin()>=7000) lots=5;
   if (AccountFreeMargin()>=8000) lots=6;
   if (AccountFreeMargin()>=9000) lots=7;
   if (AccountFreeMargin()>=10000) lots=8;
   if (AccountFreeMargin()>=11000) lots=9;
   if (DayChanel>=UDayChanel)
   {
   Print(Day(),"/",Month()," - ",Hour(),":",Minute()," - H",HighPrice," L",LowPrice," Ch",DayChanel," OB:",MathCeil(AccountFreeMargin()/1000)," LOT",lots);
      total=OrdersTotal();
      if (total==0)
      {
         OrderSend(Symbol(),OP_SELL,lots,LowPrice,0,LowPrice+SL*Point,LowPrice-TP*Point,"Scalp",16384,0,Red); OrderSend(Symbol(),OP_BUY,1,HighPrice,0,HighPrice-SL*Point,HighPrice+TP*Point,"Scalp",16384,0,Blue); 
         OrderSend(Symbol(),OP_BUY,lots,HighPrice,0,HighPrice-SL*Point,HighPrice+TP*Point,"Scalp",16384,0,Red); 
         return(0);
      }
      if (total==1)
      {
         OrderSelect(1,SELECT_BY_POS,MODE_TRADES);
         if (OrderSymbol()==Symbol())
         {
            if (OrderType()==OP_BUYSTOP)
            {
               OrderSend(Symbol(),OP_SELLSTOP,lots,LowPrice,0,LowPrice+SL*Point,LowPrice-TP*Point,"Scalp",16384,0,Red); OrderSend(Symbol(),OP_BUY,1,HighPrice,0,HighPrice-SL*Point,HighPrice+TP*Point,"Scalp",16384,0,Blue); 
            }
            if (OrderType()==OP_SELLSTOP)
            {
               OrderSend(Symbol(),OP_BUYSTOP,lots,HighPrice,0,HighPrice-SL*Point,HighPrice+TP*Point,"Scalp",16384,0,Red); OrderSend(Symbol(),OP_BUY,1,HighPrice,0,HighPrice-SL*Point,HighPrice+TP*Point,"Scalp",16384,0,Blue); 
            }
         }
         return(0);
      }
      if (total==2)
      {
         return(0);
      }
   }
}

//----
   return(0);
  }
//+------------------------------------------------------------------+

Profitability Reports

USD/JPY Jul 2025 - Sep 2025
1.09
Total Trades 323
Won Trades 179
Lost trades 144
Win Rate 55.42 %
Expected payoff 8.80
Gross Profit 32940.70
Gross Loss -30099.91
Total Net Profit 2840.79
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.37
Total Trades 38
Won Trades 14
Lost trades 24
Win Rate 36.84 %
Expected payoff -101.73
Gross Profit 2226.21
Gross Loss -6092.09
Total Net Profit -3865.88
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
1.27
Total Trades 28
Won Trades 16
Lost trades 12
Win Rate 57.14 %
Expected payoff 25.27
Gross Profit 3355.36
Gross Loss -2647.66
Total Net Profit 707.70
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.71
Total Trades 28
Won Trades 10
Lost trades 18
Win Rate 35.71 %
Expected payoff -50.61
Gross Profit 3473.00
Gross Loss -4890.00
Total Net Profit -1417.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.45
Total Trades 114
Won Trades 44
Lost trades 70
Win Rate 38.60 %
Expected payoff -49.57
Gross Profit 4586.00
Gross Loss -10237.00
Total Net Profit -5651.00
-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.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
1.20
Total Trades 67
Won Trades 35
Lost trades 32
Win Rate 52.24 %
Expected payoff 31.13
Gross Profit 12705.00
Gross Loss -10619.00
Total Net Profit 2086.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.75
Total Trades 29
Won Trades 13
Lost trades 16
Win Rate 44.83 %
Expected payoff -46.52
Gross Profit 4052.00
Gross Loss -5401.00
Total Net Profit -1349.00
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.20
Total Trades 69
Won Trades 18
Lost trades 51
Win Rate 26.09 %
Expected payoff -85.78
Gross Profit 1522.00
Gross Loss -7441.00
Total Net Profit -5919.00
-100%
-50%
0%
50%
100%

Comments