because the market closed
Yes, thank you Ahmet. I was able to put that together.
Nevertheless, I'd like to draw my charts for the week while the market is closed - on the weekends. I'm not interfacing with the market, I'm interfacing with the tool, MT5, so it should be programmatically possible to have the tool respond to behaviors I do without checking into the market.
You can see when I draw a line on the chart it's supposed to ask me (with a popup message box) what kind of tool this is and modify the line's description accordingly. None of that should require waiting for the next tick in the market or any information from the market. Thus I must be programming it incorrectly (or MQL5 has a huge design flaw).
I have, however, perhaps fixed the problem, after some troubleshooting. I discovered it wasn't a problem with the code, but rather a problem with my computer. After restarting and placing an Alert command in the OnChartEvent function it started behaving as expected. when I removed the Alert command, it continued to work as expected. I don't know if it was some problem in some cache or what it could have been, but it seems to be working correctly now.
I, unfortunately, still not know how to name the buttons correctly though.
Thanks for your consideration of this issue.
It looks like a forced update to the chart is missing to set the initial flags, but I'm just guessing.
int OnInit() { ChartSetInteger(0, CHART_EVENT_OBJECT_CREATE, true); ChartSetInteger(0, CHART_EVENT_OBJECT_DELETE, true); ChartSetInteger(0, CHART_SHOW_OBJECT_DESCR, true); //--- forced updating of chart properties ensures readiness for event processing ChartRedraw(); return (INIT_SUCCEEDED); }
It looks like a forced update to the chart is missing to set the initial flags, but I'm just guessing.
PS. I guess there is another improvement to this script I don't know how to make: the popup comes up with 3 buttons Yes, No and Cancel I think. I'd rather the buttons say "open" "close" and "cancel" instead but that's just an aesthetics thing...
I'm afraid you are stuck with predefined values only.
I'm afraid you are stuck with predefined values only.
It looks like a forced update to the chart is missing to set the initial flags, but I'm just guessing.
Turns out that did improve the situation. I had another glitch where I'd have to apply the Expert twice before it would recognize drawn lines, and yes, your suggestion fixed that. Thanks!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have some cool MQL5 code I found on this forum somewhere a long time ago.
I've modified it a little bit. It detects when you put a line on a chart, and pops up asking a question about the line.
It works perfectly, except that it doesn't work on the weekends when the market is closed. I don't know why. Can you see why that's happening or suggest anything I can try to get it to produce the popup on the weekends? Thanks!
PS. I guess there is another improvement to this script I don't know how to make: the popup comes up with 3 buttons Yes, No and Cancel I think. I'd rather the buttons say "open" "close" and "cancel" instead but that's just an aesthetics thing...