Nifty Volume profile + VWAP + EMA 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © aashish2137
//@version=4
strategy("NF VWAP and EMA",overlay=true)
// custom function 
sym(s) => security(s,timeframe.period,  volume)
 
// make the weighted index 
A = (10.34*sym("NSE:HDFCBANK")/100+11.88*sym("NSE:RELIANCE")/100+7.2*sym("NSE:HDFC")/100+5.39*sym("NSE:ICICIBANK")/100+6.35*sym("NSE:INFY")/100+5.2*sym("NSE:TCS")/100+4.11*sym("NSE:KOTAKBANK")/100+4.32*sym("NSE:ITC")/100+2.18*sym("NSE:AXISBANK")/100+2.89*sym("NSE:LT")/100+3.69*sym("NSE:HINDUNILVR")/100+1.55*sym("NSE:SBIN")/100+1.3*sym("NSE:BAJFINANCE")/100+1.87*sym("NSE:MARUTI")/100+1.82*sym("NSE:INDUSINDBK")/100+3.1*sym("NSE:BHARTIARTL")/100+1.9*sym("NSE:ASIANPAINT")/100+1.5*sym("NSE:HCLTECH")/100+1.13*sym("NSE:BAJAJFINSV")/100+1.19*sym("NSE:NTPC")/100+1.57*sym("NSE:NESTLEIND")/100+0.93*sym("NSE:TITAN")/100+1.05*sym("NSE:M_M")/100+0.82*sym("NSE:TECHM")/100+1.28*sym("NSE:SUNPHARMA")/100+1.13*sym("NSE:ULTRACEMCO")/100+1.01*sym("NSE:POWERGRID")/100+0.76*sym("NSE:ONGC")/100+0.89*sym("NSE:BAJAJ_AUTO")/100+0.74*sym("NSE:COALINDIA")/100+0.69*sym("NSE:BPCL")/100+0.79*sym("NSE:WIPRO")/100+1*sym("NSE:BRITANNIA")/100+0.71*sym("NSE:TATASTEEL")/100+1.24*sym("NSE:DRREDDY")/100+0.66*sym("NSE:TATAMOTORS")/100+0.64*sym("NSE:IOC")/100+0.64*sym("NSE:UPL")/100+0.63*sym("NSE:EICHERMOT")/100+0.77*sym("NSE:HEROMOTOCO")/100)
 
 
colorofbar = open < close ? color.green : color.red
 
 
volumePeriod = input(14, "Period")
fastEmaPeriod = input(8, "Period")
slowEmaPeriod = input(5, "Period")
priceValue = (high + low + close) / 3
priceVolume = priceValue * A
cumulativePriceVolume = sum(priceVolume, volumePeriod)
cumulativeVolume = sum(A, volumePeriod)
vwapValue = cumulativePriceVolume / cumulativeVolume
fastEma = ema(close, fastEmaPeriod)
slowEma = ema(close, slowEmaPeriod)
plot(series=vwapValue, title="VWAP BNF", style=plot.style_line, color= color.black)
plot(series=fastEma, title="Fast EMA", style=plot.style_line, color= color.green)
plot(series=slowEma, title="Slow EMA", style=plot.style_line, color= color.red)
 
longCond = crossover(fastEma, slowEma)
shortCond = crossunder(fastEma, slowEma)
 
 
plotshape(series=longCond, title="Long", style=shape.cross, location=location.bottom, color=color.green, text="LONG", size=size.small)
plotshape(series=shortCond, title="Short", style=shape.cross, location=location.bottom, color=color.red, text="SHORT", size=size.small)