TP location on the opposite side. How is it possible?

Miguel Antonio Rojas Martinez
3934

Hello everyone, thanks for reading and trying to help.

I want to program in an EA trying to replicate details that another EA already does, (I want to do this to learn) and it is about, as the title says, putting the TP in the "opposite place"

This Expert has the logic of creating a BUY and as the price "goes against" (in this case, the price falls), it creates different orders, but the output of that "set" of orders is the TP, and "Weird" is seen when the EA edits the TP of a buy, to a place below your entry price.

Putting martingales or grids has nothing "strange", what I find strange and I want to learn is to put the TP on the opposite side of, where by default, it should go.

I have tried with the ctrade library, editing the position, and with MT4Orders too, but I always get the error "invalid stops" and if it weren't for the fact that I'm seeing it, I'd say it's impossible, but it's obvious that it's possible, because I'm already seeing it. In the following image I will highlight with Red the BUYS whose TP are, in theory, on the "opposite" side how can i achieve that?


thanks for your help I will be very attentive

Files:
TPInverted.jpg  91 kb
Vladimir Karputov
Moderator
302265
Take Profit and Stop Loss are checked relative to the CURRENT price.
Manoj Kumar Sharma
214
Manoj Kumar Sharma  

In the screenshot you provided, for Buy orders, I see the current price is lower than TP.

So no problem.

For Buy orders TP can be above current price and for Sell orders TP can be below current price.


Best regards

Manoj

Vladimir Karputov
Moderator
302265
Manoj Kumar Sharma #:

In the screenshot you provided, for Buy orders, I see the current price is lower than TP.

So no problem.

For Buy orders TP can be above current price and for Sell orders TP can be below current price.


Best regards

Manoj

Price open and price current