PureBytes Links
Trading Reference Links
|
Here's the el code for 3 different postings re: "choppiness index".
Don't have the ela files...I believe there's a "Choppiness Index"
available at Omega site too. I can't vouch for any of them but Dave
DeLuca's code should be good
Regards,
Bill Vedder
**********************************************************
No.1
{ChopinessIndex Function}Input: Length(NumericSimple);
Var: n(0), true_high(0), true_low(0), tr_rang(0), sum(0), n_high(0),
n_low(0), n_range(0), ratio(0), log_ratio(0), log_n(0);
n = length;
true_high = @Maxlist(high, close[1]);
true_low = @MinList(low, close[1]);
tr_rang = true_high - true_low;
sum = @summation(tr_rang, n);
n_high = @highest(true_high, n);
n_low = @Lowest(true_low, n);
n_range = n_high - n_low;
ratio = sum/n_range;
log_ratio = Log(ratio);
log_n = Log(n);
ChopinessIndex=100*log_ratio/log_n
{ChopinessIndex Indicator}
Input: Ndays(14);
Plot1(ChopinessIndex(NDays),"Plot1");
Plot2(50,"Plot2");
IF CheckAlert Then Begin
IF Plot1 Crosses Above Plot2 or Plot1 Crosses Below Plot2
Then Alert = TRUE;
End;
***************************************************************
No.2
{
Function: ChoppinessIndex
}
Input: Length(NumericSimple);
Var: n(0), true_high(0), true_low(0), tr_rang(0), sum(0), n_high(0),
n_low(0), n_range(0), ratio(0), log_ratio(0), log_n(0);
if currentbar = 1 then begin
n = length;
end;
true_high = @Maxlist(high, close[1]);
true_low = @MinList(low, close[1]);
tr_rang = true_high - true_low;
sum = @summation(tr_rang, n);
n_high = @highest(true_high, n);
n_low = @Lowest(true_low, n);
n_range = n_high - n_low;
ratio = sum/n_range;
log_ratio = Log(ratio);
log_n = Log(n);
IF CurrentBar <= length then ChopinessIndex = 50
ELSE ChopinessIndex=100*log_ratio/log_n
{
Indicator: Choppiness Index
}
Input: Ndays(9), avgLen(6);
IF Currentbar>=1 then begin
Plot1(ChopinessIndex(NDays),"Plot1");
Plot2(50,"Plot2");
Plot3(xaverage(chopinessINdex(nDays), avgLen),"Plot3");
end ;
{*}
Good trading.
Dave DeLuca
***************************************************************
***************************************************************
No. 3
{
==========
User Function "Choppy"
Code By Pierre Orphelin
www.sirtrade.com
}
inputs:tim(numericseries);
vars:timm(0),k(0);
timm=ceiling(tim);
value1=truerange;
value2=0;
for k=1 to timm begin
value2=value2+value1[k-1];
end;
value10=truehigh;
value11=truelow;
value3=highest(value10,timm)-lowest(value11,timm);
if value3<>0 then begin
value4=value2/value3;
end else begin
value4=0;
end;
if value4>0 then begin
value5=log(value4);
end else begin
value5=0;
end;
value6=log(timm);
if value6<>0 then begin
value7=100*value5/value6;
end else begin
value7=0;
end;
choppy=value7;
***************************************************************
shawnh@xxxxxxxxxxxxxxx wrote:
> Hello all..
> Does anyone happen to have the Easy Language code for Bill
> Dreiss' Choppiness Index?
>
> Thanks!
> Shawn
|