Hi,
A little further review has uncovered your problem. What you have done is not add in correct referencing of your indicators, these should have the variable 'i' as a reference not a specific bar number.
EG.
This is incorrect.
double cci_1 = iCCI(Symbol(), Period(), CCI_Period, PRICE_TYPICAL, 1);
double cci_2 = iCCI(Symbol(), Period(), CCI_Period, PRICE_TYPICAL, 2);
It should be
double cci_1 = iCCI(Symbol(), Period(), CCI_Period, PRICE_TYPICAL, i+1);
double cci_2 = iCCI(Symbol(), Period(), CCI_Period, PRICE_TYPICAL, i+2);
Cheers,
Hiachiever
Quote:
Originally Posted by hiachiever
One obvious thing is that you are missing a declaration for the number of indicator buffers that you are going to use.
This sits in the first part of init
eg
int init()
{
IndicatorBuffers(2);
.....
}
Give it a go and see if it fixes your problem. Note I haven't fully checked the code, I simply checked for obvious errors.
Cheers,
Hiachiever.
|