log in     sign up for free
 
People avoid looking for good exits because exits do not give them control over the market. However, exits do control something. They control whether you make a profit or a loss, and they control just how big that profit or loss will be. Since they do so much, perhaps they are worthy of a lot more study on the part of most people.
Van K. Tharp
 
 
Home
systems (284)
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD Data
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

eKam CCI

Formula for: TradeStation

indicator


 

 

Views:  2494

Added: May 17, 2007
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: TradeStation, indicator
 
Your Ad Here
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:

Type : Function, Name : StandardDev

inputs:
Price( numericseries ),
Length( numericsimple ),
DataType( numericsimple ) ; { pass in 1 if you are working with the entire
population, and 2 if you are working with a sample and want the Variance for the
population }

variables:
Divisor( 0 ),
SumSqr( 0 ),
Mean( 0 ) ;

StandardDev = 0 ;
Divisor = Iff( DataType = 1, Length, Length - 1 ) ;
if Divisor > 0 then
begin
Mean = Average( Price, Length ) ;
SumSqr = 0 ;
for Value1 = 0 to Length - 1
begin
SumSqr = SumSqr + Square( Price[Value1] - Mean ) ;
end ;
StandardDev = SquareRoot( SumSqr / Divisor );
end ;



Type : Function, Name : eKamCCI

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;



Type : Indicator, Name : eKam CCI

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" );


 





Source: https://www.tradestation.com

 

View similar (indicator for TradeStation):

$%B I
Swing Trader Trendline
Better Volume Indicator
Better Bollinger Bands
Relative Vigor Index
T3
Trend Continuation Factor
Keltner Price
DIMA Averages
Stochastic Momentum Indicator
...
 
 
all formulas for TradeStation
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012