vwap done only color left
vwap done only color left
indicator('MIS', overlay=true)
////////////
// INPUTS //
// SMA
rsi_len = input.int( 14, title = "RSI Length", group = "Indicators")
rsi_os = input.float(40, title = "Overbought", group = "Indicators")
rsi_ob = input.float(60, title = "Oversold", group = "Indicators")
// EMA
ema_len = input.int(5, title="EMA Length", group="Indicators")
// VWAP Params
vwap_len = input.int(14, title="VWAP Length", group="Indicators")
// SuperTrend
sup_atr_len = input.int( 9, "Supertrend ATR Length", group = 'Indicators')
sup_factor = input.float(2.0, "Supertrend Factor", group = 'Indicators')
/////////////
// SYMBOLS //
//////////////////
// CALCULATIONS //
id_symbol(s)=>
switch s
1 => only_symbol(s01)
2 => only_symbol(s02)
3 => only_symbol(s03)
4 => only_symbol(s04)
5 => only_symbol(s05)
6 => only_symbol(s06)
7 => only_symbol(s07)
8 => only_symbol(s08)
=> na
// VWAP
vwap_func(len) =>
sum = 0.0
sumvol = 0.0
for i = 0 to len - 1
sum := sum + close[i] * volume[i]
sumvol := sumvol + volume[i]
vwap = sum / sumvol
screener_func() =>
// RSI
rsi = ta.rsi(close, rsi_len)
// EMA of High
ema_high = ta.ema(high, ema_len)
// VWAP
vwap_val = vwap_func(vwap_len)
// Supertrend
[sup_value, sup_dir] = ta.supertrend(sup_factor, sup_atr_len)
// Set Up Matrix
screenerMtx = matrix.new<float>(0, 6, na)
if flg
matrix.add_row(screenerMtx, matrix.rows(screenerMtx), arr)
// Security call
screenerFun(01, s01, u01), screenerFun(02, s02, u02), screenerFun(03, s03, u03),
screenerFun(04, s04, u04),
screenerFun(05, s05, u05), screenerFun(06, s06, u06), screenerFun(07, s07, u07),
screenerFun(08, s08, u08),
///////////
// PLOTS //
if barstate.islast
table.clear(tbl, 0, 0, 5, 40)
if matrix.rows(screenerMtx) > 0
for i = 0 to matrix.rows(screenerMtx) - 1