DeleJohnson: I've coded an algorithm that can enter multiple trades based on several signals from different indicators. I am now trying to figure out how to close half of my open positions when they've reached a target profit range and then add a trailing stop on the other half of those particular trades that have been closed. Any ideas on how this can be done? The main issue I'm having is when it comes to writing a code that allows the EA to detect when an open order is the other half of a previously closed order. Any advice will be much appreciated.
There are many examples in the CodeBase of different types of trailing stop EAs. Study them and apply them to your own code.

DeleJohnson:
The main issue I'm having is when it comes to writing a code that allows the EA to detect when an open order is the other half of a previously closed order.
A common method is to move the SL to break-even after the partial close.

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
Hi,
I've coded an algorithm that can enter multiple trades based on several signals from different indicators. I am now trying to figure out how to close half of my open positions when they've reached a target profit range and then add a trailing stop on the other half of those particular trades that have been closed.
Any ideas on how this can be done? The main issue I'm having is when it comes to writing a code that allows the EA to detect when an open order is the other half of a previously closed order.
Any advice will be much appreciated.