Indicators: Second Bars - page 2

 
Gerard William G J B M Dinh Sy #:
?

Forum on trading, automated trading systems and testing trading strategies

Expert OnTick not called for every tick, but indicators is.

Stanislav Korotky, 2024.10.08 17:22

The fact that you successfully received all ticks in OnCalculate online during occasional test does not mean that it will can happen every time. I suppose it depends from many factors (number of programs running, CPU load, event queue size). Actually it's a [hidden and therefore undocumented] implementation specific of the terminal which can change in future in different ways. I'd not take it for granted that your program will receive all ticks in OnCalculate.

If I'm not mistaken, I remember similar tests in the past, where according to tick counters, they are skipped by the handlers. I don't have time to search forums for it right now.

Forum on trading, automated trading systems and testing trading strategies

Expert OnTick not called for every tick, but indicators is.

Dominik Egert, 2024.10.08 17:36

Yes, I agree. Alain pointed this out as well, and reposted a post by Renat.

That's why I linked the thread, because it has most details on this topic, as far as I am aware.



 
Ryan L Johnson #:

Unfortunately, indicators that use the OnCalculate() event handler quite often process ticks incorrectly.

Well, that suggests you haven’t actually looked at the indicator’s code.

Ryan L Johnson #:

To be honest, I didn’t write this expert advisor. As the developer has clearly not specified the copyright, please feel free to mention their name if you know who they are.

There’s no doubt the expert advisor was written by AI. It’s far too simple to work properly. It could be used as a visual guide for beginners.


I see that whilst I was asleep, you were all fighting over the truth here. And you lost )))


 
Ryan L Johnson #:

Unfortunately, indicators that use the OnCalculate() event handler quite often process ticks incorrectly. In contrast, here is an expert advisor that uses the OnTimer() event handler. As an added bonus, you can attach other utilities to the custom chart generated by the expert advisor. Please note that the expert advisor does not attempt to process historical ticks, so bars are generated only in the forward direction.

To be honest, I didn’t write this expert advisor. As the developer has not explicitly stated the copyright, please feel free to credit them if you know who they are.

Thank you. Unfortunately, the expert advisor does not draw candlesticks in real time; it only displays closed prices, and there is no trading activity on the chart.