Petros

Williams Gator Oscillator

// The Gator Oscillator histogram above zero shows the absolute difference between blue and red lines of Alligator indicator,
// while histogram below zero shows the absolute difference between red and green lines.
//
// There are green and red bars on the Gator Oscillator histograms.
// A green bar appears when its value is higher than the value of the previous bar.
// A red bars appears when its value is lower than the value of the previous bar.
//
// Gator Oscillator helps to better visualize the upcoming changes in the trends: to know when Alligator sleeps, eats, fills //out and is about to go to sleep.
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?
///////////////////////////////////
// The Gator Oscillator histogram above zero shows the absolute difference between blue and red lines of Alligator indicator,
// while histogram below zero shows the absolute difference between red and green lines.
//
// There are green and red bars on the Gator Oscillator histograms.
// A green bar appears when its value is higher than the value of the previous bar.
// A red bars appears when its value is lower than the value of the previous bar.
//
// Gator Oscillator helps to better visualize the upcoming changes in the trends: to know when Alligator sleeps, eats, fills out and is about to go to sleep. 
//
//////////////////////////////////

study("Williams Gator Oscillator", shorttitle="Gator")
smma(src, length) =>
    smma = na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
    smma
jawLength = input(13, "Jaw Length")
teethLength = input(8, "Teeth Length")
lipsLength = input(5, "Lips Length")
jaw = smma(hl2, jawLength)
teeth = smma(hl2, teethLength)
lips = smma(hl2, lipsLength)
jawOffset = offset (jaw, 8)
teethOffset = offset (teeth, 5)
lipsOffset = offset(lips,3)
up = abs (jawOffset - teethOffset)
down = abs (teethOffset - lipsOffset)
cClr1 = up > up [1]  ? green : red
cClr2 = down > down [1]  ? green : red
plot(up, style=histogram, linewidth=1, color=cClr1)
plot(-down, style=histogram, linewidth=1, color=cClr2)