Hi Thomaz, Is the below formula based on the Ehler method about dynamic period? is this the adaptive CCI?
Do you have the same adaptive for Stochastic indicator? Thank you in advance for your respond. Best regards, Ismed --- In [email protected], "Tomasz Janeczko" <[EMAIL PROTECTED]> wrote: > > Jerome, > > Built-in CCI does not work with variable period. > You would need to re-implement it using loops or using other functions that > are variable-period enabled to have variable-period version. > > function MeanDev( array, mean, range ) > { > result = 0; > > for( i = LastValue( range ) ; i < BarCount; i++ ) > { > result[ i ] = 0; > // the mean is not 'moving' over the range (outside the loop) > tm = mean[ i ]; > for( j = 0; j < range[ i ] AND ( i - j ) >= 0 AND ( i - j ) < BarCount; j++ ) > { > result[ i ] = result[ i ] + abs( array[ i - j ] - tm ); > } > > result[ i ] = result[ i ]/range[ i ]; > } > > return result; > } > > function VarCCI( array, period ) > { > > SMATP = MA(array,period );//1,2 > > MD = MeanDev( array, SMATP, period ); > > CCIx = (Avg - SMATP) / (0.015 * MD); > > return CCIx; > > } > > n = 20 + 4 * sin( Cum(1) ); // variable period > > Plot(VarCCI(Avg, n),"CCIx",colorGreen,styleLine); > > //Plot(CCI(n),"CCI",colorRed,styleLine); > > > > Best regards, > Tomasz Janeczko > amibroker.com > ----- Original Message ----- > From: "jerome_maeder" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, August 09, 2005 3:37 PM > Subject: [amibroker] adaptative indicator > > > > Hi! > > > > I would like to change the parameter of my indicator ( CCI for > > exemple ) after each bar. For example: > > > > Length = 0; > > Length = Length + 1; > > > > NewCCI = CCI(Length); > > > > Buy = CCI(Length) > 150; > > > > It's just a simple example, do you understand what is my problem? > > Length is an array and it's not possible to use it as a parameter! > > > > Thanks in advance! > > > > Jerome > > > > > > > > > > > > > > > > Please note that this group is for discussion between users only. > > > > To get support from AmiBroker please send an e-mail directly to > > SUPPORT {at} amibroker.com > > > > For other support material please check also: > > http://www.amibroker.com/support.html > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > >
