QB GridEA Documentation
Grid trading systems are automated trading systems that open orders equally at equally distanced price levels. Opposed to other trading systems, these don’t need entry and exit signals, being independent from indicators.
The grid systems are of two types:
– trend grids
– range grids
Trend grids are those systems that open buy orders above the price and sell orders below the price ; these are profiting during trends.
Range grids are those systems that open orders at each level, both above and below the price, simultaneously, buy and sell pending orders.
At initialization, the expert attempts to verify whether there is a grid already open, looking at the currently open and pending orders, and fills up the grid if needed. If there are no orders, it will launch the pending orders according to parameters.
At each price modification, it verifies whether a price level has been broken, and deletes, according to each case, pending levels on the opposite side, placing also new pending levels in the direction of the trend, thus following the movement of the price in real time.
Our grid system is improved with diverse parameter to allow it to work well in a real, not just a theoretical market.
License Email – The email address to which the license has been registered.
License Key – Key
Grid Step – Grid step in pips
Grid Delay – Distance versus the ASK where it lays down the first level
Grid Jump – Count of levels that have to be broken before adding further levels above or below the price
Up Levels – Count of levels to be put above the price
Down Levels – Count of levels to be put below the price
MaxBuyMarketOrders – Maximum number of BUY open orders
MaxSellMarketOrders – Maximum number of SELL open orders
Above Pending Buy – if open Pending Buy above the price.
Above Pending Sell – if open Pending Sell above the price.
Below Pending Buy – if open Pending Buy below the price.
Below Pending Sell – if open Pending Sell below the price.
Lots – The volume of the order, in lots
TakeProfit – Take Profit in pips
StopLoss – Stop Loss in pips
TrainlingStop – Trailing Stop in pips
TrailingSmart – Whether the trailing smart mechanism is used. When this is used, it means to move the TrailingStop like the Trailing Stop.
* Note: In order to test the product, leave blank the License Key and License Email fields.
We draw your attention to the fact that these parameters do not represent a recommendation, rather they are just our observations resulted from long and diversified tests, and we offer them to you in order to understand and be able to set up the system to work according to your requirements.
Grid Step – This parameter may be chosen accordingly to the market volatility. If the market is less volatile, a smaller step should be chosen.
Grid step may be also set in pipettes (e.g. 0.1). If the step is very small this grid can make high volumes and it is recommended to be used when the market is very less volatile, for instance at evening for symbols that are outside the traded symbols at the time (for instance EURUSD during the asian session)
Grid Delay – This parameter has been introduced because orders could not have been opened on levels close to the price, as both above and below the price the broker imposes a Stop Level.
This parameter has to be chosen so that its value in pips to cover the spread and the Stop Level. For instance if the Stop Level is 4 pips and spread is 1.2 pips then the parameter must be at least 5.2 , but it must be set a bit larger, because in the case of many brokers the spread is variable and in the next second it can be 1.3 and in this case the expert won’t be able to put the pending order below the price.
We recommend you to use the following formula : GridDelay = StopLevel + 1.5 * Spread.
Grid Jump – This parameter will tell the expert at how many broken levels it should update the grid. For instance if we set have our grid set a one pip step (GridStep = 1) and the grid set to work as a range (one pending buy and one pending sell on each level), then when the market moves 2 pips in a direction followed by 2 pips in the oopposite direction, in a moment and by consecutive movements, the expert will send to the broker the request to delete 2 pending from the last level on the direction opposite to the break and it will send 2 pendings on a newly created level.
In this case the parameter may be set at 5 (GridStep = 1.0) and when the price will move 5 pips in a direction, the expert will cancel the pending orders on the last 5 levels from the direction opposite to the movement of the price and will add 5 orders on 5 levels in the direction of the trend, so that the number of the sent orders is much smaller than for the case when this paramer would be set to 0.
This setting has been introduced because some brokers are disturbed by sending orders in a very short time interval.
Up Levels & Down Levels – These parameters represent the number of levels above and below the price. This number can’t be unlimited because in a lot of cases the broker will impose a maximum number of orders.
For instance the broker may impose a maximum of 200 orders (pending+market). If we set the grid as range grid (a pending buy and sell on each level), and the grid is symmetric (same number of orders above and below the price) then it means that the maximum number of levels may be 200 /2 = 100, resulting that we cant have more than 50 levels (100/2).
If we have a trend grid and still 200 orders, then it means we will have one order per each level, thus 200/2, meaning 100 up levels and 100 down levels.
If we wish to limit ourselves to a different number the calculation method is the same.
MaxBuyMarketOrders & MaxSellMarketOrders – These settings were introduced to stop the grid in some conditions in order to protect the capital.
For instance: the grid has been set as a range grid and the market got out of the ranging zone (powerful news move the market violently), if we set MaxBuyMarketOrders = 5 and MaxSellMarketOrders=5 then when there will be 5 buy orders open, the expert will delete the pending buy orders on the levels on the grid.
If the maximum number oof buy and sell orders are touched simultaneously, then there won’t be anymore pending levels and the grid won’t be actually a grid anymore.
AbovePendingBuy,AbovePendingSell,BelowPendingBuy & BelowPendingSell – These settings are used to configure the functioning mode as trend grid or range grid.
For Trend Grid, AbovePendingBuy = True, AbovePendingSell = False, BelowPendingBuy = False, BelowPendingSell = True
For Range Grid, AbovePendingBuy = True, AbovePendingSell = True, BelowPendingBuy = True, BelowPendingSell = True
Lots – The volume to be traded at each level
TakeProfit – Take Profit in pips, 0 means inactive
StopLoss – Stop Loss in pips, 0 means inactive
TrailingStop – The value in pips of the TrailingStop, 0 means inactive
TrailingSmart – TrailingSmart is a function that moves the TakeProfit by the number of pips set in the TakeProfit. This setting maximizes the profit when the connection to the broker falls and the market goes in the favorabile direction (it’s useless when the connection to the server is permanent) .
4.1 Range Grids
In order to work with the expert as a range grid we have to start from the price area that we want to cover. This area may be filled, by example, with a maximum number or levels imposed by broker for the maximum number of market/pending orders that can be open simultaneously.
5.2 Trend Grids
At this system the step of the grid is larger than for the range grid and choosing a step too large would make the expert to keep the money locked in the grid.
Our grid system has been adapted as a result of the observations gathered during testing the system on a number of brokers.
We introduced some values like GridDelay to give the possibility to trade with a step smaller than the the GridStep.
You have to choose your broker according to the system and the limitations imposed in order to successfully use the system.
From the tests we observed:
– The grid jumps over levels when the number of levels is too small and the step is also small, and the price jumps over them, so the price moves more than GridStep * UpGridLevels.
– A broker that doesn’t open the pending orders on the levels given by the system, those being executed with slippage, will put you in the impossibility to use the system.
– One has to use the GridJump parameter in order to avoid stressing the broker with pending order management.
– In order to have a middle level of the grid as soon as possible we have to cchoose a broker with low StopLevel and a small spread.
– In order to maximize the profits, alternate the system between range and grid styles.
We recommend that you read our articles from the blog sections about the grids to familiarize yourself with these trading systems.