lacp.forex:. But how to relate the MagicNumber with the ChartID
There isn't any. An EA on any chart can use any magic number it likes.
- Change EA to use its ChartID as its magic number
- Change EA to create a terminal variable that maps ChartID to magic number.
name=Symbol() + EnumToString( ENUM_TIMEFRAMES(_Period) ) + " cid=" + IntegerToString(ChartID); GlobalVariableSet(name, MagicNumer);

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
The functions ChartFirst and ChartNext allow to know the Chart ID of all open Charts. The ChartClose function allows to close a specific Chart and the corresponding EA.
The OrderMagicNumber function allows to discover which EA is not producing the expected result. But how to relate the MagicNumber with the ChartID in order to close the correct Chart and corresponding EA that is not running properly ?
Thanks.