Trabajo finalizado
Tarea técnica
Looking to see if someone would be willing to code this EA for me, as I have it one I already coded that will trail stop using the step described below but its hardcoded for 3, it doesnt use ATR for SL/TP only external int that are static, but unable to devote more time to improve. This EA will mange all trades I have opened. It will need to set SL and TP for all trades whether at market or pending orders if not set at the time of entering order.
The EA will use the Average True Range Indicator "ATR" to determine SL and TP. There will need to be external int that will allow the period to be set, including external int for SL and TP. Taking the ATR value for the Period and multiplying by value inputted for SL and TP. ex. D1 ATR = 50, Stoploss_ATR = 1.0, Takeprofit_ATR = 3.0, the Stop-loss will be 50 pips and take-profit will be 150 pips.
Another external int that will be used to determine the step for the trailing stop. ex. external int Step_value = 3, Take-profit = 150 pips, Take-profit / Step_value = 50 pips. As price moves in profit the SL will adjust based of hitting 1/3 of TP, 2/3 of TP, and 5/6 of TP. Step 1 would be 1/3 of TP hit and SL will adjust to breakeven+spread. Step 2 would be 2/3 of TP hit and SL will adjust to 1/3 of TP securing profit. Step 3 would be (1/3 of TP / 2) + 2/3 of TP hit and SL will adjust to 2/3 of TP securing more profit.
The step value should not be greater than 5, another example for Step_value. ex. Step_value = 4, Take-profit / Step_value = 37.5 pips, Step 1 would be 1/4 of TP hit adjust SL to Breakeven+spread, Step 2 would be 2/4 of TP hit adjust SL to 1/4 of TP securing profit. Step 3 would be 3/4 of TP hit adjust SL to 2/4 of TP. Step 4 would be (1/4 of TP / 2) + 3/4 of TP adjust SL to 3/4 of TP. - this may need some more detailed explanation.
Below I have some bullet points that reference the paragraphs above.
- EA will not open trades, only manage trades I have opened.
- Manage Any Trade or by Magic Number or by Pair
- Manage Forex, Indices, Futures and Crypto trades (Crypto not Critical)
- Set Stop-loss or Take-profit for open and pending orders, either manually via external int or Average True Range indicator "ATR"
- Use the ATR to gather Stop-loss and Take-profit
- Ability to set the ATR Period - Default D1 -
- Ability to set Stop-loss with ATR value, ex. external int Stoploss_ATR = 1.0
- Ability to set Take-profit with ATR value, ex. external int Takeprofit_ATR = 3.0
- EA will need to be use user input values for Stop-loss and Take-Profit if inputted in Parameters, ex. if external int SL_Pips = 50 & external int TP_Pips = 100; Stop_Loss = SL_Pips & Take_Profit = TP_Pips else use ATR
- EA will need to take Take-Profit and divide by external value, this value will determine the amount of steps for the Trailing Stop-loss. ex. Take-profit = (ATR D1 * 3) = 150 pips, external Step_value = 3, Take-profit / Step_value = 50 pips. Below are two examples of step_value of 3 and 2.
- Step_value =3
- 1/3 of TP move SL to Break-Even+Spread, ex. trade +50 move SL to Break-Even+Spread
- 2/3 of TP move SL to 1/3 of TP, ex . trade +100 move SL to +50
- (1/3 of TP / 2) + 2/3 of TP move SL to 2/3 of TP, ex. trade +125 move SL to +100
- Step_value = 2
- 1/2 of TP move SL to Break-Even+Spread
- (1/2 of TP / 2) + 1/2 of TP move SL to 1/2 of TP.