it is necessary to check the magic, currency pair, as well as change the take profit of an order opened at an average price.
I trade manually. first, I open the first order, set it a take profit. if the price went in the wrong direction, then I open a second order with
the same take profit. and if the price still goes in the wrong direction, I open a third order with the same take profit.
it is necessary that after placing the take profit of the third order, the take profit of the second one is changed by a certain number of points, and the take profit of the
first and third orders remain unchanged.
please write separately both functions for buying and selling.