Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 545
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
Show me how you get both. So far it seems as if we are talking about the same thing.
No, the values are different, I checked.
We throw this script onto the chart:
And we get:
No, the values are different, I checked.
Now I see what we are talking about.
chartHandle is a descriptor of the chart window assigned to the OS. You can use it to address the window from other threads via WinAPI.
idChart is an internal chart identifier assigned by the terminal itself. It can only be used for working from MQL.
It is now clear what we are talking about.
ChartHandle is a chart window descriptor assigned by the OS. You can use it to address the window from other threads via WinAPI.
idChart is an internal chart identifier assigned by the terminal itself. It can only be used to work from the MQL.
Got it, thanks!
It is now clear what we are talking about.
ChartHandle is a chart window descriptor assigned by the OS. You can use it to address the window from other threads via WinAPI.
idChart is an internal chart identifier assigned by the terminal itself. It can only be used from MQL.
So, if you need to address to the window of another open terminal, chartHandle should be used? And how to determine the chart identifier of the specified symbol from the indicator located on the chart of another symbol? For example, I need the indicator located on the EURJPY chart to create an object on the USDJPY chart. How can I define a USDJPY chart identifier?
It means that if you want to refer to the window of another open terminal, you should use chartHandle ? And how to determine the chart ID of the specified symbol from the indicator located on the chart of another symbol? For example, I need the indicator located on the EURJPY chart to create an object on the USDJPY chart. How can I define a USDJPY chart identifier?
I think ChartID() help has an example of enumeration of all terminal charts.
No. It's empty. There's an example in the ChartNext help. Okay, got it. No further questions. Thank you.
So, if you want to access the window of another open terminal, chartHandle should be used?
When working only in MQL, chartHandle is not needed. Such a need may arise when connecting a DLL.
boolObjectCreate(
longchart_id,// chart identifier
stringobject_name,// object name
ENUM_OBJECTobject_type,// object type
intsub_window,// window index
datetimetime1,// time of the first anchor point
doubleprice1,// price of the first anchor point
...
datetimetimeN=0,//time N-point binding
doublepriceN=0// price N-anchor point
);
How to define window index inObjectCreate() function?
It is not defined, it is set.
sub_window
[in] Subwindow number of the chart. 0 means the main window of the graph. The specified subwindow must exist, otherwise the function returns false.
WindowFind
WindowsTotal