OnChartEvent Mouse Move

 

I wonder why the following code does not make any print, i did think the Mouse Move Event is clear thing, but looks like dont work?

void OnChartEvent(const int id,         // Event identifier  
                  const long& lparam,   // Event parameter of long type
                  const double& dparam, // Event parameter of double type
                  const string& sparam) // Event parameter of string type
  {
   if(id==CHARTEVENT_MOUSE_MOVE)
     {
       Print("moved moved");
     }
 }

Normaly it should print "moved moved" i like to move it move it... but it does not print anything, why?

Is there not a mouse move event for charts? I want to know when the move move over objetcs or anything at which coordinate it is currently and so on, i did think the Mouse Move event is exactly what i need but i wonder now why it does not work?

 
Email Account: Normaly it should print "moved moved" i like to move it move it... but it does not print anything, why?

Did you enable mouse monitoring?

 
William Roeder #:

Did you enable mouse monitoring?

i dont think so, is that needed, if yes how do you make that? 

I did use the mous click event always before without extra activation.

 
Email Account #: i dont think so, is that needed, if yes how do you make that? I did use the mous click event always before without extra activation.

It's in the documentation for the Chart Events types: Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Types of Chart Events

ENUM_CHART_EVENT

ID

Description

CHARTEVENT_MOUSE_MOVE

Mouse move, mouse clicks (if CHART_EVENT_MOUSE_MOVE=true is set for the chart)

ChartSetInteger()

CHART_EVENT_MOUSE_MOVE

Send notifications of mouse move and mouse click events (CHARTEVENT_MOUSE_MOVE) to all mql5 programs on a chart

bool

 

Ok here the code for everybody hoe search the solution:


int OnInit()
  {
//---
ChartSetInteger(ChartID(),CHART_EVENT_MOUSE_MOVE,true);
//--- succeed
   return(INIT_SUCCEEDED);
  }

I am getting now my "moved moved" print and the coordinate where the mouse is, but would it be also possible to get the name of the object on which the mouse hover?

When i change my print statement with adding sparam it just print a zero

Print("moved moved ",sparam);

normally this sparam give me at mouse click the name of the object, is it also possible to get the object name for mouse move?

 
Email Account #: Ok here the code for everybody hoe search the solution: I am getting now my "moved moved" print and the coordinate where the mouse is, but would it be also possible to get the name of the object on which the mouse hover? When i change my print statement with adding sparam it just print a zero normally this sparam give me at mouse click the name of the object, is it also possible to get the object name for mouse move?

You don't seem to be paying attention to the documentation: Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Types of Chart Events

Event

Value of the id parameter

Value of the lparam parameter

Value of the dparam parameter

Value of the sparam parameter

Mouse events (if CHART_EVENT_MOUSE_MOVE=true is set for the chart)

CHARTEVENT_MOUSE_MOVE

the X coordinate

the Y coordinate

The string value of a bit mask describing the status of mouse buttons

 
Fernando Carreiro #:

You don't seem to be paying attention to the documentation: Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Types of Chart Events

ok so you give me your example it say " The string value of a bit mask describing the status of mouse buttons " without understanding this, hoe ever have translate this to english and so on, i guess it does not work to get object names, but instead of telling me it does not work you give me a answer like this, do you dont find yourself that this is not cool answer? i ask myself often where the problem is why people here are always pissed of they dont give good code examples they always say look to documentation as if it is not already the first place where everybody look. in all other codeing forum you get like a gentelman a real usefull answer also with some code often and here people always just say look there and there.

Where is the problem if i am the second million hoe have ask this give your code example give a real answer or dont say anything, at the end every answer will be find in google and help also many other people, so instead of always get pissed of when somebody ask somethink just give usefull answer or nothing.

 
Email Account #: ok so you give me your example it say " The string value of a bit mask describing the status of mouse buttons " without understanding this, hoe ever have translate this to english and so on, i guess it does not work to get object names, but instead of telling me it does not work you give me a answer like this, do you dont find yourself that this is not cool answer? i ask myself often where the problem is why people here are always pissed of they dont give good code examples they always say look to documentation as if it is not already the first place where everybody look. in all other codeing forum you get like a gentelman a real usefull answer also with some code often and here people always just say look there and there. Where is the problem if i am the second million hoe have ask this give your code example give a real answer or dont say anything, at the end every answer will be find in google and help also many other people, so instead of always get pissed of when somebody ask somethink just give usefull answer or nothing.

So, let's see If I get this. I have been answering you and giving you the information, calling attention to the documentation which you have ignored. And now you are complaining that I'm been "uncool" for helping you find the information?

Goodbye and good luck!

 
your second answer was very uncool, because the real answer is just "no its not possible to get object names from mouse move" so a cool and usefull answer would be first that info that its not possible and then you can give your other infos, the way how you answer it is complete useless, you keep the answer open to everybody hoe later see this forum topic will not understand your answer he will still think its maybe possible some way, but the documentation dont show any infos for getting objetc names on mouse move thats why your answer was useless. and mostly the moderrator here give simular answer, they let eveything open they tell you look here and there instead of giving usefull input and then write the useless tips like look here and there.
 
Email Account #: your second answer was very uncool, because the real answer is just "no its not possible to get object names from mouse move" so a cool and usefull answer would be first that info that its not possible and then you can give your other infos, the way how you answer it is complete useless, you keep the answer open to everybody hoe later see this forum topic will not understand your answer he will still think its maybe possible some way, but the documentation dont show any infos for getting objetc names on mouse move thats why your answer was useless. and mostly the moderrator here give simular answer, they let eveything open they tell you look here and there instead of giving usefull input and then write the useless tips like look here and there.

You stated, and I quote: "When i change my print statement with adding sparam it just print a zero normally this sparam give me at mouse click the name of the object",

And I gave the answer by quoting the documentation: "The string value of a bit mask describing the status of mouse buttons"

How insensitive of me! 🙄 🤦‍♂️

But don't worry, I will not be answering any of your future questions.

 
Fernando Carreiro #:

You stated, and I quote: "When i change my print statement with adding sparam it just print a zero normally this sparam give me at mouse click the name of the object",

And I gave the answer by quoting the documentation: "The string value of a bit mask describing the status of mouse buttons"

How insensitive of me! 🙄 🤦‍♂️

But don't worry, I will not be answering any of your future questions.

if you want tell everybody it is possible or not possible but dont waist anybodys time with such useless answer.

Nobody does need such answers like your when he is searching for a solution, tell the people just its possible or not and give the code or dont give the code but tell them what they need to know and dont play the teacher, if you dont want to give real help forget it just, i bet it is not possible but instead of telling its not possible you give such useless comment.

i myself would say it is not possible to get the object name on mouse move but only with reading the coordinate from the mouse and the coordinate from the objects, that is my answer to anybody hoe search such simular solution.