How do I create a function to process each millisecond?

 

Hello! As you know, there are built-in event processing functions in MQL4. For example, such as OnTick() - which processes every tick in MetaTrader 4.

Question: How can I create my own custom function that will process each millisecond? And have it work separately, just like Ontick() ?

PS: I am creating an animation on a chart, and I need my animation to change with the arrival of each new millisecond, not with the arrival of each tick.

 

every millisecond to refresh a frame?
that's 1,000 frames per second, the video card will burn out)

EventSetMillisecondTimer
 
Taras Slobodyanik:

every millisecond to refresh a frame?
that's 1000 frames per second, the video card will burn out...

The thing is that my animation works in the strategy tester without any problems. But as soon as I put it into real time it hangs waiting for a new tick.

 
Taras Slobodyanik:

Every millisecond to refresh the frame?
That's 1,000 frames per second, the video card will burn out)

Okay. I'll give it a try!

 
Yuriy Vins:

The thing is that my animation works in the strategy tester without any problems, but as soon as I put it in real time it hangs waiting for a new tick.

The maximum frequency of the timer function is 15-16 mc.

 
It's not working out so far. I'll have to do some more reading...
 
Can anyone recommend links to video resources where they teach mql-programming in a clear and understandable way?
 
Yuriy Vins:

The thing is that my animation works in the strategy tester without any problems, but as soon as I put it in real time it starts to hang waiting for a new tick.

Well, nothing changes between ticks. Why more often?
 
Yuriy Asaulenko:
Well, nothing changes between ticks. Why do you need it more often?

It's an animation! and i want to program it so that it doesn't depend on tick arrivals at all. and it works even if the market is off and nothing happens. There's still a way to do it...

 
Yuriy Vins:

It's an animation! and i want to program it so that it doesn't depend on tick arrivals at all. and it works even if the market is off and nothing happens. There's still a way to do it...

I've already put it into loops and did everything I could... (((

 
Yuriy Vins:
It's not working out yet. I'll have to read more.

In OnInit() add a line,

EventSetMillisecondTimer(16); 

and in OnDeinit()

EventKillTimer(); 


After that, move call of drawing functions from OnTick() function to OnTimer() function

Reason: