Grid King

Grid King

10 November 2018, 11:39
Wim Schrynemakers
1 339

Grid King

Product page:

Grid King takes a new approach to grid trading.  The main focus when developing the EA was safety, by eliminating the margin-call risk which is usually associated with most grid systems on the market.  It also strives to achieve much higher returns than the average grid system, by spreading risk amongst multiple pairs and strategies which all have a limited effect on the account-equity.

The EA has been stress-tested for a period of 18 years and passes all those years succesfully without any high drawdown.

The EA is also already optimized for 13 pairs, and more will follow in the future.  In theory, any pair or market can be optimized for the algorithm.

At the moment, 2 strategies are used for entry:

  • "Volatility breakout" strategy, where the EA will trade in the direction of strong price movements.
  • "Return to Mean" strategy, where the EA will exploit the fact that price always returns to the mean.

Current live results: 

Key Characteristics:

  • very stable growth curve as result of smart averaging techniques
  • "safety first" approach in development
  • optimizable for any market
  • ONLY grid-system on the market that passes 18 years of stress-tests on historical data on multiple pairs
  • fully automatic
  • Not sensitive to spread, commission, or account type, but ofcourse a low spread ECN broker will always work better and is recommended!
  • On-Chart visualisation of TP zones

Parameter List:

  • Running Mode: Here you can choose to run the automatic mode (recommended) for the optimized pairs, or manual setup.  The automatic mode will use automatically the best settings for the optimized pairs and will run both strategies.  You can choose a risk level which will automatically choose the best lotsize for your account. 
    It will basically determine the LotsizeStep based on the pair's historical max DD.  Ofcourse, a lotsize smaller than 0.01lots is not possible, so Low Risk on a 1000$ account will still trade with 0.01lots, even thought that might be higher risk!  (So please follow the accountsize guidelines).

    So for example for EURUSD, the Max Loss allowed is 1770$ (on USD account).
    For Very Low Risk, the lotsizeStep will be 10X 1770 = 17700.  So "first trade" lotsize would be 0.01 until account reaches 17700X2= 35400$
    For Low Risk, the lotsizeStep will be 5X 1770 = 8850.  So "first trade" lotsize would be 0.01 until account reaches 8850X2 = 17700$
    For Medium Risk, the lotsizeStep will be 3X 1770 = 5310.  So "first trade" lotsize would be 0.01 until account reaches 5310= 10620$

    For High Risk, LotsizeStep would be 2X 1770, and for Very High risk, lotsizestep would be 1.5X1770
    You can also choose manual lotsize selection.  When setting the autosettings=OFF -> the EA will use manual selected parameters for entry and grid.  When selecting any other autosettings-mode, the EA will disregard the parameters from the entry and grid section, and will use all pre-optimized  settings for each of the recommended pairs.

  • AutoSafety: This will use the historical max equity drawdown, and maximum drawdown in "pips to calculate the best exit to protect the account in case unprecedented market behavior.
  • Allow autosafety extra room (in% 0-100) before triggering closing of grid: this will give the autosafety grid closing some extra room.  So if the autosafety would normally close the grid at 1000$ equity DD, and you put in this parameter "20", it will close the grid at 1200 instead of 1000$.
  • Run Strategy 1 when using autosettings: enable strategy 1 when running autosettings
  • Run Strategy 2 when using autosettings: enable strategy 2 when running autosettings
  • Portion of Balance to use (0-1: percentage; >1:fixed $/€ amount): Here you can limit the portion of balance to be used by the EA.  A value between 0 and 1 (for example 0.5) will use a percentage of the balance (this case 50%).  A value bigger than 1 will be used as absolute value (so a value  of "10000" would mean the EA will use 10000$/€ from your account for the EA)
  • StartLots: lotsize for the first trade when not using autolotsize
  • autolotsize: enable automatic lotsize calculations based on balance
  • LotsizeStep: the EA will use 0.01lots for every X amount of balance.  For example LotsizeStep=5000 -> lotsize for first trade will be 0.01lots on a 5000$ account, 0.02 on a 10000$ account and so on.
  • Maximum number of trades allowed : Maximum number of open trades (per trade direction)
  • Maximum lotsize for the first trade: Maximum lotsize for the first trade
  • Maximum lotsize for the biggest trade: Maximum lotsize for the biggest trade
  • WaitForNewCandle: the EA will wait until the next candle opens before setting trades
  • RetryFailedTrades: the EA will retry trades that failed (for example during market swap)
  • Entry Mode Selection: Select the entry strategy -> Volatility breakout; Return to the mean or Manual Trading
  • entry trigger based on pips: minimum candle size for entry based on absolute pip-value
  • entry trigger based on ATR: minimum candle size for entry based on ATR
  • Atr Period: ATR Period
  • Atr Timeframe: Timeframe used for ATR
  • MA_Timeframe: Timeframe used for Moving Average
  • MA_Period: Period of Moving Average
  • MA_Price: Applied Price for Moving Average
  • MA_Mode: Mode selction for Moving Average
  • entry trigger based on pips: minimum candle size for entry based on absolute pip-value
  • entry trigger based on ATR: minimum candle size for entry based on ATR
  • Enable automatic grid expansion: This is for the Manual Trading mode.  When disabled, the EA will only put new grid trades when the user manually does it with the on-chart buttons.  When enabled, the EA will also automatically add trades to the grid once the first trade is set by the user.
  • Grid_Timing: Timeframe used for consecutive trades
  • GridStep: Minimum distance between trades
  • GridInitialStep: Minimum distance between first 2 trades
  • TP for first trade: TP for first trade at candle closing
  • flash TP for first trade: TP for first trade at every tick
  • TP for grid trades: TP for open grid at candle closing
  • flash TP for grid trades: TP for open grid at every tick
  • UseFlashTP_HardTP: This will make the EA set HARD TP at  the Flash TP level
  • ExtraPipHardTP: here you can set the number of pips to add to the HARD FlashTP level
  • Grid_Mode: Select how consecutive trades must increase in size
  • Maximum total pips in loss (per 0.01lots) allowed: close all trades when this amount of pips is in negative.  It will look at total pips as if all trades are multiples of 0.01lots.  so if a trade has 10pips on a 0.1lotsize, that would mean 100pips for this calculation.
  • Maximum equity drawdown allowed in €/$: close all trades when this amount of equity is in negative.  The amount is based on a StartLots of 0.01lots for the first trade of the grid.  If you are using bigger lotsize, the value will automatically be adapted internally to your lotsize.
  • Hedge open grid, instead of taking loss, and stop trading: When using this option, the EA will NOT close the grid in case of the maximum allowed equity drawdown, or maximum allowed drawdown in pips is exceeded.  Instead, it will hedge the open trades from the grid to prevent further drawdown.  And the trading will be stopped for that pair. This way, the experienced trader can manage the grid+hedge himself further.
  • Minimum equity (in %) compared to balance: Do not trade (first trade) when equity is below this number.  So for example when you use the default value (70) that means that a pair will not start setting its first trade if equity is lower than 70% of the balance.  This is to protect the account from opening another grid, if there is already a bigger grid open from another pair or pairs.
  • Minimum free Margin (in %) compared to balance: Do not trade (first trade) when free margin is below this number.  So for example when you use the default value (70) that means that a pair will not start setting its first trade if free margin is lower than 70% of the balance.  This is to protect the account from opening another grid, if there is already a bigger grid open from another pair or pairs.
  • NO-GO Correlated Pairs: here you can put the pairs which you would NOT like the pair of the chart to correlate with.  so when one of these pairs have already trades opened, the pair you are trading will not open the first trade in the same direction.  !! THE EA MUST USE THE SAME MAGICNUMBERS FOR DIFFERENT PAIRS FOR THIS TO WORK !!
  • Maximum number of other pairs allowed before starting to trade: this will limit the number of maximum number of pairs that can open trades together.  !! THE EA MUST USE THE SAME MAGICNUMBERS FOR DIFFERENT PAIRS FOR THIS TO WORK !!
  • Magicnumber for strategy A: Magicnumber for "Volatility Breakout" strategy
  • Magicnumber for strategy B: Magicnumber for "Return to the Mean" strategy 
  • comment: Trade comment
  • Draw TP Lines ("false" for faster backtesting..): Draw TP lines on chart
  • Show chart info ("false" for faster backtesting..): show trade info on chart
  • Color TP line ST1: color selection
  • Color Flash TP line ST1: color selection
  • Color TP line ST2: color selection
  • Color Flash TP line ST2: color selection

Recommended Setup:

  • Enable autosettings and run only the optimized pairs
  • run only on H1 timeframe
  • Run only 1 chart for each pair (the EA will run both strategies from 1 chart)
  • Use leverage of 1:300 or bigger.  The EA will need enough free margin from time to time, so a high leverage is necessary.
  • works on all brokers (non FIFO only for now)
  • All account types are ok (standard, ECN, STP, Micro)
  • As with any EA, it is recommended you run it first on a demo account to get to know the trading style of the EA
  • Recommended to run on accounts nominated in EUR or USD for best performance of AutoSafety feature.
  • You can use the  same magic numbers for different pairs.  But the 2 strategies must use a different magicnumber


  • balance > 200$ but < 2000$ -> use cent account!
  • balance >= 2000$ (or 200$ Cent) -> run max 2-3 Low DD pairs
  • balance >= 3000$ (or 300$ Cent) -> run max 2-3 Low DD or 1-2 Medium/High DD pairs
  • balance >= 4000$ (or 400$ Cent) -> run max 4-5 Low/Medium DD  pairs
  • balance >= 5000$ (or 500$ Cent) -> run max 8 Low/Medium DD pairs
  • balance >= 7500$ (or 750$ Cent) -> run any/all pairs
  • Low drawdown pairs: eurjpy, usdchf, audusd, eurchf, audcad
  • Medium drawdown pairs: eurusd, gbpusd, usdjpy, eurcad, audnzd
  • High drawdown pairs: euraud, eurgbp, gbpjpy
  • It is only advised to run "Aggressive" or "Very Aggressive" mode when using only very few pairs (1-3)
  • When running all pairs, "Very Conservative" or "Conservative" mode is advised

How to run backtests:

  • Use tickdata only (90% from a good broker or 99.90% for most accurate results)
  • use fixed spread or variable spread
  • Choose H1 timeframe
  • Choose period (for example 2007-2018)
  • Use default parameters, or set risk settings to your taste.
  • Use EUR or USD as account currency in tests
  • When using Tickdata 99.90% -> use GMT=2 or 3

(Current backtests are attached -> scroll all the way down!)

Doing your own optimizations:

  • Optimization sets are attached to this blog (scroll all the way down)
  • There is a seperate optimization set for each strategy
  • you can use 'control points' for optimization, and then confirm results with tickdata

Grid King Safety explained:

As with all grid systems, the EA will use up margin when opening a grid, and there will be equity drawdown when the grid gets bigger.  The EA survives without any problem 18 years of historical stress-tests, but I believe we should always be prepared for the worst-case-scenario.  So lets assume that the market really goes against our original trade-position, and the grid keeps getting bigger and bigger.  For a normal grid system, that usually means a margin call.  This is the main reason why almost all grid system eventually result in a complete wipe-out of the account.  This is where Grid King makes the big difference.  Grid King runs on (currently) 9 pairs, with each having a maximum historical equity-drawdown of between 10-20% of the account's balance.  The EA is programmed to protect the account from the worst case scenario by killing all trades from a pair, should somewhere in the future, that maximum 18 year historical "equity drawdown" or "total drawdown in pips" be exceeded.  So even if something would happen, that never happened during the last 18 years, you would still only lose between 10-20% of your balance (when using my recommended account setup).  Keep in mind that these events never even happened with Grid King for the last 18 years!  But when it DOES happen in the future, and most grid systems would simply keep on increasing margin-usage and use up all equity, resulting in the complete destruction of your account, Grid King only takes a small loss.  But if market continues to roll like it did the last 18 years, it will be a very smooth ride :-)

The default setting (AutoSafety) will use max historical DD values taken from the 99.90% tickdata tests using variable spread and commission (7$/lot).  They were also tested against Alpari 90% historical data, which is also a very good quality dataset. 

These are the values that will be used automatically for "Maximum total pips in loss (per 0.01lots) allowed" when using AutoSafety:

So Please keep in mind, when using the AutoSafety feature, that you account can handle the potential loss when a rare event should occur that causes the grid to become bigger than historically! For example, when running EURAUD on a USD account, the loss will be around 2100$ when running it at 0.01lots.  So a pair like EURAUD is certainly not advised for small accounts, but I would only recommend it for accounts that are 10K or bigger.  (When using another account currency (like AUD), the EA will use values based on the USD values, converted to that currency.)

Also, what we can learn from this overview, is that GBPUSD for example has the best return VS drawdown ratio.  This means that GBPUSD is likely to recover the fastest from a possible loss.  This list can come in handy when selecting the pairs you want to run on your account.

All these values are based on a lotsize of 0.01lots (for the first trade of the grid) so keep in mind the historical max DD for each pair when chosing it for your accountsize.

You can also choose to disable the autosafety, and use a manual setting here (parameter "Maximum equity drawdown allowed (based on 0.01 startlots!)", and for example set the maximum loss per pair to 1500$.  This will cause some pairs to have some losses in the last 18 years (like eurusd and euraud since their historical DD is bigger than most other pairs), but it is also a good value for keeping your account safe.  With the default settings, none of the pairs would have had a single day of loss in the last 18 years, and like mentioned before, and still safeguard your account for the future.  For a grid trading system, this safety system is unique and will make sure your account can survive all markets.  Make sure to use my recommended accountbalance settings!  Or contact me if you need help with the setup.

Here is a comparison for GBPUSD, without the "dramatic event" and then also "with the dramatic event" using the safety feature:

without any extreme equity drawdown:

When the historical maximum drawdown is exceeded at some point:

As you can see, the 'dent' in the growth curve is no disaster.  These events are not to be "expected" in the future, but it is nice to know that when it DOES happen, your account is still in safe hands.

When having multiple random "worst case scenario's" on multiple pairs, the longterm growth curve will look something like this:

Still a very smooth ride!

When using "1500$" as a max loss for all pairs, it would look like this:

Also still a very smooth growh curve!  However, I would recommend a Max DD in equity of 2000$ for EURUSD and EURAUD, as it will work better for those pairs.

Does this mean the EA can not wipe out your account? Sadly the answer is no.  But only when you don't follow my guidelines regarding accountsize and which pairs to run at what lotsize.  If you would try to run all pairs on a 1000$ account for example, one day it will have a margin call.  But follow my guidelines and there should be no problem... ever!  In case of doubt, ask my help!

Tickdata (90%) historical tests from 2000-2018, minimum lotsize:














All Pairs together:

Chart overview:

21/11/2018: Newly added "Manual Trading" mode:

In this mode, there will be 2 new buttons on the chart: "Open Buy" and "Open Sell".  With these buttons, the user can start trading and start adding grid trades manually.  The EA will NOT run any entry algorithm in this mode, but there is the option to automatically trade the grid once the first trade is opened by the user.  To enable this mode, you must set "Running Mode=manual settings for entry and grid" and then "Entry Mode Selection=Manual Trading".  the EA will use MagicnumberA for all trades.  In this mode, no automatic settings will be used, so make sure you set your grid parameters like you want them to be.

Current Plans for the future:

  • New pairs will be added to spread the risk even more
  • A "conservative mode" will be implemented.  This will mean that all pairs will receive a variation that will have lower historical drawdown (but also lower average profits) so you can run more pairs on a smaller account.

Share it with friends: