After publishing for yesterday, I realized that for more indicators needed by the traders. so I decided to make it for four different indicators: RSI, , OBV, Momentum
In the indicator options you can choose the indicator from pull-down menu.
How it works?
- On each bar it finds last 10 higher and lower ( PP ) for the indicator.
- from first bar to 10. it searchs if a is possible
- for each PP it starts searching from the last PP .
- it checks if drawing a possible or not and also it's broken or not
- if it's broken then optionally it shows broken as dotted (or you can option not to see broken lines)
- if it finds a continues then it stops searhing more and draw , this is done by checking angles (I did this to make the script faster, otherwise you may get error because of it needs time more than .2sec)
- the script makes this process for each PP
- then shows the
P.S. it may need 3-10 seconds when you added the script to the chart at first (because of calculations)
Trend lines for CCI:
Trend Lines for Momentum:
You may want to watch how script works (that was made for )
If you still didn't see v2 then visit:
All Comments are welcome..
src = close, len = input(21, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
band4 = hline(75)
band3 = hline(58)
band2 = hline(50)
band1 = hline(42)
band0 = hline(25)
fill(band1, band0, color=color.green, transp=90)
fill(band4, band3, color=color.purple, transp=90)