FX:GBPAUD   Paun British / Dolar Australia
//version 1.0
study(title="dayofweek Tool", shorttitle="d t", overlay=true)

highPrice = security(tickerid, 'D', high)
lowPrice = security(tickerid, 'D', low)



isMon() => dayofweek(time('D')) == sunday ? 1 : 0
istue() => dayofweek(time('D')) == monday ? 1 : 0
iswed() => dayofweek(time('D')) == tuesday ? 1 : 0
isthr() => dayofweek(time('D')) == wednesday ? 1 : 0
isfri() => dayofweek(time('D')) == thursday ? 1 : 0


//plot works by combining the isMonday function combined with the price to plot the line for that given condition
h1= plot(isMon() and highPrice ? highPrice: na, title="h1", style=circles, linewidth=1, color=white)
h2= plot(istue() and highPrice ? highPrice: na, title="h2n", style=circles, linewidth=1, color=red)
h3= plot(iswed() and highPrice ? highPrice: na, title="h3", style=circles, linewidth=1, color=white)
h4= plot(isthr() and highPrice ? highPrice: na, title="h4", style=circles, linewidth=1, color=red)
h5= plot(isfri() and highPrice ? highPrice: na, title="h5", style=circles, linewidth=1, color=blue)


l1= plot(isMon() and lowPrice ? lowPrice: na, title="l1", style=circles, linewidth=1, color=white)
l2= plot(istue() and lowPrice ? lowPrice: na, title="l2", style=circles, linewidth=1, color=red)
l3= plot(iswed() and lowPrice ? lowPrice: na, title="l3", style=circles, linewidth=1, color=white)
l4= plot(isthr() and lowPrice ? lowPrice: na, title="l4", style=circles, linewidth=1, color=red)
l5= plot(isfri() and lowPrice ? lowPrice: na, title="l5", style=circles, linewidth=1, color=blue)

fill(h1,l1, color=white, transp=90, title="f1")
fill(h2, l2, color=red, transp=90, title="f2")
fill(h3, l3, color=white, transp=90, title="f3")
fill(h4, l4, color=red, transp=90, title="f4")
fill(h5, l5, color=blue, transp=90, title="f5")


Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.