You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good afternoon,
Question on mql5 - how do I work with stopLoss and takeProfit triggers?
I send an order, modify it, it is executed and disappears. I am not able to change sl or tp afterwards because OrderSelect has no order found. Then a trigger is triggered and a new order is created which implements StopLoss / TakeProfit automatically.
I send the order, modify it, it is executed and disappears. Then there is no opportunity to change sl, tp - OrderSelect will pop up with an error The order has not been found. Then a trigger is triggered and a new order is created which automatically executes a StopLoss / TakeProfit.
The mql5 ideology consists in opening (changing, closing) a position for the selected symbol after the order triggering. So after the order triggering (if it hasn't led to position closing) we should work with the position. For example, using PositionSelect(). And for changing of stopLoss and takeProfit levels, the position has its own variant of trade request.
Then why does stopLoss not close the position?
Besides, its volume is always equal to 0.10 lots, even after astop loss is reached.
Forux: Тогда почему stopLoss не закрывает позицию? Кроме того ее объем постоянно равен 0.10 лотам, да же после отыгрывания stop loss
And how do you determine that the position is not closed after the SL is triggered and that its volume remains the same?
PositionGetDouble(POSITION_VOLUME);
And do you update the position information as prescribed in the Handbook before using PositionGetDouble(POSITION_VOLUME) again?
If I understood correctly what was meant then yes, doing the following
Try this:
Try it like this:
Thank you very much :)