Ttm squeeze pro

I found the code for the TTM SQUEEZE PRO indicator on internet.
But it is the Tradingview code. I´m trying to translate the code to afl.
I have now run in to a problem.Processing: TTM Squeeze under

There is one line in the code, see below:
mom = linearreg(close - ma(avg(highest(high, length), lowest(low, length)), ma(close, length)), length, 0);

Does anyone know how to code this in afl?

Best regards,
Leif Axelsson

length = 20;
avg1 = (HHV(H, length)+LLV(L, length)) * 0.5;
avg2 = (avg1 + MA(C, length)) * 0.5;
mom = LinearReg(C - avg2, length);

Many thanks!

Shall try this!


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