Hi,
I'm new to python and trying to code a squeeze momentum indicator. When I try to use the linear regression function it throws an error.
This is the formula I'm trying to emulate into python. I've commented out the code that is erroring so I can attach the backtest.
Forumla I want to use:
val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)),
lengthKC,0)
My version:
val2 = stats.linregress(hist['close'][-1] - ((((hist['high'].max() + hist['low'].min()) / 2) + hist['close'].mean() ) / 2), lengthKC)
I'm sure I'm just not understanding what im doing.
Thanks
-Danny