// 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

Tomasz
2
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.

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

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

3 Likes

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