VWAP_X_EMA
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © justvishu91

//@version=4
strategy(title="VWAP_EMA", shorttitle="VWAP_EMA", overlay=true, commission_type=strategy.commission.percent,commission_value=0.075, initial_capital = 1000,  default_qty_type=strategy.percent_of_equity, default_qty_value=100)

vwapval =  vwap(close)
emaval = ema(close,50)
ema200 = ema(close,200)

plot(vwapval, color=color.black, title="vwapval")
plot(emaval, color=color.green, title="emaval")

start1 = timestamp(2018, 10, 1, 0, 0)
end1 = timestamp(2020, 10, 30, 0, 0)
if time  >= start1  
    if close > vwapval  and close > emaval and close > ema200
        strategy.entry("Buy", strategy.long,10 ,oca_name="VWAP", oca_type=strategy.oca.cancel)
    else
	    strategy.cancel(id="Buy")

    if close < vwapval  and close < emaval
        strategy.entry("Sell", strategy.short, 10,oca_name="VWAP", oca_type=strategy.oca.cancel)
    else
	    strategy.cancel(id="Sell")