OnBar() not fired at specified interval
OnBar() not fired at specified interval
02 Oct 2024, 01:22
I'm working on JP225 with ICMarkets.
Noticed OnBar() event not firing at time it supposed to fire.
For example, with 5 minute time frame, time after "2018-06-20 19:00" is “2018-06-20 19:10” which makes me wonder why there is no
“2018-06-20 19:05”.
Also, even when OnBar() event fires, it's not happens at 00 second sharp. Sometime with 10 seconds delay.
Can anyone explain why this happens and is this the design or a bug?
Replies
ys2310
02 Oct 2024, 05:33
RE: OnBar() not fired at specified interval
PanagiotisCharalampous said:
Hi there,
Bars are not time based but tick based. Therefore the OnBar() method will be triggered when the new tick for that time range arrives. So if the tick comes 10 seconds after the previous bar was supposed to be closed, the OnBar method will be triggered with 10 seconds delay. If no tick arrives within that timeframe, then no bar will be formed.
Best regards,
Panagiotis
Hello Panagiotis,
Thank you for your reply. I'm clear now.
What if I want to every 5 minutes event?
@ys2310
PanagiotisCharalampous
02 Oct 2024, 06:03
RE: RE: OnBar() not fired at specified interval
ys2310 said:
PanagiotisCharalampous said:
Hi there,
Bars are not time based but tick based. Therefore the OnBar() method will be triggered when the new tick for that time range arrives. So if the tick comes 10 seconds after the previous bar was supposed to be closed, the OnBar method will be triggered with 10 seconds delay. If no tick arrives within that timeframe, then no bar will be formed.
Best regards,
Panagiotis
Hello Panagiotis,
Thank you for your reply. I'm clear now.
What if I want to every 5 minutes event?
In this case it is better to use a Timer.
@PanagiotisCharalampous
PanagiotisCharalampous
02 Oct 2024, 05:29
Hi there,
Bars are not time based but tick based. Therefore the OnBar() method will be triggered when the new tick for that time range arrives. So if the tick comes 10 seconds after the previous bar was supposed to be closed, the OnBar method will be triggered with 10 seconds delay. If no tick arrives within that timeframe, then no bar will be formed.
Best regards,
Panagiotis
@PanagiotisCharalampous