Scalping - page 7

 

Scalping


The forum

The articles

CodeBase

    Implementing a Scalping Market Depth Using the CGraphic Library
    Implementing a Scalping Market Depth Using the CGraphic Library
    • www.mql5.com
    Now, we will start to work with this improved and revised version trying to gradually turn it into a scalping Market Depth tool. Overview of the CPanel graphics library There are many articles devoted to the creation of user interfaces in MQL5. Anatoly Kazharsky's "Graphical Interfaces" series stands out among them. It is difficult to add...
     
    Implementing a Scalping Market Depth Using the CGraphic Library
    Implementing a Scalping Market Depth Using the CGraphic Library
    • www.mql5.com
    Now, we will start to work with this improved and revised version trying to gradually turn it into a scalping Market Depth tool. Overview of the CPanel graphics library There are many articles devoted to the creation of user interfaces in MQL5. Anatoly Kazharsky's "Graphical Interfaces" series stands out among them. It is difficult to add...
     

    Forum on trading, automated trading systems and testing trading strategies

    Scalping system

    Sergey Golubev, 2021.05.26 18:55

    Combination scalping: analyzing trades from the past to increase the performance of future trades

    https://www.mql5.com/en/articles/9231

    I was not going to become a scalping trader, but I had to. Furthermore, I did not want to be a trader or a developer of automated trading systems. Luckily, I did become a trader and a developer. My research work resulted in the appearance of an eternal technology which can be inherited by children, grandchildren, great-grandchildren and so on. Unless the world changes dramatically. Unless exchanges stop working.

     

    Scalping Orderflow for MQL5

    Scalping Orderflow for MQL5

    An example of a sophisticated algorithmic trading system for MetaTrader 5 (MQL5) that uses the Scalping OrderFlow technique is this Expert Advisor (EA).

    A short-term trading strategy known as "scalping order flow" focuses on identifying possible entry and exit points in the market by examining the real-time flow of orders. It makes quick trading decisions by combining the study of volume, price activity, and order book data. Typically, positions are held for a very short time—often within minutes or even seconds.
    Scalping Orderflow for MQL5
    Scalping Orderflow for MQL5
    • www.mql5.com
    This MetaTrader 5 Expert Advisor implements a Scalping OrderFlow strategy with advanced risk management. It uses multiple technical indicators to identify trading opportunities based on order flow imbalances. Backtesting shows potential profitability but highlights the need for further optimization, especially in risk management and trade outcome ratios. Suitable for experienced traders, it requires thorough testing and understanding before live deployment.
     

    Formulating Dynamic Multi-Pair EA (Part 5): Scalping vs Swing Trading Approaches

    Formulating Dynamic Multi-Pair EA (Part 5): Scalping vs Swing Trading Approaches

    Scalping is a trading approach that focuses on taking advantage of very tiny price movements within short timeframes, often seconds to minutes. Traders using this style open and close multiple positions throughout the day, aiming to profit from micro-fluctuations in market price rather than large directional moves. It requires precision, fast execution, and strict discipline, as spreads, slippage, and transaction costs can quickly eat into profits. Scalpers rely heavily on lower timeframes like the 1-minute or 5-minute charts, using technical indicators such as moving averages, volume spikes, and momentum oscillators to time entries and exits with high accuracy.
    Formulating Dynamic Multi-Pair EA (Part 5): Scalping vs Swing Trading Approaches
    Formulating Dynamic Multi-Pair EA (Part 5): Scalping vs Swing Trading Approaches
    • 2025.11.11
    • www.mql5.com
    This part explores how to design a Dynamic Multi-Pair Expert Advisor capable of adapting between Scalping and Swing Trading modes. It covers the structural and algorithmic differences in signal generation, trade execution, and risk management, allowing the EA to intelligently switch strategies based on market behavior and user input.
    [Deleted]  
    Sergey Golubev:

    Scalping EA from russian forum finlist for usdchf, M1 with the settings attached.

    It is very interesting but they understand the scalping as a trading on m1 timeframe only. This EA is trading no more than one trades per day.

    It is backtested very good on m1, m5 and m15 timeframe for usdchf, every tick. See attached.

    Can you explain the strategy and logic. I have tried my best to understand and translate to English. here is English Translated code but still strategy is unclear. 

    //+------------------------------------------------------------------+
    //|                                                        Probe.mq4 |
    //|                      Copyright © 2005, MetaQuotes Software Corp. |
    //|                                        http://www.metaquotes.net |
    //+------------------------------------------------------------------+
    #property copyright "Copyright © 2005, MetaQuotes Software Corp."
    #property link      "http://www.metaquotes.net"
    
    //+------------------------------------------------------------------+
    //| expert initialization function                                   |
    //+------------------------------------------------------------------+
    
    extern double PendingOrderDistance = 30;
    extern double StopLoss =95;
    extern double CCILevel = 120 ;
    extern double CCIPeriod = 73 ;
    extern double MaxPriceDistance = 30 ;
    extern double TrailingStop = 110;
    extern double BreakEven = 60 ;
    extern double MagicNumber = 1000;
    //----
    
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    int OnInit()
      {
       return(INIT_SUCCEEDED);
      }
    
    //+------------------------------------------------------------------+
    //| expert start function                                            |
    //+------------------------------------------------------------------+
    void OnTick()
      {
    //CCI Values
       double UpperLevel = CCILevel;
       double BelowLevel = -CCILevel;
    
       double CCI_CurrentCandle=iCCI(NULL,PERIOD_H4,CCIPeriod,PRICE_TYPICAL,0);
       double CCI_PreviousCandle=iCCI(NULL,PERIOD_H4,CCIPeriod,PRICE_TYPICAL,1);
       double CCI_2CandleBack=iCCI(NULL,PERIOD_H4,CCIPeriod,PRICE_TYPICAL,2);
       double count;
    
    //Check if any running trade
       bool TradeExit = false;
       for(count=0; count<OrdersTotal(); count++)
         {
          OrderSelect(count,SELECT_BY_POS,MODE_TRADES) ;
          if(OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber)
             TradeExit = true;
         }
    
    //Open New Trade
       if(CCI_CurrentCandle >BelowLevel &&  CCI_PreviousCandle<BelowLevel && CCI_2CandleBack<BelowLevel && !TradeExit)
         {
          OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask+PendingOrderDistance*Point,3,Ask+PendingOrderDistance*Point-StopLoss*Point,0,"BUYSTOP",MagicNumber,0,clrGreen);
          string buyArrowName = "BuyArrow" + TimeCurrent();
          if(ObjectCreate(0, buyArrowName, OBJ_ARROW, 0, TimeCurrent(), Bid))
            {
             ObjectSetInteger(0, buyArrowName, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
             ObjectSetInteger(0, buyArrowName, OBJPROP_COLOR, clrGreen);
             ObjectSetInteger(0, buyArrowName, OBJPROP_WIDTH, 3);
            }
         }
    
       if(CCI_CurrentCandle<UpperLevel && CCI_PreviousCandle>UpperLevel && CCI_2CandleBack>UpperLevel  && !TradeExit)
         {
          OrderSend(Symbol(),OP_SELLSTOP,0.1,Bid-PendingOrderDistance*Point,3,Bid-PendingOrderDistance*Point+StopLoss*Point,0,"SELLSTOP",MagicNumber,0,clrRed);
          string sellArrowName = "SellArrow" + TimeCurrent();
          if(ObjectCreate(0, sellArrowName, OBJ_ARROW, 0, TimeCurrent(), Ask))
            {
             ObjectSetInteger(0, sellArrowName, OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
             ObjectSetInteger(0, sellArrowName, OBJPROP_COLOR, clrRed);
             ObjectSetInteger(0, sellArrowName, OBJPROP_WIDTH, 3);
            }
         }
    
    //Delete Order
       if(OrdersTotal() > 0)
         {
          for(count=0; count<OrdersTotal(); count++)
            {
             OrderSelect(count, SELECT_BY_POS,MODE_TRADES) ;
    
             if(OrderType()==OP_BUYSTOP && OrderOpenPrice() -Ask  > MaxPriceDistance* Point && OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber)
               {
                OrderDelete(OrderTicket());
               }
    
             if(OrderType()==OP_SELLSTOP && Ask - OrderOpenPrice()   > MaxPriceDistance* Point && OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber)
               {
                OrderDelete(OrderTicket());
               }
            }
    
          //Reverse logic when opposite CCI signal appears (Still unclear operation)
          for(count=0; count<OrdersTotal(); count++)
            {
             OrderSelect(count, SELECT_BY_POS,MODE_TRADES) ;
    
             if(OrderType()==OP_BUY && CCI_CurrentCandle<UpperLevel && CCI_PreviousCandle>UpperLevel && CCI_2CandleBack>UpperLevel && OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber)
               {
                OrderClose(OrderTicket(),0.1,Bid,3,White);
                OrderSend(Symbol(),OP_SELLSTOP,0.1,Bid-PendingOrderDistance*Point,3,Bid-PendingOrderDistance*Point+StopLoss*Point,0,"SELLSTOP",MagicNumber,0,clrRed);
                string sellArrowNameReverse = "SellArrowReverse" + TimeCurrent();
                if(ObjectCreate(0, sellArrowNameReverse, OBJ_ARROW, 0, TimeCurrent(), Ask))
                  {
                   ObjectSetInteger(0, sellArrowNameReverse, OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
                   ObjectSetInteger(0, sellArrowNameReverse, OBJPROP_COLOR, clrOrange);
                   ObjectSetInteger(0, sellArrowNameReverse, OBJPROP_WIDTH, 3);
                  }
               }
             if(OrderType()==OP_SELL &&  CCI_CurrentCandle >BelowLevel && CCI_PreviousCandle<BelowLevel && CCI_2CandleBack<BelowLevel && OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber)
               {
                OrderClose(OrderTicket(),0.1,Ask,3,White);
                OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask+PendingOrderDistance*Point,3,Ask+PendingOrderDistance*Point-StopLoss*Point,0,"BUYSTOP",MagicNumber,0,clrGreen);
                string buyArrowNameReverse = "BuyArrowReverse" + TimeCurrent();
                if(ObjectCreate(0, buyArrowNameReverse, OBJ_ARROW, 0, TimeCurrent(), Bid))
                  {
                   ObjectSetInteger(0, buyArrowNameReverse, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
                   ObjectSetInteger(0, buyArrowNameReverse, OBJPROP_COLOR, clrBlue);
                   ObjectSetInteger(0, buyArrowNameReverse, OBJPROP_WIDTH, 3);
                  }
               }
            }
    
          //Trailing Stop function
          for(count=0; count<OrdersTotal(); count++)
            {
             if(TrailingStop>0 && OrderSymbol()==Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == MagicNumber)
               {
                if(Bid-OrderOpenPrice()>Point*TrailingStop)
                  {
                   if(OrderStopLoss()<Bid-Point*TrailingStop)
                     {
                      OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
                      return;
                     }
                  }
               }
             if(TrailingStop>0 && OrderSymbol()==Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == MagicNumber)
               {
                if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                  {
                   if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                     {
                      OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
                      return;
                     }
                  }
               }
            }
    
          //BreakEven function
          for(count=0; count<OrdersTotal(); count++)
            {
             OrderSelect(count, SELECT_BY_POS) ;
             if(OrderType()==OP_BUY && OrderMagicNumber() == MagicNumber && Bid-OrderOpenPrice() > BreakEven*Point && OrderSymbol()==Symbol() && OrderOpenPrice()-OrderStopLoss() > 10*Point && BreakEven>0)
               {
                OrderModify(OrderTicket(), 0,OrderOpenPrice(), 0, 0,0) ;
               }
             if(OrderType()==OP_SELL && OrderMagicNumber() == MagicNumber && OrderOpenPrice()-Bid > BreakEven*Point && OrderSymbol()==Symbol()&& OrderStopLoss()-OrderOpenPrice() > 10*Point&& BreakEven>0)
               {
                OrderModify(OrderTicket(), 0, OrderOpenPrice(), 0, 0,0) ;
               }
            }
         }
      }
    
    //+------------------------------------------------------------------+
    //+------------------------------------------------------------------+
    
     
    anuj71 #:

    Can you explain the strategy and logic. I have tried my best to understand and translate to English. here is English Translated code but still strategy is unclear. 

    I do not know ... you quoted the post with codes which were created 20 years ago (in 2005) ...
     

    Forum on trading, automated trading systems and testing trading strategies

    Scalping system

    Sergey Golubev, 2025.11.22 07:45

    Automating Black-Scholes Greeks: Advanced Scalping and Microstructure Trading

    Automating Black-Scholes Greeks: Advanced Scalping and Microstructure Trading

    We move beyond theoretical exposition and into implementation. Furthermore, we will cover how to systematically calculate Greeks in an algorithmic environment, integrate them into your MetaTrader 5 Expert Advisor framework, and use them as real-time triggers for scalping and microstructure strategies. We’ll explore how Delta and Gamma can be used not just for hedging but as powerful input signals in high-frequency contexts: identifying ultra-short-term liquidity shifts, and automating precise entries and exits in fast‐moving markets.