scipy - Recreate popular squeeze momentum indicator in python -
i trying recreate in python stock indicator written in tradingview's pine editor. i'm stuck on 1 part, appears taking average of number series.
to recreate this, go through list of sma,
for in sma: mean(mean(highest_high, lowest_low), i)?
the original pine editor code is:
val = linreg(source - avg(avg(highest(high, lengthkc), lowest(low, lengthkc)),sma(close,lengthkc)), lengthkc,0)
also, val in case series? or coefficients?
the code continues display indicator:
bcolor = iff( val > 0, iff( val > nz(val[1]), lime, green), iff( val < nz(val[1]), red, maroon))
i got figured out. source code here https://github.com/mobone/ta-machine/blob/master/indicators/sqz.py
Hi,
ReplyDeleteCan you share the process how to run it...?