I know that I can do it by pressing a key before and using CHARTEVENT_OBJECT_KEYDOWN to create a flag, but I was just wondering about a different way
GumRai:
I know that I can do it by pressing a key before and using CHARTEVENT_OBJECT_KEYDOWN to create a flag, but I was just wondering about a different way
I know that I can do it by pressing a key before and using CHARTEVENT_OBJECT_KEYDOWN to create a flag, but I was just wondering about a different way
Create an additional Button which when clicked performs the required action.
A variant of sxTed's idea: create a small innocuous button that acts as a toggle. When clicked, the CHARTEVENT_OBJECT_CLICK code doesn't fire. Once you're done, toggle your small button back again.
sxTed:
Create an additional Button which when clicked performs the required action.
honest_knave:
A variant of sxTed's idea: create a small innocuous button that acts as a toggle. When clicked, the CHARTEVENT_OBJECT_CLICK code doesn't fire. Once you're done, toggle your small button back again.
Yes, I think that is the way to go.
Thanks
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I have a situation where I want my code to do something when eg. a trendline is clicked.
I also want to be able to move the line without the code being executed.
My problem is that when I double click to select the line to move it, the first of the 2 clicks activates the CHARTEVENT_OBJECT_CLICK and executes the code.
I can't make a condition that checks whether the object is selected, because the object is not selected until the 2nd click.
I can't think of a work around.
Any ideas?
Thanks