//@version=4
study("Asian Session (9h-10h40)", overlay=true)
t1 = time(timeframe.period, "0200-0340")
bgcolor(t1 ? color.gray : na, title="Asian Session")
t2 = time(timeframe.period, "0215-0335")
close_ = close
open_ = open
high_ = high
low_ = low
body_=abs(close-open)
sh_=(high-low)*0.05
// === INPUTS
// - /INPUTS
// - FUNCTIONS
// ||--- FILTER Functions: -----------------------------------------------------||
isIdealF(mode) =>
ret = mode == 1 ?
close_[3]>open_[3] and close_[2]>open_[2] and close_[1]>open_[1] and
body_[3]>sh_[3] and body_[2]>sh_[2] and body_[1]>sh_[1] :
mode == -1 ?
close_[3]<open_[3] and close_[2]<open_[2] and close_[1]<open_[1] and
body_[3]>sh_[3] and body_[2]>sh_[2] and body_[1]>sh_[1] : false
ret
// ||-----------------------------------------------------------------------------------------------------||
// - /FUNCTIONS
// Filter
filteredtopf = isIdealF(1)
filteredbotf = isIdealF(-1)
plotshape(t2 ? filteredtopf : na, title='Put', style=shape.arrowdown, location=location.abovebar, color=color.red, offset=-1, transp=0)
plotshape(t2 ? filteredbotf : na, title='Call', style=shape.arrowup, location=location.belowbar, color=color.blue, offset=-1, transp=0)
// Alert
putcol = isIdealF(1) ? color.red : na
callcol = isIdealF(-1) ? color.blue : na
bgcolor(t2 ? putcol : na, transp=70)
bgcolor(t2 ? callcol : na, transp=70)
//EOF