|
another indicator for volatility. code written in tradestation.
CI above 20 considered up trend, CI below 20 considered downtrend, in between considered range.
i use to combine with other indicators to write strategy.
code:
input: length(NumericSeries);
variable: CI(0);
value1 = 100*percentchange(close, length);
value2 = (highest(high, length)-lowest(low, length))/lowest(low, length);
CI = iff(value2=0,0,value1/value2);
CongestionIndex = xaverage(CI, 3); |
|