"and this is not possible, cause the highest period is 900...after 900 bars back all other bars should be ignored, or have I missed something?"
For me, what indicator does, is totally wrong...all the cci calculation needs only an "n" period time determined by user...
so you said "The indicator (CCI) will calculate values for all 500.000 bars" and I would ask you, is there a method for calculate only 900+1 bars back instead? Just for bypass this useless calculation.
Here is a metatrader 4 example for that.
It will collect all the prices (but it is not a looping job) and will calculate only the required number of bars (so that is the case what you are looking for). To see a line at all set the number of bars to calculate to 2 since in the case of just 1 bar calculation you will have to wait till a new bar comes in to make the line visible, but in the data window you will see that the correct CCI value is there
Trend alexcud CCI + alert
Small variation to trend alexcud...instead of moving averages, it calculates multi tf cci at typical price.
(alerts are fixed thanks to mladen!)
So instead of simply calling the cci, I need to create it? I cannot declare rates_total array instead?
Just hopping in but this is how probably the calculation you are looking for should be done in metatrader 5. That is the calculation that will not calculate all the bars, but just the necessary ones. Try it out
Metatrader 5 version of CCI simple indicator
Metatrader 5 version of CCI simple indicator. The same as the metatrader 4 version this one too allows limiting the number of bars calculated
Try out this version and let me know what happens. It is using thee "simple" one from the previous post instead of the the built in CCI. Results (as far as calculations are concerned) are the same. I am curious what is the difference in speed (I would like to pinpoint the problem, since I hate the "not knowing" what is happening ) since it seems that we need a lot to learn about metatrader 5 (about what to do and what to expect from it)
a lot of stuff here, thank you...I need to think about how to proceed, but personally I thought it was much simple than this...the best functional way seems to be the creation inside the code of each single indicator needed (the function icustom is really too slow)...
by the way, I love this:
It's really zen!
MA multiple crosses signal
This indicator show the cross of 2 moving averages...
...but you can view up to 4 ma's crosses together (you need to change the 1st input from 1 to 4)
CCI multiple crosses signal
Same job here but with the CCI