# 4S

4Slopes. hecate
==============
Using 4 smoothed Slopes (not lagging) and checking when they start to decrease (entering the orange zone) we can either get a general idea (although quite chaotic) view or general tendency of all together .
OR
Use them trading the equity in 4 parts. one will be trading on faster movements (faster slope), second slightly slower and the other two slower and slower. Faster ones will be more profitable but more aggressive and risky than the slower ones.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

Want to use this script on a chart?
```study("4S",overlay=false)
c=input(close)

p1=input(75,title="First Slope Period", type=integer, minval=2,maxval=600)
p2=input(150,title="Second Slope Period", type=integer, minval=2, maxval=600)
p3=input(300, title="Third Slope Period", type=integer, minval=2,maxval=600)
p4=input(375, title="Fourth Slope Period", type=integer, minval=2,maxval=600)

slope(a,b)=>(linreg(a,b,0)-linreg(a,b,0)[b])/b

s1 = slope(c,p1)
s2 = slope(c,p2)
s3 = slope(c,p3)
s4 = slope(c,p4)

plot(s1,color=s1>s1[1]?white:s1<s1[1]?orange:na,style=line,linewidth=1)
plot(s2,color=s2>s2[1]?white:s2<s2[1]?orange:na,style=line,linewidth=2)
plot(s3,color=s3>s3[1]?white:s3<s3[1]?orange:na,style=line,linewidth=3)
plot(s4,color=s4>s4[1]?white:s4<s4[1]?orange:na,style=line,linewidth=4)
```