Had to take another step back and hence decided to make detection script and here we are :)
▶ Scan which are in trend. This means, series of Highs or lows either in ascending order or descending order.
▶ Draw between each of the in the trend series. For example, if there are 5 high uptrend , draw mXn lines between each of these points.
▶ Select the which is more accurate or stronger. Accuracy is measured by number of candles/wicks touching the line and number of candles which fall outside the line. Stronger will touch more candles and with less overflow.
▶ Remove all lines except the most accurate one for each direction.
At any point of time, you will see upto 4 in this script.
▶ Trendline joining highs in uptrending condition
▶ Trendline joining lows in uptrending condition
▶ Trendline joining highs in downtrending condition
▶ Trendline joining lows in downtrending conditions
The older line will remain until the new one comes through of same type. Hence, you will still be able to see uptrending high and low for downtrending instruments which are created way back!! Also, new replace old ones only if they are more stronger (connect to more with less overflow)
Settings are simple.
User can select preferred Zigzag Length and Search Depth. Higher numbers for these two parameters will present longer term trends whereas lower numbers will display shorter ones.
controlls will allow users to enable/disable specific type of , set color and line style to it.
⬜ Few Examples
▶ Uptrending Market : NASDAQ:NDX
▶ Downtrending Market : NYSE:BABA
▶ Ranging Market : NYSE:PLTR
▶ Custom Candle Source
Added feature to chose custom candle source
Making use of customcandles library methods to derive custom candles. Availalbe candle source options are :
- regular (Regular OHLC candles)
- ha (Heikin Ashi Candles)
- ma (Moving Average Candles)
▶ Historical Trail
Added option to show historical trail of trend lines. Trail will appear as dotted lines with low visibility so that it will not take too much chart space and impact visibility.
▶ Live Stats of nearest trendlines
Live stats are shown for the immediate and nearby trendlines. If the trendline is far away, then it will not be shown. At least two trendlines stats will be shown.
- Added last update status to table - which shows how many bars back the trendline was created.
- Added trend watermark - which shows whether high and low trendlines are in Uptrend, Downtrend, Converging or Diverging Triangles :)
COINBASE:SHIBUSD shows downtrend as nearest two trendlines are both going down.
Whereas COINBASE:DOGEUSD presents converging triangle.
Reach me on telegram: https://t.me/HeWhoMustNotBeNaamed
Join tradingview: https://www.tradingview.com/gopro/?share_your_love=sudh
USDT (TRC20): TCaz4CG9aZyR4jp3Ygf7MESWJPmcJgoep5
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.