fly7680: Asynchronous functions are obviously placed in the queue of other events in the chart, is it possible to view the all message queue of the chart and figure out how much time is left until the function is executed?
Unfortunately MetaQuotes has not provided any MQL functionality for directly handling the chart event queue or interrogating its status.
Changes the symbol and period for the specified graph. The function is asynchronous, that is, it sends the command and does not wait for its completion. The command is added to the message queue of the chart and will be executed after all previous commands have been processed.
Fernando Carreiro thanks for the response!
It's a shame because often with articulated codes it would be helpful to understand this!
Try this approach.
void FreeChartQueue( const long Chart = 0 ) { const color ColorStopLevel = (color)::ChartGetInteger(Chart, CHART_COLOR_STOP_LEVEL); ChartSetInteger(Chart, CHART_COLOR_STOP_LEVEL, ColorStopLevel + 1); while (!IsStopped() && (::ChartGetInteger(Chart, CHART_COLOR_STOP_LEVEL) != ColorStopLevel + 1)) Sleep(0); ChartSetInteger(Chart, CHART_COLOR_STOP_LEVEL, ColorStopLevel); // ChartRedraw(Chart); }
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
Asynchronous functions are obviously placed in the queue of other events in the chart, is it possible to view the all message queue of the chart and figure out how much time is left until the function is executed?
Changes the symbol and period for the specified graph. The function is asynchronous, that is, it sends the command and does not wait for its completion. The command is added to the message queue of the chart and will be executed after all previous commands have been processed.