Hello world, I have written my first trailing algorithm. It inherits from CExpertTrailing and i find that under many circumstances i wish to close a position and not just adjust the tp or sl, is there a way i can close a position from within the my trailing object?
- Opening and Closing Positions - Trade - MetaTrader 5 for iPhone
- Opening and Closing Positions - Trade - MetaTrader 5 for Android
- How to Create an Expert Advisor or an Indicator - Algorithmic Trading, Trading Robots
The standard library classes are difficult to manage if you want to do something not provided.
Please show your attempt (code) if you want coding help.
Alain Verleyen:
The standard library classes are difficult to manage if you want to do something not provided.
Please show your attempt (code) if you want coding help.
i figured it out, i used a
CTrade m_trade;
// and a .. where i wanted to close
m_trade.PositionClose(m_symbol.Name());
although if there is a better way i would like to know.

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