Indicators/Scripts/EAs can draw objects only on the chart (main chart window and subwindows) attached to.
Indicators/Scripts/EAs can draw objects only on the chart (main chart window and subwindows) attached to.
Thanks for helping stringo.
Does'nt understand you can collect information on different currency pairs and not to be able to visualies this info on open chart windows and or open new windows to make visible this info.
Nothing is perfect !
Regards
Erik
I want to do that too .but sadly it immposible
Unless I'm not understanding correctly, it's definitely possible.
When creating an object, you are required to specify the chart ID and subwindow.
bool ObjectCreate( long chart_id, // chart ID string object_name, // object name ENUM_OBJECT object_type, // object type int sub_window, // window index datetime time1, // time of the first anchor point double price1, // price of the first anchor point ... datetime timeN=0, // time of the N-th anchor point double priceN=0 // price of the N-th anchor point );
To get the ChartID, you would cycle through the charts looking for the desired Symbol (and maybe Timeframe) that you want to draw the object on.
long chartID = ChartFirst(); bool isNotEndOfCharts = chartID != -1; while (isNotEndOfCharts) { const string symbol = ChartSymbol(chartID); const int period = ChartPeriod(chartID); // do something chartID = ChartNext(chartID); isNotEndOfCharts = chartID != -1; }
It was not possible using the old MQL4 that did not have a Chart ID parameter. However, it is now totally possible using the modern MQL4+ that does have that parameter and @Alexander Martinez has shown how to do it in his post above. Read the MQL4 documentation for more information: Object Functions - MQL4 Reference
It was not possible using the old MQL4 that did not have a Chart ID parameter. However, it is now totally possible using the modern MQL4+ that does have that parameter and @Alexander Martinez has shown how to do it in his post above. Read the MQL4 documentation for more information: Object Functions - MQL4 Reference

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Regards
Erik