Tr0sT

Zig Zag High Low

Zig Zag script that uses local minimums and maximums as pivot points . It can be used as a source for pattern recognition.
Hilangkan dari Skrip-Skrip Favorit Tambahkan ke Skrip-Skrip Favorit

Komentar

Does it account for different timeframes?
+4 Jawab
Tr0sT Virking_online
@Virking_online, it uses only "current" timeframe
Jawab
Will this change the final leg after price moves?
+3 Jawab
Tr0sT colibribull
@colibribull, yes, it can
+2 Jawab
Here's the Enhancement I made based on your ZigZag Script.



Thanks again for your help! I love the community... Strength in numbers!

Trade well, and trade Long!

-Anthony
+1 Jawab
Hey, Tr0st! Great indicator...

I'm trying to get the RSI to appear at the Pivot highs, but I can't figure out how to do it... it's always offset... I'm trying to use the code:

rsiVal = rsi(close, 14)

to get the RSI and

label.new(bar_index, na, text=tostring(rsiVal), color=color.red, textcolor=color.white, style=label.style_label_up, yloc=yloc.belowbar)

to add the label.

Can you help me with the final piece to this puzzle?

Thanks!
Jawab
Tr0sT ocaptain
@ocaptain, use this line as a guidance
line.new(
timeHigh - length, lastHigh,
timeLow - length, lastLow,
xloc.bar_index, color=_li_color, width=2
)

It contains coordinates of pivot points
Jawab
@Tr0sT, Thanks for your response! Yep, I figured out the offset problem with that very line of code you pointed out... Now I just have a problem displaying the right value... I'm trying to make a running variable asking "if the current high is greater than the recorded high, get the RSI. Then when your code prints the line, I print the value of the RSI (14 close) above it but it never matches the value of the built-in indicator.

After your declaration of the 6 var's, I added:

var rsiVal = 0.0
if high > lastHigh
rsiVal := round(rsi(close, 14))

Then under the 'if dirup' line I added this to display the label:

label.new(timeHigh-length, na, text=tostring(rsiVal), color=color.red, textcolor=color.white, style=label.style_label_down, yloc=yloc.abovebar)

It's weird because the value displayed in the label isn't even an RSI value anywhere within the vicinity of the pivot high - I don't know where that value is coming from.

Again, I appreciate your help! -Anthony
Jawab
Tr0sT ocaptain
@ocaptain, you prints current bar's rsi value to previous bar's pivot point
you need to change rsiVal calculation to somethink like this
rsiVal := (rsi(close, 14))(length)
use square brackets around length (TV does not allow to use them in comment)
Jawab
@Tr0sT, Thanks, man! That did it... I also had to move the label line to the next code block because each pivot high was displaying the value of the *previous* pivot high. A few more tweaks to the code and I'll publish it to the community. Take care!
Jawab
Beranda Penyaring Saham Penyaring Forex Penyaring Crypto Kalender Ekonomi Bagaimana Cara Kerjanya Fitur-Fitur Chart Harga Akun Refer seorang teman Tata Tertib Pusat Bantuan Solusi Website & Broker Widget-Widget Solusi Charting Perpustakaan Charting Ringan Blog & Berita Twitter
Profil Pengaturan Profil Akun dan Penagihan Teman yang di refer Koin Tiket Dukungan Saya Pusat Bantuan Ide Terpublikasikan Pengikut Mengikuti Pesan Pribadi Obrolan Keluar