Once per calling series (in common case - once per tick)
in your first sample your custom indicator will be calculated once and called twice
in your second sample custom indicator will be calculated once too but called once.
One function calling is faster than 2 function callings.
in your first sample your custom indicator will be calculated once and called twice
in your second sample custom indicator will be calculated once too but called once.
One function calling is faster than 2 function callings.
Thanks Stringo.
Every tick explains why it is so slow.
The indicator is capable of calculating only the latest bar. Is there a way of making the rest of the series persistent between ticks, so that only the latest bar needs to be recalculated?
Every tick explains why it is so slow.
The indicator is capable of calculating only the latest bar. Is there a way of making the rest of the series persistent between ticks, so that only the latest bar needs to be recalculated?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
For instance, if I call iCustom() twice in the same tick, will it be much slower than if i call it once, store it, and then use the stored value.
ie
{
if (iCustom(blah, blah, blah) > 10) do this;
if (iCustom(blah, blah, blah) < 10) do that;
}
compared to
{
a = iCustom(blah, blah, blah);
if (a > 10) do this;
if (a < 10) do that;
}
if it calculates once per tick.bar then the first example will be faster, but otherwise the second example will be.
I have written an indicator that is very slow to calculate, so I am trying to improve performance all round!
Cheers,
Charlie