Trabalho concluído
Termos de Referência
Hello,
the attached EA is a basic trading tool which was created to calculate how many units of an underlying instrument are purchased or sold based on where you put your stop & preset risk parameters on any given trades. Unfortunately and for some unknown reason it does not always calculate the exact TP and also misplaces the SL at times. I have no idea why this is so, but in regards to the TP I assume it has to do with the slippage involved on market orders. Instead of going through the process of recalculating every trade by hand and to make sure that the TP is correctly calculated I want those issues being fixed once and for good. On top I want also the sell side of this EA being slightly modified. Since bids are only displayed on MT4, I want the spread being taken into account of the computing process too.
Here is how the EA works: It uses a vertical line to determine to its right hand side where the high and/or low of a price swing is and beneath or above where the stop is placed. A horizontal line is used as trigger line. When the bid crosses the horizontal line from below a purchasing order is issued and vice versa and the hidden stop is placed 1 tick above/below the area's high/low.
Since there are discrepancies in the calculation of the TP I want to make use only of the real time EXECUTED PRICE as reference!
The TP of a long trade should therefore be calculated as following:
((EXECUTED PURCHASING PRICE - stop) * TakeProfitFactor) + EXECUTED Purchasing Price = TP
The TP of a short trade should therefore be calculated as following:
(EXECUTED Selling Price - spread) -((EXECUTED SELLING PRICE - (stop + spread)) * TakeProfitFactor) = TP
If necessary the TP has to be placed AFTER market entry or being modified, whatsoever is possible and feasible. Instead of me doing it per hand the EA should do it for me automatically!
In regards to the misplacement of the SL I am totally left in the dark. I have not the slightest idea why this is so! It happens totally on a random, unpredictable basis!
Who is willing & able to code this for me!
Many thanks in advance & all the best!