Hi,
I need to find Troughs of CCI Indicator using trough function.
I explore and find the issue: points are always troughs if their value are negative.
I attach my testing afl code and the result below
Blockquote i = BarCount;
x = cum(1);
per = 3;
p = 20;
ccip = cci(p);
s1 = ccip;
ps = troughBars(s1,per,1) == 0;
AddColumn(s1,"s1");
AddColumn(pS,"pS");
Filter=1;
Trough function is intended to be used with PRICES that are in almost all cases positive. If you want to (ab)use the function for negative numbers, just add constant large enough so all negatives become positive.
Could you please tell me more detail about this?
As you can see in my result, there are 3260 rows of CCI value and i think possitive and negative numbers have same amount.