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?
- Questions from Beginners MQL5 MT5 MetaTrader 5
- Standard Library Experts and Indicators
- Am I crazy, or is everyone re-inventing the wheel RE: trailing stop-loss/take-profit?
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