Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version = 4
- //@author = Andre Solbach
- study("New Daily Range", precision=2, overlay=true)
- f_tickSize() =>
- tk = syminfo.mintick
- blockMult = tk < 0.1 and (tk != 0.01 or syminfo.pointvalue < 10 or syminfo.pointvalue * tk <= 1) and (tk != 0.001 or syminfo.pointvalue <= 1) and tk != 0.005 and tk != 0.0001 and tk != 0.0005 and tk != 0.03125 and tk != 0.015625 ? tk == 0.00005 or tk * 100 == 0.00005 ? 2 : 10 : 1
- tk * blockMult
- calcResult_ = 1 / f_tickSize() * sum(high-low, 70) / 70
- calcResult = security(syminfo.tickerid, "D", calcResult_[0] , barmerge.gaps_off, barmerge.lookahead_on)
- other = if timeframe.period != "W" and timeframe.period != "M" and syminfo.ticker != "US30USD" and syminfo.ticker != "GRXEUR" and syminfo.ticker != "BTCUSD" and syminfo.ticker != "BTCEUR" and syminfo.ticker != "EOSUSD" and syminfo.ticker != "USOIL" and syminfo.ticker != "DAX" and syminfo.ticker != "BTCGBP" and syminfo.ticker != "XAGUSD" and syminfo.ticker != "XAGEUR" and syminfo.ticker != "USDWTI" and syminfo.ticker != "UKOIL" and syminfo.ticker != "USDBRO" and syminfo.ticker != "XAGGBP"
- true
- else
- false
- special1 = if timeframe.period != "W" and timeframe.period != "M" and syminfo.ticker != "USOIL" and syminfo.ticker != "XAGUSD" and syminfo.ticker != "USDWTI" and syminfo.ticker != "UKOIL" and syminfo.ticker != "USDBRO" and syminfo.ticker != "XAGGBP"
- special1_ = if syminfo.ticker == "US30USD" or syminfo.ticker == "GRXEUR" or syminfo.ticker == "BTCEUR" or syminfo.ticker == "EOSUSD" or syminfo.ticker == "DAX" or syminfo.ticker == "BTCUSD" or syminfo.ticker == "BTCGBP" or syminfo.ticker == "XAGEUR"
- true
- else
- false
- else
- false
- special2 = if timeframe.period != "W" and timeframe.period != "M"
- special2_ = if syminfo.ticker == "USOIL" or syminfo.ticker == "XAGUSD" or syminfo.ticker == "USDWTI" or syminfo.ticker == "UKOIL" or syminfo.ticker == "USDBRO" or syminfo.ticker == "XAGGBP"
- true
- else
- false
- else
- false
- plot(other ? calcResult : special1 ? calcResult / 10 : special2 ? calcResult * 10 : na, title="Color", color=#FFCB04, transp=100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement