RicardoSantos

[RS]Open Range Breakout V3

Request for DCC/coondawg71
added support for using session.

theres a issue with the session it needs to have the format inverted:
(start-end) to (end-start)
'0000-1500' to '1500-0000'
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title='[RS]Open Range Breakout V3', shorttitle='ORB', overlay=true)
//  Request for DCC
mode = input(title='Mode (1:timeframe, 2:session):', type=integer, minval=1, maxval=2, defval=1)
tf = input(title='Timeframe for open range:', type=string, defval='60', confirm=false)
tf2 = input(title='Timeframe for range capture:', type=string, defval='D', confirm=false)
sess = input(title='Session for mode 2:', type=string, defval='0400-1500')

f_is_new_day(_mode) => _mode == 1 ? change(time(tf2))!=0 : _mode == 2 ? change(time(tf2, sess))!=0 : false

ND_open = f_is_new_day(mode) ? security(tickerid, tf, open) : ND_open[1]
ND_high = f_is_new_day(mode) ? security(tickerid, tf, high) : ND_high[1]
ND_low = f_is_new_day(mode) ? security(tickerid, tf, low) : ND_low[1]

ND_stretch = na(ND_stretch[1]) ? 0 : f_is_new_day(mode) ? (ND_stretch[1]*9 + security(tickerid, tf, (high-open)>=(open-low)?high-open:open-low)) / 10 : ND_stretch[1]

filter_high = f_is_new_day(mode) ? na : ND_high
filter_low = f_is_new_day(mode) ? na : ND_low

filter_high_stretch = f_is_new_day(mode) ? na : ND_high+ND_stretch
filter_low_stretch = f_is_new_day(mode) ? na : ND_low-ND_stretch

fh = plot(title='TR', series=filter_high, style=linebr, color=black)
fl = plot(title='BR', series=filter_low, style=linebr, color=black)
fhs = plot(title='TS', series=filter_high_stretch, style=linebr, color=green)
fls = plot(title='BS', series=filter_low_stretch, style=linebr, color=maroon)
fill(title='Positive Stretch', plot1=fh, plot2=fhs, color=green, transp=50)
fill(title='Negative Stretch', plot1=fl, plot2=fls, color=maroon, transp=50)
RicardoSantos...What's up man...Been a long time. Your Scripts are always on point. Good Job....
Reply
thx man, means a lot coming from you.
Reply
Hey Ricardo. I am using this study on my TradingView account with CQG. Do you have a Thinkscript version by any change? Thanks.
Reply
Change = Chance.
Reply
i dont, but you may feel free to copy/adapt or ask/hire someone to do it.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out