Hello All,
I am using an indicator (CCI) and would like to look back over the previous 10 periods (bars on chart) and determine when its highest value occured.
In other words, look back and check the indicator value for each of the previous 10 periods and then return how many bars have occurred since its highest value over this 10 look back period.
Initially I was going to try the iHighest function but apparently this can only reference the chart not an indicator.
I have written this so far ( which covers the last 5 periods/bars only) but it is far from elegant.
cciMax=MathMax(iCCI(NULL,0,50,PRICE_CLOSE,5),MathMax(iCCI(NULL,0,50,PRICE_CLOSE,4),MathMax(iCCI(NULL,0,50,PRICE_CLOSE,3),MathMax(iCCI(NULL,0,50,PRICE_CLOSE,1),iCCI(NULL,0,50,PRICE_CLOSE,2)))));
Any help welcome,
Chorlton
I am using an indicator (CCI) and would like to look back over the previous 10 periods (bars on chart) and determine when its highest value occured.
In other words, look back and check the indicator value for each of the previous 10 periods and then return how many bars have occurred since its highest value over this 10 look back period.
Initially I was going to try the iHighest function but apparently this can only reference the chart not an indicator.
I have written this so far ( which covers the last 5 periods/bars only) but it is far from elegant.
cciMax=MathMax(iCCI(NULL,0,50,PRICE_CLOSE,5),MathMax(iCCI(NULL,0,50,PRICE_CLOSE,4),MathMax(iCCI(NULL,0,50,PRICE_CLOSE,3),MathMax(iCCI(NULL,0,50,PRICE_CLOSE,1),iCCI(NULL,0,50,PRICE_CLOSE,2)))));
Any help welcome,
Chorlton