RicardoSantos

[RS]Open Price Trail V1

308 visningar
25
308 0
EXPERIMENTAL: updated to use security() function and code cleanup.
Ta bort från favoritskript Lägg till som favoritskript
study(title="[RS]Open Price Trail V1", shorttitle="[RS]OPT.V1", overlay=true)
mode = input("hour")
hourfix = input(19, title="hourfix(at what time is 00h correct):", minval=0, maxval=23)
openprice = mode == "hour" ? valuewhen(minute == 0, security(ticker, "60", open), 0) :
        mode == "day" ? valuewhen(hour == hourfix, security(ticker, "D", open), 0) :
        mode == "week" ? valuewhen(dayofweek == 1, security(ticker, "W", open), 0) :
        mode == "month" ? valuewhen(dayofmonth == 1, security(ticker, "M", open), 0) :
        mode == "year" ? valuewhen(weekofyear == 1, security(ticker, "12M", open), 0) : na

scolor = openprice != openprice[1] ? na : close >= openprice ? green : maroon
p1 = plot(openprice, color=scolor, linewidth=2)

pretracker = nz(tracker[1], openprice[1])
tracker = openprice != openprice[1] ? avg(pretracker, openprice) : pretracker
p2 = plot(tracker, color=gray)
fill(p1, p2, color=gray, transp=80)
Hem Aktie-screener Forex-screener Krypto-screener Ekonomisk kalender Program Hur det fungerar Diagramfunktioner Priser Refer a friend Ordningsregler Help Center Webbsidor och mäklarlösningar Widgets Diagramlösningar Lightweight Charting Library Blogg och nyheter Twitter
Profil Profilinställningar Konto och fakturering Refer a friend Mina kölappar Help Center Publicerade idéer Följare Följer Privata meddelanden Chatt Logga ut