#Let the index/stock trade for the first fifteen minutes and then use the high and low of this "fifteen minute range" as support and resistance levels. #A buy signal is given when price exceeds the high of the 15 minute range after an up gap. #A sell signal is given when price moves below the low of the 15 minute range after a down gap. #It's a simple technique that works like a charm in many cases.
>If you use this technique, though, a few caveats are in order to avoid whipsaws and other market traps. >The most common whipsaw is a trading range that lasts longer than 15 minutes. >If an obvious range builds in 20, 25 or even 30 minutes , use those to define your support and resistance levels. >Also consider the higher noise level in the morning. >A breakout that extends only a tick or two can be easily reversed and trap you in a sudden loss. >So let others take the bait at these levels, while you find pullbacks and narrow range bars for trade execution.
版本注释
⋅
#Let the index/stock trade for the first fifteen minutes and then use the high and low of this "fifteen minute range" as support and resistance levels. #A buy signal is given when price exceeds the high of the 15 minute range after an up gap. #A sell signal is given when price moves below the low of the 15 minute range after a down gap. #It's a simple technique that works like a charm in many cases.
>If you use this technique, though, a few caveats are in order to avoid whipsaws and other market traps. >The most common whipsaw is a trading range that lasts longer than 15 minutes. >If an obvious range builds in 20, 25 or even 30 minutes , use those to define your support and resistance levels. >Also consider the higher noise level in the morning. >A breakout that extends only a tick or two can be easily reversed and trap you in a sudden loss. >So let others take the bait at these levels, while you find pullbacks and narrow range bars for trade execution.
//is the market trading in between the session timings? If yes then it returns true Barsinsession(session) => time(tf,session) != 0 //single line function
Insession = Barsinsession(session) ? 1 : 0 endofsession = Insession == 0 and Insession[1] == 1 //end of the session if it is happening -> returns ture
//high value and low value from 15min timeframe charts hi = security(syminfo.tickerid,tf,high) lo = security(syminfo.tickerid,tf,low)
orbh = valuewhen(endofsession,hi,0) //first time computation orbl = valuewhen(endofsession,lo,0)
orbh := Barsinsession(session) ? na : orbh //rewriting the value storing a different value orbl := Barsinsession(session) ? na : orbl //rewriting the value storing a different value
Buy = crossover(high,orbh) Short = crossunder(low,orbl)
7:08:10 AM 'Untitled script' opened 7:08:38 AM Compiling... 7:08:38 AM Error at 40:1 Mismatched input 'isLong' expecting 'end of line without line continuation' 7:08:38 AM 'ORB NEXT 15 MIN CANDLE' saved. 7:08:40 AM Compiling... 7:08:43 AM Error at 40:1 Mismatched input 'isLong' expecting 'end of line without line continuation'
Kerasi
⋅
Great job.
If I want the script to start from 0930 - 1030 then end at end of day? (equities use)
Thank you
parisseine
⋅
An excellent way to see the opening trend thanks to that opening range script.
The duration of the opening can be a variable instead of 15 minutes only, let's say X the value in minutes and below I set 2 hours (120 minutes) instead of 15 for the OR as for an example:
// TimeFrame = TF; Opening Range High = ORH; Opening Range Low = ORL; Opening Range Average = ORA
study(title="TESTING ORB", shorttitle="TESTING ORB", overlay=true)
High = plot(adopt(TF, ORH), color = #000000, linewidth = 2)
Low = plot(adopt(TF, ORL), color = #000000, linewidth = 2)
Average = plot(adopt(TF, ORA), color = #787B86, linewidth = 2)
//
jaymakwana50
⋅
@parisseine, what should be the code if i want to create strategy, where vwap cross ORH buy and exit @ 3:15 and vwap cross ORL sell and exit same. or price close above buy / sell when close below
srsivasekhar
⋅
HI i tried in my chart , but only getting a single line , low line is missing , any solutions ?
sunnetww
⋅
for futures , I am getting HL and LL seperately. However, for stocks, the same script is giving only 1 line. What could be the issue?
please guide me bro