- OnTick() event in any symbol
- EA called for every single ticks
- ICustom not loading - MQL5
Hello incoming ticks vary with market activity you can see tick volumes by using iVolume() function.
- www.mql5.com
Hello incoming ticks vary with market activity you can see tick volumes by using iVolume() function.
There can be thousand of ticks a minute so its normal for it to tick fast.
If you need something slower you can use a timer.
There can be tens to thousands of ticks per minute, depends on the broker's filtering. The three broker's I used averaged 50, 150, and 300 ticks per minute consistently during the London/NY session.
There can be minutes between ticks during the Asian session, think M1 chart. Larger charts, think weekend, market holiday (country and broker specific.) requires knowledge of when your broker stops and starts (not necessary the same as the market.)
If you want once a second or slower use the timer.
There can be tens to thousands of ticks per minute, depends on the broker's filtering. The three broker's I used averaged 50, 150, and
300 ticks per minute consistently during the London/NY session.
There can be minutes between ticks during the Asian session, think M1 chart. Larger charts, think weekend, market holiday (country and broker specific.) requires knowledge of when your broker stops and starts (not necessary the same as the market.)
If you want once a second or slower use the timer.
Thanks William, and thanks Marco again,
I believe my question is not very clear. I certainly do not want to slow it down. I would like to receive all ticks as they receive. But what my
test code shows is that its just a regular interval tick like a heartbeat, which triggers only every one second. I want it to trigger as and when
market changes. Receiving tens or thousand ticks is not a problem. Receiving one only each second is the problem. Following is my code:
void OnTick()
{
Comment("Tick: "+Ask+", counter: "+counter++);
}
counter
is a variable defined. What I expected is to not see counter increases when there are no market movements. Today is Saturday, and I ran the EA,
and the counter keeps on increasing every second. So definitely this does not reflect market movements. And Marco, no it doesn't tick fast.
It just ticks once every second with or without any market event.
Thanks in advance for your support.
Which instrument was that ?
Only Crypto's are active in weekends, a forex chart should not receive any ticks because markets are closed.
What code did you use to monitor it ?
Which instrument was that ?
Only Crypto's are active in weekends, a forex chart should not receive any ticks because markets are closed.
What code did you use to monitor it ?
I used a regular EA that I use for testing. Its saved as an MQ4 and compiled into an EX4.
And the chart is GBPUSD, H1. The code is exactly as I have mentioned above:
void OnTick()
{
// Alert("On Tick called");
Comment("Tick: "+Ask+", counter: "+counter++);
}
This is exactly what I am saying. My OnTick() is called every second with or without any market events. Its not triggered by any market events. Its just a heartbeat every second.
Wow... this is the creepiest thing I've come across here so far. Maybe there's a timer in the EA that makes a call to OnTick.
Wow... this is the creepiest thing I've come across here so far. Maybe there's a timer in the EA that makes a call to OnTick.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use