I need help, I am building EA that will open reverse trade with increase SL and TP and profit targeting per order.
-
Greetings everyone,
I am trying to build EA that will open a new order and target profit, by closing half of the profits at the same time (leaving 50% of it running), and if the trade close on loss, let it open new order in reverse and increase the SL and TP pips by x %.
For example, if the trade is buying at 50pips SL and 50pips TP, once it trades up to 25 pips TP let it take the 25 pips and increase the TP to 50pips while remaining on the trade till it closes in loss, and then open reverse order by increasing from 50pip/current SL to x% and the TP from 50pips/current to x%.
-
@legitimate Ok. Can you share you project's link to take a look at it, please?
-
@l-andorrà Thanks for responding and sorry for my late reply.
Here is the link: https://fxdreema.com/shared/wWGEKWAJd -
@legitimate Ok. I'm sure I catch it. Please confirm:
-
You want to close partially an open trade that is 25 pips in profit. Right? That part is not included in your project.
-
The remaining trade moves its TP another 50 pips. This means it will be 100 pips away from its original open price. Correct?
-
If the remaining trade hits the SL then you want a reverse trade (a sell in your example), but I don't understand the new % and TP to be applied. Can toy please provide a numercial example.
-
-
@l-andorrà said in I need help, I am building EA that will open reverse trade with increase SL and TP and profit targeting per order.:
@legitimate Ok. I'm sure I catch it. Please confirm:
-
You want to close partially an open trade that is 25 pips in profit. Right? That part is not included in your project.
-
The remaining trade moves its TP another 50 pips. This means it will be 100 pips away from its original open price. Correct?
-
If the remaining trade hits the SL then you want a reverse trade (a sell in your example), but I don't understand the new % and TP to be applied. Can toy please provide a numercial example.
just help me with this;
I need help on this, I want the EA to open every new order with extended SL and
TP whenever the last position closes on the stop loss.
For example, if buying with a SL of 10pips and 10pips of TP, and the trade ends up in loss, le it open the next with a higher SL = 20 and TP =20 kind of.project link: https://fxdreema.com/shared/wWGEKWAJd
Thanks in advance.
-
-
@legitimate Can you please confirm my first two questions are right or wrong?
-
@l-andorrà they are right.
-
Ok. Then let's move step by step. In order to get whatI asked in questions 1 and 2 you need this on the 'on tick' tab:

An this on the 'on trade' tab:

Once included in your project, we can focus on question 3.
-
@l-andorrà said in I need help, I am building EA that will open reverse trade with increase SL and TP and profit targeting per order.:
Ok. Then let's move step by step. In order to get whatI asked in questions 1 and 2 you need this on the 'on tick' tab:

An this on the 'on trade' tab:

Once included in your project, we can focus on question 3.
Greetings sir, I have included them, https://fxdreema.com/shared/GGffw17Vb
great thanks.For number 3 "If the remaining trade hits the SL then you want a reverse trade (a sell in your example), but I don't understand the new % and TP to be applied. Can you please provide a numercial example.",
it is just to extend/modify stops of SL&TP of the new reverse position,
if it were buying at 50pips SL and 50pips TP and then hit the stop loss, lt should then sell with new stops extend by say 50% of old trade, that means the new stops will be 75pips each SL/TP.
Regards. -
@legitimate But I don't understand what criteria are used exactly to calculate that % of the old trade. Is it applied after of before the previous trade is partially closed? I mean, is it applied exactly in the same way no matter what happens to the previous trade?
-
@l-andorrà said in I need help, I am building EA that will open reverse trade with increase SL and TP and profit targeting per order.:
@legitimate But I don't understand what criteria are used exactly to calculate that % of the old trade. Is it applied after of before the previous trade is partially closed? I mean, is it applied exactly in the same way no matter what happens to the previous trade?
Greetings sir,
it is applied after the previous trade is fully closed by hitting stops loss.
-
@legitimate Ok. But is the same % applied if the previous trade is partially closed when it is not? Take profit is moved after it is partially cloed. Does it modify the percentage?
-
@l-andorrà said in I need help, I am building EA that will open reverse trade with increase SL and TP and profit targeting per order.:
@legitimate Ok. But is the same % applied if the previous trade is partially closed when it is not? Take profit is moved after it is partially cloed. Does it modify the percentage?
I don't understand the question, please, rephrase.
-
@legitimate If the original trade has a 50 pips TP and price moves 25 pips in profit, 50% of the trade is closed and TP is moved an additional 50 pips distance. Correct?
Well, that percentage to apply will not be the same is the original trade hits SL BEFORE being partially closed than after. Correct? The lot size will be simply different in one caso or the other, if I understand it correctly.
-
@l-andorrà said in I need help, I am building EA that will open reverse trade with increase SL and TP and profit targeting per order.:
@legitimate If the original trade has a 50 pips TP and price moves 25 pips in profit, 50% of the trade is closed and TP is moved an additional 50 pips distance. Correct?
Well, that percentage to apply will not be the same is the original trade hits SL BEFORE being partially closed than after. Correct? The lot size will be simply different in one caso or the other, if I understand it correctly.
Yes.
-
@legitimate Ok. Then what percentages are applied in each case?
-
@l-andorrà said in I need help, I am building EA that will open reverse trade with increase SL and TP and profit targeting per order.:
@legitimate Ok. Then what percentages are applied in each case?
10% for SL and 150% for TP. Thanks.
-
@legitimate Obviously we are not understanding each other.
Let me asi it this way: is that 10% exactly the same AFTER or BEFORE the original trade hits the TP?