Conversion of code from another platform to MT5

 
Hello everyone, everything good?

  I am converting a strategy that I did in ProfitChart.

  I came across the following problem.

  In ProfitChart there are two basic functions that I need to implement here in MT5

   SellToCoverStop (price, price); // Send a Sales Order using Stop
   BuyToCoverStop (price, price); // Send a buyback order using Stop

 

The peculiarity is as follows, in my strategy the exit is the price of the indicator.

Did you understand?



In example 1, a purchase order is opened and the output is just above the upper average.

There is no TAKE or LOS. There is the execution of the order exit when it arrives at the price of the indicator I informed.



How is it possible to get out of an order without having to target TAKE and LOSS?

The output must be according to the indicator.



I tried using:

- Buy
- BuyStop
- BuyLimit
- Sell
- SellStop
- SellLimit
- PositionModify

  Unsuccessfully.



Thank you for your personal attention.