Job finished
Specification
RSI-Grid strategy expert advisor for MT4
Project overview:
Require the coding of a trading expert advisor based off of the following below criteria:
Buy-Sell orders are to be generated based on the RSI indicator, the indicator overbought/oversold settings shall be adjustable, default standard 70/30 settings, length will also be configurable with a default of 14.
The buy orders:
A market buy order will be generated on oversold conditions (RSI=<30) 1 bar close after the condition is met, the number of bars for entry default is 1 bar however this is to be configurable, 3x simultaneous buy limit orders will be generated as a grid formation with the pip step interval of the buy grid to be adjustable, default will be 25 pips between buy limit orders. All trades will have a Stoploss criteria as listed below.
the number of buy grid limit orders by default including the market order is 4 however can be adjusted to a maximum of 10 grid layers.
Once the above RSI conditions is met the condition shall only be re-triggered (new trade/grid placed) after the current trades have either reached there stop loss or take profit as per the criteria below, this is to ensure if the RSI oscillates up and down rapidly multiple grids are not formed/opened.
The only other buy criteria that can occur will be from the manual function see further down in this document.
The sell orders:
As per above however on overbought condition (RSI>70) as opposed to oversold condition shall be the entry criteria for the sell market order and the sell limit grid.
Figure above illustrates the grid orders function for a buy scenario
Account balance function:
The first trade initial risk shall be 0.20% of account balance from the first trade and martingale from there to the bottom of the defined grid. The risk shall be adjustable for the first trade which will dictate the overall risk per trade in conjunction with the martingale multiplier, the default martingale multiplier will be x2.
For example:
Trade 1= 0.20% (entry market order)
Trade 2= 0.40% (buy limit 1)
Trade 3= 0.80% (buy limit 2) 100pips overall default to stop total risk 3%
Trade 4= 1.60% (buy limit 3)
Stoploss= 3%
Stoploss function:
The Stoploss will be default 25pips below OR above the last trade in the grid in which all trades in the grid will close at a loss. This value will be adjustable.
Take profit:
The take profit will be a default 75 pips above the last trade activated ensuring a 1:3 risk reward ratio. The take profit value will be adjustable. All Trades will close in profit when this value is reached
Equity stop%:
All trades will close at loss should an exceedance of 20% be reached on the account balance, this equity stop will be adjustable.
Trading start/stop time:
Trading start and stop times will be based off of the broker terminal time, the default will be for the expert to trade 24HRS a day however the times adjustable as required.
Close on opposite signal:
If this is set to True and a buy order is already open then when a sell signal is generated from the EA the buy orders will be closed and the sell orders-Grid opened, this will also be true for the opposite should a sell trade already be opened.
Auto/Manual function:
Require a toggle between auto and manual operation of the expert advisor, I would like a small graphics display to be located in the top left corner of the MT4 chart window as per below:
The idea of the above function is to be able to turn the EA from auto to manual (ignore the RSI criteria whilst in manual) and give me the ability to open a manual grid buy OR sell if I see price action on the charts I like. The close all trades function will be master and can be used in either auto OR manual conditions and when pressed will close all trades regardless of whether they’re in a loss or profit scenario.
Recap of configurable parameters/EA settings:
RSI settings:
Overbought (sell entry level)= <30 default
Oversold (buy entry level)= >70 default
RSI length = 14 default
---------------------------------------------------------------------------------------
Bars after sell or buy condition is met= 1 bar default
Grid layers: 4 default, maximum of 10 layers
Trade 1 risk= 0.20% default
Martingale multiplier factor * = 2 default
Pips step between orders= 25pips default
Take profit level= 75pips default
Stoploss overall= 100pips default
Equity stop%= 20% default
Trade start time: 00:00:00 Trade stop time: 23:59:00
Close on Opposite signal: False default
Please note: I wish the EA must be able to be back-tested using different grid and RSI settings by adjusting the above configured parameters.
See attachment for further details.
many thanks
Jarrod