jayy

VWAP with FIB range Jayy

This is sandbox experiment. The script creates bands around the VWAP based on the opening range on an intraday chart (adjustable in the format section) using fibonacci multipliers (mostly): .236, .382, .5, .618, .786, 1, 1.27 and 1.618. I have not built much flexibility into the script so this is very much an alpha script. Something new for Pippin and Kipp.

Jayy
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
study("VWAP with FIB range Jayy", overlay=true)

res = input('15', type=resolution, title=" length/time Of Opening Range?")
factor = input(1, title= " Factor to multiple range by if wanted"),//range = input (.14),//env = range*factor,

bartimeSess =  time('D') 
fr2to17 =  time(period) 
newbarSess = bartimeSess != bartimeSess[1]
high_range = valuewhen(newbarSess,high,0)
low_range = valuewhen(newbarSess,low,0)
adopt(r, s) => security(tickerid, r, s)

//Formula For Opening Range
highRes = adopt(res, high_range)
lowRes = adopt(res, low_range)
range = highRes - lowRes

//fibs should be .23, .38,.5,  .618, .78,  1, 1.27, 1.618, 2.618, 4.23, 6.85
env = range*factor
upperband = vwap+(env*.236), lowerband = vwap-(env*.236)
upperband2 = vwap +(env*.382), lowerband2 = vwap-(env*.382)
upperband3 = vwap +(env*.5), lowerband3 = vwap-(env*.5)
upperband4 = vwap +(env*.618), lowerband4 = vwap-(env*.618)
upperband5 = vwap +(env*.786), lowerband5 = vwap-(env*.786)
upperband6 = vwap +(env*1.), lowerband6 = vwap-(env*1.)
upperband7 = vwap +(env*1.27), lowerband7 = vwap-(env*1.27)
upperband8 = vwap +(env* 1.618), lowerband8 = vwap-(env*1.618)
// plot only during session to elimate the mess 
//between 4 pm close and 8:30 open on open session charts

green1 =time (period, "930-931")?na:green// black
red1 =time (period,  "930-931")?na:red//black
black1 =time (period,  "930-931")?na:black//black
green2 =time (period,  "930-931")?na:lime//black
red2 =time (period,  "930-931")?na:orange//black
plot(upperband8,style=line,linewidth=2,color=green2,transp=90)
plot(lowerband8,style=line,linewidth=2,color=red2,transp=90)
plot(upperband7,style=line,linewidth=2,color=green2,transp=90)
plot(lowerband7,style=line,linewidth=2,color=red2,transp=90)
plot(upperband6,style=line,linewidth=2,color=green2,transp=90)
plot(lowerband6,style=line,linewidth=2,color=red2,transp=90)
plot(upperband5,style=line,linewidth=2,color=green1,transp=90)
plot(lowerband5,style=line,linewidth=2,color=red1,transp=90)
plot(upperband4,style=line,linewidth=2,color=green2,transp=90)
plot(lowerband4,style=line,linewidth=2,color=red2,transp=90)
plot(upperband3,style=line,linewidth=2,color=green1,transp=90)
plot(lowerband3,style=line,linewidth=2,color=red1,transp=90)
plot(upperband2,style=line,linewidth=2,color=green1,transp=90)
plot(lowerband2,style=line,linewidth=2,color=red1,transp=90)
plot(upperband,style=line,linewidth=2,color=green1,transp=90)
plot(lowerband,style=line,linewidth=2,color=red1,transp=90)
plot(vwap,style=line,linewidth=2,color=black1,transp=90)

// The idea is to first find the Daily 7-bar ATR (or any other nr. of days desired) 
// and then input that into the range, i.e. of the 7-Day ATR is 2.5, input 2.5). The factor input 
// determines the width of the bars relative to the ATR and since there are six bands, one sixth 
// of the Daily ATR would be .1666, so I changed that to .1618 to have a nice Fibonacci number. 
// In any case, the result is that the range of the bands from the outermost on top to the outermost
// on the bottom should roughly correlate with the Daily ATR. Ideally these bands could
// be rounded to ticks so that they will print out precise price levels for trading but
// I am not able to program that in in this language. 
// For use of vwap, use google etc. I prefer it to moving averages since it is a precise statistical 
// calculation using volume, and also it remains the same in all time frames, albeit mainly
// used for intraday charts.
// I also like to use the bands for entries, stops and profit targets - along with basic 
// price information from the bars.
// I wrote essentially the same indicator called VBandPts wherein the input for the bandwidth
// is a simple point value number so that you can get the bands to display in ticks or points,
// i.e. 3 points, 2.5 pts etc. So in that case you can take the current indicator to see
// roughly what the bandwith is, and then use the VwapPts on the chart to get bands 
// close in value to the raw calcs from this one, but more helpful for trading.
// Either way, it's just a simple visual grid overlaid on top of the basic vwap value.