Hello Everyone,
I have seen lately that many people have become interested in commercial grid trading systems, such as robominer. Since we seem to lack a general alternative free grid trading EA I decided to program a very short and efficient code that could be used to grid trade any range on any currency pair.The version right now works on four digit brokers only. Of course, this can also be used for long term ranges such as the EUR/CHF and the AUD/NZD. The expert has the following variables :
Lots = 0.1 ; Lot size Traded (advice is to use 0.01 for each 1000 USD traded)
max_trades = 10 ; maximum number of trades
grid_lines = 30 ; Number of lines on the grid
RangeMid = 1.5465 ; Median price of the grid (example for EUR/CHF)
grid_separation = 0.0100 ; Separation between grid lines (in currency points)
TP = 50 ; Take profit
The EA will open a trade on each grid line towards the median price but will only open one trade per grid line until a trade on a separate grid line is opened. That is, if grid line x is touched a trade is opened, if it is touched again, no trade is opened, however, if grid line x+1 is touched and then grid line x is touched again another trade is opened.
... etc, until the number equals grid_lines
+3*gridseparation (open short)
+2*gridseparation (open short)
+1*gridseparation (open short)
median price
-1*gridseparation (open long)
-2*gridseparation (open long)
-3*gridseparation (open long)
... etc, until the number equals grid_lines
This strategy gives good results in wide ranges on several currency pairs like the EUR/CHF or the AUD/NZD. However, this strategy must be used with great care. I attach an image of the 10 year backtest on the EUR/CHF as well as a picture of the trades made. Remember that this EA is NOT meant to be traded in a "set and forget way" but it is more meant to be used as a trading tool to help a trader gather profit from a range. The parameters can be modified to trade any range on any currency pair. The EA is not subject to one minute interpolation errors (due to the 50 pip TP) so backtesting should be reliable.
I hope you like it and modify it to fit all of your needs
Best Regards,
Daniel