Fib with CCI plotting

// Fibonacci retracement
len = 10;
up = HHV(High, len);
dn = LLV(Low, len);
retrace = (up - Close) / (up - dn) * 100;

// CCI
constant = 0.015;
typical_price = (High + Low + Close) / 3;
tp_sum = Sum(typical_price, len);
tp_avg = tp_sum / len;
mean_deviation = MeanDev(typical_price, tp_avg, len);
cci = (typical_price - tp_avg) / (constant * mean_deviation);

// Mix
plot(cci, color=red);
plot((100 - retrace), colorgreen, linewidth=2);

where I am doing wrong ? Please help

Is this ChatGPT again? You are using functions that don’t exist. Run the code in AFL editor and it will tell you exactly what is wrong

When posting the formula, please make sure that you use Code Tags (using </> code button) as explained here: How to use this site.

Using code button

Code tags are required so formulas can be properly displayed and copied without errors.

@moneyspinners, by the way the CCI (Commodity Channel Index ) calculation is already provided by AmiBroker. Please see the documentation.

3 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.