OPEN-SOURCE SCRIPT

Support Resistance - Dynamic v2

Güncellendi
Hello Traders!

After the addition of "Arrays" to the Pine, I developed new and improved version of Support Resistance - Dynamic script as version 2. In this script Arrays were used. This can be used as Support Resistance tool, also it will be an example for the people who want to learn Array usage in Pine. Many thanks to Pine Team for adding Arrays!


The script finds the Pivot Points and check them in channels if there can be S/R or not, and draws mid line of the channel as S/R line. you can set number of PPs and channel width in the options. Each channel width is optimized dynamically according to Pivot Points. Also you can choose "High/Low" or "Close/Open" as source for Pivot Points.

There is an option for maximum number of S/R levels. S/R levels are found and sorted dynamically and number of S/R lines with enough strength changes dynamically.

Some other options for coloring and line width. (Solid, Dashed or Dotted)

S/R levels are shown in the Labels and Label colors are changed automatically, if S/R line is below the closing price then it's color is Green (as Support), otherwise its color is Red (as Resistance).

Examples:
anlık görüntü

anlık görüntü



Enjoy!
Sürüm Notları
Alerts added.
Sürüm Notları
Color option added for S/R, you can set any color you want ;)
Sürüm Notları
when the market is closed, labels appears on last candles. so I tried to add a condition to check if the market is open/closed and change the location of labels if the market is closed.

if it detects the market is closed then it shows the labels on 100. bars:
anlık görüntü
Sürüm Notları
Added rates between Price and S/R levels into the labels like (3.27%) or (-1.64%)
and now label directions (Up/Down) change dynamically according to the Price
Sürüm Notları
Arrays used for the lines and labels (instead of individual variables)
options added for the label location, if you enter positive numbers (20, 50, etc) then labels are shown on future bars, if you enter negative numbers (-100, -60 etc) then labels are shown on historical bars
round_to_mintick function used
transp removed
options re-organized

Example: Label location = -100 (labels shown on last 100. bar)
anlık görüntü
Sürüm Notları
the code improved
Sürüm Notları
- Upgraded to Pine v5
- get_sr_vals() function fixed
Sürüm Notları
'Support or Resistance Broken' alert added (by user request)
Daily PivotsFibonacci RetracementlonesomethebluePivot PointspivotsupportSupply ZoneSupport and ResistancetrendfollowingtrendtradingVolatility

Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının yazarı komut dosyasını açık kaynak olarak yayınlamıştır, böylece yatırımcılar betiği anlayabilir ve doğrulayabilir. Yazar çok yaşa! Ücretsiz olarak kullanabilirsiniz, ancak bu kodun yayında yeniden kullanımı Ev kurallarına tabidir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?

Feragatname