So, you want to develop something but you are not able to use MQL4 help file? Or the online MQL4 documentation?
Since you are obviously not familiar with the concept of documentation, first thing first ==>
- Press F1 in Metaeditor
- When the new window pops up, search for the section called "Object functions" .
- Read (not complicated, short reading)
- docs.mql4.com
So, you want to develop something but you are not able to use MQL4 help file? Or the online MQL4 documentation?
Since you are obviously not familiar with the concept of documentation, first thing first ==>
- Press F1 in Metaeditor
- When the new window pops up, search for the section called "Object functions" .
- Read (not complicated, short reading)
Thanks a lot. But which function can I use to locate the object that my mouse is pointing to?
It would be very nice if you describe your use case so that people trying to help you know what you want.
Getting properties of the object and checking where the mouse is are two different problems.
Search for OnChartEvent in the documentation, this forum and codebase. You will find thousands of examples.
It would be very nice if you describe your use case so that people trying to help you know what you want.
Getting properties of the object and checking where the mouse is are two different problems.
Search for OnChartEvent in the documentation, this forum and codebase. You will find thousands of examples.
Thanks a lot. But which function can I use to locate the object that my mouse is pointing to?
You can search it by name or color
even you can search it by date
You can search it by name or color
even you can search it by date
I have the following. Is it good for a start?
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if ((id == CHARTEVENT_OBJECT_DRAG) && (ObjectType() == OBJ_VLINE)) {"do something"} }
- www.mql5.com
We are not searching by name or date or color .... We are searching by mouse dragging or by clicking.
I have the following. Is it good for a start?
Wow! The documentation though, will prove helpful. Thanks to sender.
I think I got it now. I did not know that the sparam stands for the name of the object.
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if ((id == CHARTEVENT_OBJECT_DRAG) && (ObjectType(sparam) == OBJ_VLINE)) Print("do something"); }
Thank you all
This is the result of running the followng code. Why are lparam and dparam giving zero values?
Result:
(id = 2)(lparam = 0)(dparam = 0)(sparam = Vertical Line 33317)
Code:
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if ((id == CHARTEVENT_OBJECT_DRAG) && (ObjectType(sparam) == OBJ_VLINE)) Print("(id = ",id,")", "(lparam = ",lparam,")", "(dparam = ",dparam,")", "(sparam = ",sparam,")"); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use