0% found this document useful (0 votes)
2 views1 page

80% Value Area Rule

The document is a TradingView Pine Script that implements an indicator called '80% Value Area Rule TWT'. It detects new trading sessions, tracks daily high and low prices, calculates the value area, and plots the Value Area Low (VAL) and Value Area High (VAH) on the chart. Additionally, it includes a visual representation of the session range and promotional text for a trading website.

Uploaded by

h.ermenkov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

80% Value Area Rule

The document is a TradingView Pine Script that implements an indicator called '80% Value Area Rule TWT'. It detects new trading sessions, tracks daily high and low prices, calculates the value area, and plots the Value Area Low (VAL) and Value Area High (VAH) on the chart. Additionally, it includes a visual representation of the session range and promotional text for a trading website.

Uploaded by

h.ermenkov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//@version=5

//@SirTehseen
//@Tradewithtehseen
indicator("80% Value Area Rule TWT", overlay=true)

// Session Detection
isNewDay = ta.change(time("D")) != 0

// Track Session High/Low


var float dayHigh = na
var float dayLow = na
var float dayVolume = na

if isNewDay
dayHigh := high
dayLow := low
dayVolume := volume
else
dayHigh := math.max(dayHigh, high)
dayLow := math.min(dayLow, low)
dayVolume += volume

// Calculate Value Area


minTick = syminfo.mintick
priceRange = dayHigh - dayLow
numLevels = (priceRange / minTick) + 1
valueAreaWidth = priceRange * 0.8

// Calculate VAL and VAH (centered around midpoint)


val = (dayHigh + dayLow - valueAreaWidth) / 2
vah = (dayHigh + dayLow + valueAreaWidth) / 2

// Plotting
plot(val, "Value Area Low", color=color.red, linewidth=2,
style=plot.style_linebr)
plot(vah, "Value Area High", color=color.green, linewidth=2,
style=plot.style_linebr)

// Optional: Visualize session range


bgcolor(isNewDay ? color.new(color.gray, 90) : na, title="Session Background")

textstylist = table.new('middle' + '_' + 'center', 1, 3)


table.cell(textstylist, 0, 0, 'TRADEWITHTEHSEEN', 0, 0, #b2b5be80, 'center',
text_size='large', bgcolor=color.new(color.blue, 100))
table.cell(textstylist, 0, 1, '👇 \n Website: INDEXTRADER.IN', 0, 0, #b2b5be80,
'center', text_size='normal', bgcolor=color.new(color.blue, 100))

You might also like