Job finished
Specification
Hello,
I need an Mql5 EA for stocks trading.
The EA must do the following:
Once I attach it to any chart it must:
1. Find if there is an open trade in the symbol If there is not any, do nothing. If there is one open position:
1.1. Find out the entry price.
1.2. Find out the price where the initial stop loss price was and put it in the comment of the position.
1.3. Find out the number of stocks that were bought (lots).
1.4. Calculate the following:
R = (entry price – initial stop loss price)*lots
P = position current profit
With that info. It should continuously oversee the position and manage it in the following way:
Step 1: set take profit price according to the following formula: ((entry price- initial stop loss price)*3)+entry price
If the take profit is already set to that value, then do nothing more in relation to the take profit value.
Step 2: move the stop loss according to these directions:
If P >= R and < R*2 then
Move stop loss to the price resulting from this formula: (4/lots)+entry price;
If P >= R*2 and < R*3 then
Move stop loss to the price resulting from this formula: ((((entry price- initial stop loss price)*lots)*1,5)/lots)+entry price
Please consider that the EA will manage already manually opened positions so it must work taking that into consideration.
It must work in hedging and netting accounts.
The EA must work even if there is some interruption with the server communication, for example, internet failure or MT5 closing. So, it must do all the analysis all over again to determine if there are any in price and carry on with the directions.
I will need the source code.