Техническое задание
I have found an indicator (MACD) that plots and marks an arrow on the chart when a potential trade should be taken, based on MACD divergence . I want to turn this indicator into an EA. Another words, instead of just sending an alert take the trade based on a certain set of rules. I need to be able to change the indicator also so the EA can allow the independence of changes to the indicator for future improvements. Also to allow changes to the settings of the MACD indicator properties.
Please add comments to identify the sections in the EA file for future easy of identification and for others to be able to work on it if required.
Must work on MT5.
Rules.
When the indicator plots an arrow for a buy or sell signal set the trade on the following:
1. Buy or sell as suggested by the indicator.
2. Entry will be X pips crossing the candle identified as the trade suggestion. Default 2 pips/ticks.
3. Stop will be x pips/ticks from bottom of candle.
4. If price crosses the bottom of the candle before making entry cancel trade suggestion.
5. Enable / disable this option ( hedge option) Once in the trade if opposing trade idea occurs whilst in the trade move stop to entry or close immediately if already in a losing position. Then take the reverse position. This could mean both positions are running concurrently.
6. Automatic trade size based on the candle to x percentage of account size. Default set to 2%. Allow for 0.5% so not just whole numbers.
7. If trade reaches x percentage winning close for profit. Default 5%
8. If in a single day 10% is lost stop for the day.
9. Trade is taken only when divergence is found on two timeframes. Timeframes to be set as a parameter. Eg lower timeframe 1hr and higher timeframe 4hr. if both the same the trade can be taken still. Eg both set to 1Hr.
10. Be able to work out the correct trade size for the different forex pairs due to the pips and also SPX500, Silver and GOLD, NAT GAS and OIL WTI.
Want to be able to run a back test to allow me to test the indicator and based on these results request any changes where not meeting the agreed outline above.
Parameters for EA
1. Alert or trade – send alert or take the trade.
2. Entry Pips above
3. Stop Pips below
4. Profit target percentage of account. Eg 2%
5. Risk set to account size 2% but in multiples of 0.5%
6. Daily risk Cut off set to percentage eg 10%
7. Higher timeframe divergence
8. Lower timeframe divergence. Trade taken on this one.
Please ask for clarification if something is not clear.