molepy

ORB

Thanks to ChrisMoody for the original script...
Added compatibility with After Hour Market
Added custom period selection
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//Created by user ChrisMoody, with help from Alex in TechSupport and TheLark
//Currently works on Stocks
//Currently works on Forex but only based on the New York Session starting at 1700 East Coast Time
//Futurer Versions will have options to plot sessions bsed on Forex Europe Opening Range , Asia, etc.
// Modified by molepy from here ...
// v1.00 Added Auto Period detection. Excluding Day, Week and Month
// v1.00 Painting Top/Bottom area
// v1.01 Added compatibility with After Hour Market
// v1.02 Change fix period exclusion for parameter selection
// v1.03 Change predefined parameter selection for custom period selection
study(title="ORB", shorttitle="ORB 1.03", overlay=true)

period1 = input(title="Period 1", type=resolution, defval="3")
period2 = input(title="Period 2", type=resolution, defval="15")
period3 = input(title="Period 3", type=resolution, defval="30")
period4 = input(title="Period 4", type=resolution, defval="60")

is_period (ptest) =>
    ptest == period ? 1 : 0

period_flag =
    is_period (period1) +
    is_period (period2) +
    is_period (period3) +
    is_period (period4)

is_newbar(res) => change(time(res)) != 0 

adopt(s) =>
    t = tickerid(syminfo.prefix, ticker, session.regular)
    security(t, period, s, true) 

high_range = valuewhen(is_newbar('D'),high,0)
low_range = valuewhen(is_newbar('D'),low,0)

up = plot(period_flag ? adopt(high_range) : na, color = lime, style=circles, linewidth=4)
down = plot(period_flag ? adopt(low_range) : na, color = #DC143C, style=circles, linewidth=4) 

trans = 75
fill(up, down, color = gray, transp=trans)