RicardoSantos

[RS]Open Price Levels V1

346 0 45
EXPERIMENTAL: fixed some issues, found some more. doesnt work on unconventional resolutions ex:. 240minutes.

Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]Open Price Levels V1", shorttitle="[RS]OPL.V1", overlay=true)
mode = input("week")
hourfix = input(19, title="hourfix(at what time is 00h correct):", minval=0, maxval=23)
openprice = mode == "hour" ? valuewhen(minute == 0, open, 0) :
        mode == "day" ?
            ( isintraday ? valuewhen(hour == hourfix and minute == 0, open, 0) :
            valuewhen(hour == hourfix, open, 0) ) :
        mode == "week" ?
            ( isintraday ? valuewhen(dayofweek == 1 and hour == hourfix and minute == 0, open, 0) :
            valuewhen(dayofweek == 1, open, 0) ) :
        mode == "month" ?
            ( isintraday ? valuewhen(dayofmonth == 1 and hour == hourfix and minute == 0, open, 0) : 
            valuewhen(dayofmonth == 1, open, 0) ) :
        mode == "year" ?
            ( isintraday ? valuewhen(weekofyear == 1 and dayofweek == 1 and hour == hourfix and minute == 0, open, 0) :
            isdaily ? valuewhen(weekofyear == 1 and dayofweek == 1, open, 0) :
                valuewhen(weekofyear == 1, open, 0) ) : na

scolor = openprice != openprice[1] ? na : close >= openprice ? green : maroon
plot(openprice, color=scolor, linewidth=2)
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out