TradingView
Shauryam_or
7 Oca 2023 06:40

Orb breakout  

Nifty 50 IndexNSE

Açıklama

Buy condition =>ORB range 9:20-9:25. On 5 min TF if candle breaks high and next candle break high of that candle. buy signal when third candle breaks high of 2nd candle

Sell condition=>ORB range 9:20-9:25. On 5 min TF if candle breaks low and next candle break low of that candle. sell signal when third candle breaks low of 2nd candle

this indicator is extended version of my previous indicator i got a comment request from @RISHISAKHARE to devlope indicator based on above mention rule ....

Yorumlar
BALAJINALINI
Hi Nice one... can we get time alteration ...if we need the range breakout for 9.45AM to 11 AM range need to get a signal
Shauryam_or
@balajipivots, yes you can change input time to 9:45 to 11 am ...it will work check input settings
SaadiCrypto
on which pair it works?
prateekm
Hi, I have a similar code, having some issue possibly pinescript code has been revised to restrict few function calls, do you think you would be able to advise a change here

// Defaults
// Colors
cColor = color.blue
rColor = color.red
sColor = color.green
aColor = color.blue
pcColor = color.rgb(8, 8, 8)

// Line style & Transparency
lStyle = plot.style_line
lTransp = 50

// Get High & Low
getSeries(_e, _timeFrame) =>
request.security(syminfo.tickerid, _timeFrame, _e, lookahead=barmerge.lookahead_on)

is_newbar(res, sess) =>
t = time(res, sess)
na(t[1]) and not na(t) or t[1] < t

newbar = is_newbar('375', sessSpec)

var float orbH = na
var float orbL = na
var float orbM = na
if newbar
orbH := getSeries(high[0], orbTimeFrame)
orbL := getSeries(low[0], orbTimeFrame)
// orbL

orbA = (orbH + orbL) / 2
orbPrevDayHigh = getSeries(high[1], 'D')
orbPrevDayLow = getSeries(low[1], 'D')
orbPrevDayOpen = getSeries(open[1], 'D')
orbPrevDayClose = getSeries(close[1], 'D')

// Today's Session Start timestamp
y = year(timenow)
m = month(timenow)
d5 = dayofmonth(timenow)

// Start & End time for Today
start = timestamp(y, m, d5, 09, 15)
end = start + 86400000

// Plot only if session started
isToday = timenow > start

// Plot selected timeframe's High, Low & Avg

// Plot lines for same day lines
if isToday
if showTodayHL
_h = line.new(start, orbH, end, orbH, xloc.bar_time, color=color.new(cColor, lTransp), width = 2)
line.delete(_h[1])
_l = line.new(start, orbL, end, orbL, xloc.bar_time, color=color.new(cColor, lTransp), width = 2)
line.delete(_l[1])
if showAvg
_a = line.new(start, orbA, end, orbA, xloc.bar_time, color=color.new(aColor, lTransp), style=line.style_dotted, width=2)
line.delete(_a[1])
if showPrevDayHighLow
_pdh = line.new(start, orbPrevDayHigh, end, orbPrevDayHigh, xloc.bar_time, color=color.new(rColor, lTransp), style=line.style_dotted, width=2)
line.delete(_pdh[1])
_pdl = line.new(start, orbPrevDayLow, end, orbPrevDayLow, xloc.bar_time, color=color.new(sColor, lTransp), style=line.style_dotted, width=2)
line.delete(_pdl[1])
if showPrevDayClose
_pdc = line.new(start, orbPrevDayClose, end, orbPrevDayClose, xloc.bar_time, color=color.new(pcColor, lTransp), style=line.style_dotted, width=2)
line.delete(_pdc[1])

// Plot labels
if isToday
// l_h = label.new(start, orbH, text="High", xloc=xloc.bar_time, textcolor=rColor, style=label.style_none)
// label.delete(l_h[1])
// l_l = label.new(start, orbL, text="Low", xloc=xloc.bar_time, textcolor=sColor, style=label.style_none)
// label.delete(l_l[1])
if showAvg and showminimal !=1
l_a = label.new(start, orbA, text='Avg', xloc=xloc.bar_time, textcolor=cColor, style=label.style_none)
label.delete(l_a[1])
if showPrevDayHighLow and showminimal !=1
l_pdh = label.new(start, orbPrevDayHigh, text='PDH', xloc=xloc.bar_time, textcolo
prateekm
@prateekm, I am getting below error since yesterday "Cannot call `request.*()` functions, or functions containing them, within the scopes of `if`, `switch`, `for`, or `while` structures when their values depend on locally defined variables. Move the function call out of this scope or replace its arguments with global variables or constants."
Shauryam_or
@prateekm, mate send me correct code using pastebin.com... we cant use security function with if ,switch,for ..............
if
request.security("not allow")
Shauryam_or
@prateekm, aise allowed hai

buy_cond= request.security()

if buy
TheBhagwaTradeLawyer
I like the logic used here. Is there a way to auto select the session based on the instrument? like for instance the indicator is default for nifty/bnf, can it change its session automatically as soon as I go you US100 chart, with logic being the same.
Shauryam_or
@Saudatrader03, will look this thnx
gscollman6813710
Hi..what input settings would I use for opening range of 930 to 945
Daha Fazla