koranged:
Have a look in the CodeBase for EAs that apply a trailing stop-loss. That will give you plenty of examples of how to use the OrderModify() function to apply or add a stop-loss to an order.
If a trade has been opened without a stop loss, but later on the necessity to add a stop to the open trade arises, what is the best way to deal with this situation?
Is it to use OrderModify:
and if so, how will the program know if the stop loss has been executed? Is it best practice to just write a function that checks this?
Thanks Keith and Fernando
Thanks.

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
If a trade has been opened without a stop loss, but later on the necessity to add a stop to the open trade arises, what is the best way to deal with this situation?
Is it to use OrderModify:
and if so, how will the program know if the stop loss has been executed? Is it best practice to just write a function that checks this?