How do I "draw line" across the spot where I "mouse clicked" on the chart?
-
Hi as the title says, I am trying to make the EA to draw a horizontal line at the point I clicked on the chart.
How should I set Draw Line: Price (1) so that the line draws on the spot I clicked and not where the candle, market, etc?
Thanks...
-
@jacque82 fxdreema doesnt support this natively (easily), but you can rely on the basic mql5 features.
Whenever a chart event (mouse click, mouse move, button press...) happens, some values are recorded to 3 variables: lparam, dparam and sparam. Fxdreema has its own global variables for those: FXD_ONCHART.lparam, FXD_ONCHART.dparam, FXD_ONCHART.sparam.
I created a quick troubleshooting tool to inspect the 3 parameters on chart events. Mixing and matching those will get you that line. Its a bit advanced though. https://fxdreema.com/shared/rybSErSfc
-
@roar awesome!
-
@roar WOW SO COOL!!! Thanks for taking time to explain it and went further in giving an example. Really really appreciate it!
-
@roar Just curious. What is the 'pass' block for?
-
@l-andorrà "pass" will send every chart event to the comment block, not only mouse moves. Without "pass", the EA will not recognize a button press or object creation, for example.
-
@roar Interesting. Thank you very much.
-