Trabajo finalizado
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Tarea técnica
Dear All,
We are looking for the following using the Awesome Oscillator:
Once indicator at interval close changed from + to – then sell, if it is changed from – to + , then Buy . with TP=SL=50 points (Pips) . , and let us assume that the profit from this deal is X$
Now, need the initial deal size to be adjustable and need the next deal to be modified automatically according to the below rules: All deals should have 50 Pips as TP or SL , but the size should be modified
):
1-If the indicator changed from + to – or from – to + then close the opened deal and open the new deal with following conditions:
2-If the TP achieved, then the next deal should be with the same initial size
3-If the indicator changed before reaching the TP or SL but with + profit, then the next deal also will be with same initial deal size .
4-If the SL achieved, then the next deal should be double the initial size to cover the losses from the first deal and also get the same initial TP value as a profit using the same TP , SL=50 pips , so total profit from 2 nddeal will be 2X$ ,
5-If the indicator changed before reaching the TP or SL, but with – profit (losses), then the next deal should cover the losses from the first deal in addition to the assumed profit from the first deal (X$) using same TP SL=50 Pips , so total profit from this (2 nddeal) will be X$+ the loses from the first deal
And so on for the 3 rdand 4 thand so on deals.
All deals should have 50 Pips as TP or SL , but the size should be modified
Example:
Input:
Pair EURUSD
TP=SL=50 ,
Initial size 0.1
Needed profit (50 pips*0.1) , give 50$
Results:
1-Indicator changed at closed value from + to – at 1.1900 , then sell 1.19 , TP 1.1850 , SL 1.1950
If reach TP before the indicator changed from – to + , then next deal will be also with 0.1 Size lot with same TP=SL=50 pips and will be opened once indicator changed from – to + at the closed of interval
2-Indicatour changed from – to + at 1.1950 , then open a buy position at 1.1950 , then after while the indicator changed from + to – while the value is 1.1975 , then the profit is 25$ and close the deal and open a sell deal with 0.1 size without any change .
3-now assume the first deal opened as buy at 1.19 , then after while indicator changed to – while the loses is -25$ which mean at price 1.1875 , then close the deal and open a new deal with size (0.15) with same SL and TP (50 pips) , so total profit will 75$ and the result from 1 stand 2 nddeal together will be (-25+75=50$) ,
4-Assume the 2 nddeal gave a profit of 25 $ but indicator changed also before reaching the TP , then from first deal we have -25$ 2 nddeal have +30$ , then the third deal size should be modified to cover the 45$ remaining (50-25+30)
And so on so even if we reach 5 or 6 deals before reaching the TP , I need the overall results from all these deals to be 50$)
I should be able to edit the initial deal size , SL , TP , closing the opened position at indicator change ..