Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1372

 
User_mt5 #:
Can you please tell me
is there any way to subscribe to ticks (event) on the symbols of interest,
so as not to use a high frequency timer?

Catch the OnBookEvent of the required tool, having of course subscribed to the events beforehand

Well by changing the best prices you can see if there will be a new tick

 
Aleksei Stepanenko #:

Option: Hang a nearly empty indicator on each chart of the desired symbol and send CHARTEVENT_CUSTOM from it on tick

A very good variant! Good for Expert Advisors. I've done it, it works great.
Thank you.

I am currently working on a multicurrency indicator.
Although it works, this approach (OnTimer) is far from being perfect...

In fact, we have OnBookEvent but don't have the similar OnTickEvent. Although, it seems - what's easier.
 
Aliaksandr Hryshyn #:

Catch the OnBookEvent of the required tool, having of course subscribed to the events beforehand

Well by changing the best prices you can see if there will be a new tick

Thanks for taking part in the discussion.
This is the first thing I tried. And found out that the applications in the glass have a life of their own - changing the content of the glass is far from always associated with new ticks.
As far as I understood, ticks come by themselves, and applications change by themselves. Sometimes these events coincide, but not always.

I.e., one may use this flow of information as... just noise that may have greater squawk than a regular timer.
Also, there are noticeably more events in the glass than there are ticks. So... I've given up on OnBookEvent for now.

Thanks again!)
 
Hello. How do I get the colour index in the EA? (Get a signal when the colour changes).
 
Oleg Kolesov #:
Hello. How do you get the colour index in an EA? (To get a signal when a colour changes).

When changing the colour of what?

 
Buffers.
 
Oleg Kolesov #:
Buffers.

The buffer should not be caught by the colour, but by the value.

Look at what the buffer outputs when it changes colour.

I.e. Let's say there are two buffers. Red and green.

Output these two buffers via Commen and trace what the buffer shows when it is 'active'. These are numerical values. That's what you interact with them.

 
The colour index of the indicator buffer in the EA?
 
Thank you Nikita.
 
Oleg Kolesov #:
Thank you Nikita.

Just a buffer index) colour can be any colour there.

Have you figured it out?

Reason: