Even if I have uncheck the "update on every tick" option for an indicator, still, sometimes it updades and the candle is not closed.
Is there something special that I have to do to make it work?
If I refresh the chart, everything is normal and I don't get an alert until the end of the candle, but...
Update on every tick
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
It works fine after reload.Thank you very much for the report. As I understand from your description it always works fine after the reload, is this true? Also, what do you mean by "sometimes", is it possible to reproduce the problem easily or it is quire rare?
I said sometimes because I can't find a rule to reproduce. It's often enough to be annoying.
It's custom indicator, does it matter?
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
In reality the disabled option Update on every tick does not presume calculation only once per bar. It is meant to decrease the computations load and the calculation is performed not on every tick but only when really necessary. Suppose you have an indicator that uses for calculation 2 series and the first one has a lower resolution than the second. If the indicator is calculated only once per bar of the first series, this will be totally wrong as part of higher-resolution second series bars will be missing from the calculation.
There may be other examples where recalculationg several timer per bar is necessary, so please do not suppose that disabling Update on every tick is identical to once-per-bar calculation. If the logic of your indicator or strategy requires calculation once per bar, please use in the code the barstatus reserved word, it can assume the following values:
2 = the closing tick of a bar
1 = a tick within a bar
0 = the opening tick of a bar
So everything within a bar will be calculated once on the close if barstatus = 2 then begin...
There may be other examples where recalculationg several timer per bar is necessary, so please do not suppose that disabling Update on every tick is identical to once-per-bar calculation. If the logic of your indicator or strategy requires calculation once per bar, please use in the code the barstatus reserved word, it can assume the following values:
2 = the closing tick of a bar
1 = a tick within a bar
0 = the opening tick of a bar
So everything within a bar will be calculated once on the close if barstatus = 2 then begin...