I am trying to calculate CCI values applied on an Array of Heiken Ashi closing values.
I generate an Array with values taken from the Heiken Ashi closing values
and then to calculate the CCI values of the last 3
The first one generates a value while the other 2 give 0.
Something has to do with the shifting I am getting.
Can someone advise.
I put it bigger in case I need more data or to prevent array out range. It shouldn't really matter as the averaging is done on the first "CCI_Period" elements of the array and shifted for the other 2 values.
Any idea why the first returns a value while the other 2 return 0 ?
I have modified my code as following.
Please provide feedback
Defining the arrays where I story the Heiken Ashi closed values under variables.
double HeikenClose_0; double HeikenClose_1; double HeikenClose_2; extern int CCI_Period=50;
Setting the array equal to the CCI Periods under init()
Performing the following under onTick()
Thank you in advance