I wonder in what situation the "chart_id" parameter of the ObjectCreate() function can be useful.
All the examples I have seen so far have this parameter equal to zero.
Can someone give me a little explanation or provide a link where I can see an example of its use when it is different from zero?Thank you very much!!
If you want to create an object on a different chart to which the EA or Indicator is attached, then you will use the ID of that chart.
eg. My indicator may be monitoring a number of symbols and sometimes it may open a new chart of the relevant symbol and place objects on it.
100% understood !! :-)Thank you so much Keith !!
Se você deseja criar um objeto em um gráfico diferente ao qual o EA ou Indicador está anexado, você usará o ID desse gráfico.
por exemplo. Meu indicador pode estar monitorando vários símbolos e, às vezes, pode abrir um novo gráfico do símbolo relevante e colocar objetos nele.
OK... So if 0 means current chart, what number represents another chart? For example... My current chart is EURUSD, and I insert a line with an arrow on GBPUSD. ObjectCreate(0...) would be on EURUSD, so what would be the number I should put for GBPUSDObjectCreate(?...)
You have to find the chart you want.
Perhaps you should read the manual. ChartNext - Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5 How To Ask Questions The Smart Way. (2004) How To Interpret Answers. RTFM and STFW: How To Tell You've Seriously Screwed Up.
For example, my EA draws indicators on other charts. For this I need the chart ID.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.