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.
 
Aleksandr Slavskii #:


Is there any way to make this graph a bit narrower vertically? I can’t seem to do it using the usual methods.

I’ve attached the screenshot.

 
Jewel177 #:

Is it possible to...

Yes, you can.

Comment out the IsChartScale() function

Although it will then be tricky to capture the chart on screen.

 
Aleksandr Slavskii #:

That’s fine.

Comment out the IsChartScale() function

However, you’ll then have trouble capturing the chart on screen.

We’re fixing one thing, but messing up another.)))

I don’t know anything about this at all. I won’t be able to add it myself.

And I take it there’s no way round the problem of capturing the graph later on?

 
Jewel177 #:
We cure one thing, but end up making another worse.)))
Absolutely right.
Jewel177 #:
And as I understand it, there’s no way round the problem of the chart getting stuck later on?

The problem can be solved, but the author (me) hasn’t been working for free for a long time now. Alas.


Have a go with AI – you’ve got nothing to lose except time, but you might pick up a useful skill.

Just click the button and ask the AI to tweak the indicator to your liking. If it messes it up, you can simply download the indicator again from the website.

 
Aleksandr Slavskii #:
That’s absolutely right.

The problem can be solved, but the author(s) haven’t been working for free for a long time now. Alas.


Have a go using AI – you’ve got nothing to lose apart from a bit of time, but you might pick up a useful skill.

Just click the button and ask the AI to adjust the indicator as you need. If it messes it up, you can simply download the indicator from the website again.

Thanks for the advice, I’ll give it a go)
 
Anything is possible.
10-second bars
Files:
 

Just an idea. A function to shift by minutes.

For some expert advisors trading on the M15 timeframe or higher, it might be possible to use the same M15 candles, shifted by a couple of minutes, which would generally help avoid some of the issues that arise when a new bar appears or news is released.

For binary options, this is a whole new, uncharted world.