Progressive Grid Positionning System (Entry and Exit)

by Dr.Hamdi Boukamcha
Progressive Grid Positionning System (Entry and Exit)
Author: lobev (2010.06.10 10:18)
Downloaded: 5290
Progressive Grid Positionning System (Entry and Exit)   Colibri.mq4 (55.1 Kb) View


This system allows you to progressively enter and exit the market, by allowing you to define several levels.

Basically it first calculates the risk based upon the amount you defined in %.

Then according to this risk and the amount of levels you defined calculates the position size of the different trades to send.

You have two modes to place the exit levels, so it is up to you.

9 comments  To post a new comment, please log in or register


See this Scalper EA

19.10.2011 13:23 cm69

Hello, just to say I am very happy for some encouraging private messages I received. It’s motivating for further developments of this ea. I do not have too much time these days, but It will be very cool if you send me all your suggestions of improvement. Colibri will grow up to become a big bird by inspiring from ideas from every one of us. If you think there is a better way to code some aspects, or an essential functionality to add don’t be shy, just write it :-). I will take a great pleasure to read your ideas. Sharing is always exciting. Have fun dear fellows…


15.06.2010 19:27 lobev

Hello, that’s me again. I know I write a lot, but I receive some requests on MP for a manual for this ea . I will try to give my best to write a functional one. So don’t worry it’s coming soon. For those who are more familiar with MQL4, I think you could start tests on a demo account without waiting anymore like you could learn by trading effectively. Hope you the best


11.06.2010 15:16 lobev




It could not work in backtest like it is designed to work in real trading. That’s why you must open a demo account.

First you analyse the market and its trend and then you decide to enter at different levels. This ea is not designed to work on its own, but to help the investor to enter by steps without risking too much money at the first time. I believe in half-automated trading. Your brain and experience are the most powerful tools you have to my mind, to analyse the markets. But you do not want to be continuously in front of your screen to wait for entry and exit.

So you use this ea to progressively enter the market it is to say the more the trend is confirming the more you are engaged. For exiting you don’t want to lose all your profits so you close your trades by step too.

Regards too


PS : Do not forget to fix the “bug” on demo account by adding a little piece of code see below


10.06.2010 22:23 lobev




10.06.2010 22:00 nanoforex

Progressive Grid Positionning System (Entry and Exit)

example :

you risk *2% of your equity and the system defines (lots are automatically calculated):

4 exit levels

1 buying level

1 stop level for all 4 orders


if all trades loose money the waste amount represent for all 4 orders 2% of equity


You have also so many pôssibilities like :

– defining 10 pending orders levels (a grid for buying/selling progressively)

– defining 4 order types (market/limit/stop/linked orders)

– clean your chart with all those arrows

– try every possibility and enjoy I make the support…

10.06.2010 18:21 lobev

hi excuse me please replace the function (because if you open a demo account without history it won’t work)

// ****************************************************************** //
// ************** Conditions Passage Ordres Remplies ? ************** //
// ****************************************************************** //
bool Condit_Pass_Ord_are_Ok_?()
      double Risque.Résid. = 0, Margin.Lots.Risk = 0;

      // Calcul du risque résiduel pouvant être pris sous forme de lots
      if (OrdersTotal() > 0)      
            // :::::::::::::::: EXPOSITION ::::::::::::::: //
            for (int i = OrdersTotal(); i >= 0; i--)
                  OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

                  // Ne considérer que les ordres déjà en cours
                  if (OrderType() <= OP_SELL) 
                        Margin.Lots.Risk += MathAbs((OrderOpenPrice() - OrderStopLoss()) / Point) 
                                    * OrderLots() * MarketInfo(Symbol(), MODE_TICKVALUE);
            // ---

            Risque.Résid. = Exposition.Maximale - (Margin.Lots.Risk / AccountBalance());

      if (OrdersTotal() == 0) return(true);
      // !!!!!!!!  <END> !!!!!!!! //

      // :::::::::::::::: TEST CONDITION ::::::::::::::: //      
      return(Risque.Résid. > Exposition.Au.Risque);    
10.06.2010 18:09 lobev

HI, sounds interesting indeed. Any chance you can explain more about which are the two modes and to add couple of screenshots?



Screen capture coming soon

just try on a demo account for the moment the following parameters to see the principle :

You can copy and past the following code instead of the previous one

extern string     ________1________                = "********* GEST. - URGENCES *********";
extern bool       FERMER.TOUTES.LES.POSES          = false;    // Close all opened orders
extern bool       FERMER.POSES.ACHETEUSES          = false;    // Close all buy orders
extern bool       FERMER.POSES.VENDEUSES           = false;    // Close All sell orders
extern string     Cible                            = "--- Fermeture Ciblйe ---";
extern string     MAGIC.NUM.POUR.FERM.             = "";       // see below
extern bool       FERMER.POSE                      = false;    // Close a specific order by entering its magic number
extern bool       RUN.ON.INIT                      = false;    // Start ea when placed on chart

               // ############# TRADES-PARAMETRES ############# //
extern string     ________2________                = "*********** PARAM.-ORDRES **********";
// Choix du MODE ENTRY :
extern bool       Afficher.Montant.Perte           = false;    // Show the amount of losses
extern string     INFO.ORDRE                       = "0:Rien 1:Comptant 2:Stop 3:Limite 4:Stop Suiv.";
extern int        Type.Ordre                       = 1;        // Order type you want to send (4 types)
extern string     INFO.ORDRE.2                     = "0:Pas dйpendant ; Si ordre mиre exйcutй -> 1:Exйcuter  2:Effacer 3:Clфturer";
extern int        MagicNum.Ordre.Mиre              = 0;        // Magic number of mother order
extern int        Dйpendance                       = 0;        // Action to do with others orders (Execute/Erase/Close) when mother order is executed
extern string     Mini.Sep                         = "----------";
extern int        Trailing.Stop                    = 0;        // 
extern int        Trail.Entry.Pips                 = 0;        // Level in points at which ea start trailing stops
extern double     Exposition.Au.Risque             = 0.02;     // Risk exposure in %
extern int        Dist.Stop.Min.En.pips            = 50;       // Minimum distance between stop and entry point
extern int        Ecart.Entre.Niveaux              = 50;        // Distance defined between levels
extern string     ________3________                = "-----------------------------------------------------";
extern bool       ACHETER                          = true;    // BUY
extern bool       VENDRE                           = false;    // or SELL

               // ############# GRILLE - OPTIONS ############# //
extern string     ________4________                = "******* CHOIX OPTIONS GRILLE *******";               
extern bool       UTILISATION_GRILLE               = true;    // Security Use Grid : must be set to TRUE
extern string     ________5________                = "-----------------------------------------------------";
extern double     Niveau.De.Protection             = 1.18;        // Stopping price level 
extern double     Prix.Achat                       = 1.28;        // Buying price
extern double     Prix.Vente                       = 0;        // Selling Price

extern string     ________6________                = "-----------------------------------------------------";
// Choose calculation type :
extern bool       Grille.Centrйe.?                 = false;    // Level calculated from Grid Center level or by its boundering levels
// if you choose boundering levels calculation mode :
extern double     Grille.Borne.Sup                 = 1.5;        // Highest level price
extern double     Grille.Borne.Inf                 = 1.45;        // Lowest level price
// if you choose grid center calculation mode :
extern double     Grille.LC.Niv                    = 0;        // Grid center price
extern double     Grille.LC.Pas                    = 0;        // Levels step in points   
// Maximum levels number :
extern double     Grille.Nbre.Niveaux              = 10;        // Levels number

               // ############# EFFACER - TRACES - ORDRE ############# //
extern string     ________7________                = "****** PROCEDURES NETTOYAGE ******";
extern bool       Clean.Trace.Prise.Profit         = true;     // Clean profits arrows
extern bool       Clean.Trace.Stop.Perte           = true;     // Clean stops arrows             
extern bool       Clean.Trace.Entree.Sortie        = false;    // Clean entry arrows

To activate the ea go into tools / global variables / and set $_ACTIVATION_EXPERT_$" to 1
10.06.2010 16:25 lobev

HI, sounds interesting indeed. Any chance you can explain more about which are the two modes and to add couple of screenshots?



Share this article

Leave a comment