Hallo is er iemand hier die een oplossing heeft voor de StandardDev ??? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Feature Poll Description:
For what its worth, I just came up with this indicator that looks just like CCI, except unlike CCI, it's more bounded within the scale that you specify and does not "over react" as the classical CCI. The default scale value of 245 seem to work rather well.
The idea of this indicator is to measure where price is compared to a simple moving average. I display the measured distance from the moving average in terms of the number of standard deviations. As students of statistics know, three standard deviations is 99% of the population, so I map the number of standard deviation onto the scale range by dividing the standard deviation by 3 and multiplying it by the scale, just to make it easier for those who are used to seeing CCI oscillating in between that range.
In the following chart, the indicator has been applied three times to the same subgraph 2, one as length 6, color red with the horizontal lines at 100, twice as length 14, color yellow, one as histogram and one as thick line, with the horizontal lines set at 100 and 200, just for variations.
Similarly, the classical CCI is in subgraph 3, just for your comparison. Subgraph 1 is price plus Bollinger Bands of length 14 and 2 standard deviations.
Code for indicator:
input:
? Price ? ?((h+l+c)/3),
? Length ? (14),
? Scale ? ?(245),
? LineUpper(100),
? LineLower(-100);
plot1(eKamCCI(Price,Length,Scale),"eKamCCI");
plot2(LineUpper,"Upper");
plot3(LineLower,"Lower");
plot4(0,"0");
{ Alert criteria }
if ? ? ?Plot1 crosses over ?LineLower then
? Alert( "CCI crosses over " + NumToStr(LineLower,0) )
else if Plot1 crosses under LineLower then
? Alert( "CCI crosses under " + NumToStr(LineLower,0) )
else if Plot1 crosses over ?LineUpper then
? Alert( "CCI crosses over " + NumToStr(LineUpper,0) )
else if Plot1 crosses under LineUpper then
? Alert( "CCI crosses under " + NumToStr(LineUpper,0) )
else if Plot1 crosses over 0 then
? Alert( "CCI crosses over zero" )
else if Plot1 crosses under 0 then
? Alert( "CCI crosses under zero" );
Code for Function:
input:
? Price (NumericSeries),
? Length(NumericSimple),
? Scale (NumericSimple);
var:
? Sdv(0);
Sdv = StandardDev( Price, Length, 1 );
if Sdv = 0 then
? eKamCCI = eKamCCI[1]
else
? eKamCCI = ( (Price - AverageFC( Price, Length )) / Sdv ) / 3 * scale; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?