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
Hey!
So I've created an EA that works by looking at a condition at the close of a 4hr candle and if it meets the signal criteria then places TWO OrderSend commands.
The first one I have creates and order with a 1R take profit level. That's fine.
The second order I wish to have a trailing stop loss of 2x the risk level.
With the current criteria, in a long trend there could be multiple positions open so what I'm struggling to do is work out how to code the Trailing Stop Loss for each individual position that is open.
Her'es my current TSL code:
I'm struggling to somehow make each order write it's entry and stop loss values somewhere then for the TSL code to be able to find the open positions and read the values, even if this means 4, 5, 6 or more open positions.
Any advice how to store this data and read back from it?
Many Thanks...