Errors, bugs, questions - page 1547

 
Комбинатор:
Now pay attention question - how to make terminal immediately redraw data which was calculated this way?

It draws data from buffers that are not in OnCalculate

OnCalculate has a minimum draw time of 1 minute

Tick indicators draw every tick

 
comp:
It seems that it doesn't.

ChartRedraw will do 100% of the work in four, though.

And it turned out to be OK in five as well.

So ChartRedraw will work fine on both platforms.

 

When CHARTEVENT_CHART_CHANGE arrives, I do a calculation that sometimes lasts a second/evening. If during the calculation, for example, a chart is moved, then after the calculation CHARTEVENT_CHART_CHANGE is called again from the queue.

Is it possible to know during the calculation that there is something in the event queue? Then could it not do a calculation that is no longer relevant, interrupt it and start a new calculation?

For example, if even a very heavy calculation part has a check for IsStopped(), then the closing of the Expert Advisor would be instantaneous, without waiting for the calculation.

Here would be something similar, but not with the event of closing, but with ChartEvent.

 
comp:

When CHARTEVENT_CHART_CHANGE arrives, I do a calculation that sometimes lasts a second/evening. If during the calculation, for example, a chart is moved, then after the calculation CHARTEVENT_CHART_CHANGE is called again from the queue.

Is it possible to know during the calculation that there is something in the event queue? Then could it not do a calculation that is no longer relevant, interrupt it and start a new calculation?

For example, if even a very heavy calculation part has a check for IsStopped(), then the closing of the Expert Advisor would be instantaneous, without waiting for the calculation.

Here would be something similar, but not with the event of closing, but with ChartEvent.


do a second processing thread (in the form of an ms timer, for example)

and exactly there to perform the calculation, provided that the counter flag==XXX is set, incremented at CHARTEVENT_CHART_CHANGE.

Thus, you quickly fetch the entire ChartEvent queue, set a flag and in parallel with this, the timer checks this flag and calculates it.

---

At the same timer, check the value of flag-counter. It is possible to stop the calculation if the current counter value is higher than the value at which the calculation was started. So it is like IsNewChanged

 
o_O:

so you rake the entire ChartEvent queue very quickly, set a flag, and in parallel the timer pulls that flag and calculates it.

Are you saying that ChartEvent and Timer events run in parallel?
 

Service Desk has made this statement

SetIndexBuffer делается однократно на вызове OnInit

Does anyone use SetIndexBuffer not in OnInit and/or repeatedly? In MT4 I use it all the time. In MT5 you can't do this, unfortunately.

 
comp:
Are you saying that ChartEvent and Timer events run in parallel?

even if they are executed sequentially - you are not prevented from using at least this.

you instantly take away the entire ChartEvent and put only one order.

---

about the parallelism of timer and chart events is a pertinent question.

Ask the servicedesk.

 
o_O:

even if they are executed sequentially - you are not prevented from using at least this.

you instantly take away the entire ChartEvent and put only one order.

---

about the parallelism of timer and chart events is a pertinent question.

Ask at Service Desk.

Nobody reads the documentation...

The client terminal sends the generated events to the corresponding open charts. Also events can be generated by charts (chart events) or mql5 programs (custom events). Generation of events of creating and deleting graphical objects on a chart can be enabled or disabled by setting the CHART_EVENT_OBJECT_CREATE and CHART_EVENT_OBJECT_DELETE properties of a chart. Each mql5-program and each chart has its own queue of events, where all new events are stored.

The program receives events only from the chart, on which it is running. All events are processed one by one in the order of receipt. If there is already an event NewTick in the queue or if this event is in the processing state, a new event NewTick is not placed in the queue of the mql5-program. Similarly, if the queue of the mql5-program already contains the ChartEvent event or such an event is being processed, a new event of this type will not be queued. Timer events are handled according to the same scheme - if there is a Timer event in the queue or the Timer event is already handled, a new Timer event is not placed in the queue.

 
Slawa:

Nobody reads the documentation...

Then there's no way to make an event-based calculation interrupt.
 
Slawa:

Nobody reads the documentation...

It's been a long time