// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © cvsk123 //@version=4 study(title="Banks screener", shorttitle = "BN screener", overlay=true) TF1 = input(title="Trade Entry Tf1",type=input.resolution, defval="5") TF2 = input(title="Higher Tf2",type=input.resolution, defval="15") TF3 = input(title="Higher Tf3",type=input.resolution, defval="60") ///// -- Table Inputs max = input(120,'Maximum Length',minval=2) min = input(10 ,'Minimum Length',minval=2) dash_loc = input("Top Right","Dashboard Location" ,options=["Top Right","Bottom Right","Top Left","Bottom Left", "Middle Right","Bottom Center"] ,group='Style Settings') text_size = input('Small',"Dashboard Size" ,options=["Tiny","Small","Normal","Large"] ,group='Style Settings') cell_up = input(#4caf50,'Bullish Cell Color' ,group='Style Settings') cell_dn = input(#FF5252,'Bearish Cell Color' ,group='Style Settings') txt_col = input(color.black,'Text/Frame Color' ,group='Style Settings') cell_transp = input(50,'Cell Transparency' ,minval=0 ,maxval=100 ,group='Style Settings') //---- ////////////////// tUS = input("CURRENCYCOM:US30","TickerUS", type=input.symbol ) tsUS = security(tUS,'D',close) tsUSC1 = security(tUS,'D',close[1]) tsUSTF1 = security(tUS,TF1,close[1]) tsUSTF2 = security(tUS,TF2,close[1]) tsUSTF3 = security(tUS,TF3,close[1]) tsUSChng = (tsUS-tsUSC1) tsUSp = (tsUS-tsUSC1)*100/tsUSC1 tsUS1 = (tsUS-tsUSTF1)*100/tsUSTF1 tsUS2 = (tsUS-tsUSTF2)*100/tsUSTF2 tsUS3 = (tsUS-tsUSC1)*100/tsUSTF3 cdow = tsUSp >= 0 ? cell_up : cell_dn //cdow = color.from_gradient(tsUSp,-10,10,cell_dn,cell_up) cdow1 = tsUS1 >= 0 ? cell_up : cell_dn cdow2 = tsUS2 >= 0 ? cell_up : cell_dn cdow3 = tsUS3 >= 0 ? cell_up : cell_dn // Vix indvixin = input("NSE:INDIAVIX","Ticker Vix", type=input.symbol ) indvix = security(indvixin,'D',close) indvixC = security(indvixin,'D',close[1]) indvixTF1 = security(indvixin,TF1,close[1]) indvixTF2 = security(indvixin,TF2,close[1]) indvixTF3 = security(indvixin,TF3,close[1]) indvixChng = (indvix-indvixC) indvixp = (indvix - indvixC)*100/indvixC indvix1 = (indvix - indvixTF1)*100/indvixTF1 indvix2 = (indvix - indvixTF2)*100/indvixTF2 indvix3 = (indvix - indvixTF3)*100/indvixTF3 cvix = indvixp >= 0 ? cell_up : cell_dn //textVix = 'VIX :' +tostring(indvix)+' ' +tostring(truncate((indvix - indvixC),3)) +' (' + tostring(truncate(indvixp,2)) +'%)' // t1 = input("NSE:HDFCBANK","Ticker1", type=input.symbol ) t2 = input("NSE:ICICIBANK" , "Ticker2", type=input.symbol ) t3 = input("NSE:KOTAKBANK", "Ticker3", type=input.symbol ) t4 = input("NSE:SBIN", "Ticker4", type=input.symbol ) t5 = input("NSE:AXISBANK" , "Ticker5", type=input.symbol) t6 = input("NSE:INDUSINDBK" , "Ticker6", type=input.symbol) //t9 = input("NSE:PNB", "Ticker9", type=input.symbol) //t10 = input("NSE:FEDERALBNK" , "Ticker10", type=input.symbol) //t11 = input("NSE:RBLBANK", "Ticker11", type=input.symbol ) //t12 = input("NSE:YESBANK", "Ticker12", type=input.symbol ) ts1 = security(t1,'D',close) ts1C = security(t1,'D',close[1]) ts1TF1 = security(t1,TF1,close[1]) ts1TF2 = security(t1,TF2,close[1]) ts1TF3 = security(t1,TF3,close[1]) ts1Chng = (ts1-ts1C) ts1p = (ts1-ts1C)*100/ts1C ts1p1 = (ts1 - ts1TF1)*100/ts1TF1 ts1p2 = (ts1 - ts1TF2)*100/ts1TF2 ts1p3 = (ts1 - ts1TF3)*100/ts1TF3 //------------------ ts2 = security(t2,'D',close) ts2C = security(t2,'D',close[1]) ts2TF1 = security(t2,TF1,close[1]) ts2TF2 = security(t2,TF2,close[1]) ts2TF3 = security(t2,TF3,close[1]) ts2Chng = (ts2-ts2C) ts2p = (ts2-ts2C)*100/ts2C ts2p1 = (ts2 - ts2TF1)*100/ts2TF1 ts2p2 = (ts2 - ts2TF2)*100/ts2TF2 ts2p3 = (ts2 - ts2TF3)*100/ts2TF3 //--------------- ts3 = security(t3,'D',close) ts3C = security(t3,'D',close[1]) ts3TF1 = security(t3,TF1,close[1]) ts3TF2 = security(t3,TF2,close[1]) ts3TF3 = security(t3,TF3,close[1]) ts3Chng = (ts3-ts3C) ts3p = (ts3-ts3C)*100/ts3C ts3p1 = (ts3 - ts3TF1)*100/ts3TF1 ts3p2 = (ts3 - ts3TF2)*100/ts3TF2 ts3p3 = (ts3 - ts3TF3)*100/ts3TF3 //---------------- ts4 = security(t4,'D',close) ts4C = security(t4,'D',close[1]) ts4TF1 = security(t4,TF1,close[1]) ts4TF2 = security(t4,TF2,close[1]) ts4TF3 = security(t4,TF3,close[1]) ts4Chng = (ts4-ts4C) ts4p = (ts4-ts4C)*100/ts4C ts4p1 = (ts4 - ts4TF1)*100/ts4TF1 ts4p2 = (ts4 - ts4TF2)*100/ts4TF2 ts4p3 = (ts4 - ts4TF3)*100/ts4TF3 ts5 = security(t5,'D',close) ts5C = security(t5,'D',close[1]) ts5TF1 = security(t5,TF1,close[1]) ts5TF2 = security(t5,TF2,close[1]) ts5TF3 = security(t5,TF3,close[1]) ts5Chng = (ts5-ts5C) ts5p = (ts5-ts5C)*100/ts5C ts5p1 = (ts5 - ts5TF1)*100/ts5TF1 ts5p2 = (ts5 - ts5TF2)*100/ts5TF2 ts5p3 = (ts5 - ts5TF3)*100/ts5TF3 ts6 = security(t6,'D',close) ts6C = security(t6,'D',close[1]) ts6TF1 = security(t6,TF1,close[1]) ts6TF2 = security(t6,TF2,close[1]) ts6TF3 = security(t6,TF3,close[1]) ts6Chng = (ts6-ts6C) ts6p = (ts6-ts6C)*100/ts6C ts6p1 = (ts6 - ts6TF1)*100/ts6TF1 ts6p2 = (ts6 - ts6TF2)*100/ts6TF2 ts6p3 = (ts6 - ts6TF3)*100/ts6TF3 /// -------------- Table Start ------------------- var table_position = dash_loc == 'Top Left' ? position.top_left : dash_loc == 'Bottom Left' ? position.bottom_left : dash_loc == 'Middle Right' ? position.middle_right : dash_loc == 'Bottom Center' ? position.bottom_center : dash_loc == 'Top Right' ? position.top_right : position.bottom_right var table_text_size = text_size == 'Tiny' ? size.tiny : text_size == 'Small' ? size.small : text_size == 'Normal' ? size.normal : size.large var t = table.new(table_position,8,abs(max-min)+2, frame_color=txt_col, frame_width=1, border_color=txt_col, border_width=1) if (barstate.islast) table.cell(t,1,0,'Symbol',text_color=txt_col,text_size=table_text_size) table.cell(t,2,0,'LTP',text_color=txt_col,text_size=table_text_size) table.cell(t,3,0,'Chng',text_color=txt_col,text_size=table_text_size) table.cell(t,4,0,'%Chng',text_color=txt_col,text_size=table_text_size) table.cell(t,5,0, TF1 ,text_color=txt_col,text_size=table_text_size) table.cell(t,6,0, TF2 ,text_color=txt_col,text_size=table_text_size) table.cell(t,7,0, TF3 ,text_color=txt_col,text_size=table_text_size) // Dow table.cell(t,1,1,'Dow',text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,1, tostring(tsUS) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(cdow,cell_transp)) table.cell(t,3,1, tostring(tsUSChng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(cdow,cell_transp)) table.cell(t,4,1, tostring(tsUSp, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(cdow,cell_transp)) table.cell(t,5,1, tostring(tsUS1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(cdow1,cell_transp)) table.cell(t,6,1, tostring(tsUS2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(cdow2,cell_transp)) table.cell(t,7,1, tostring(tsUS3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(cdow3,cell_transp)) // Vix table.cell(t,1,2, str.replace_all(indvixin, 'NSE:', ''),text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,2, tostring(indvix) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(indvixp >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,3,2, tostring(indvixChng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(indvixp >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,4,2, tostring(indvixp, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(indvixp >= 0 ? cell_up : cell_dn ,cell_transp) ) table.cell(t,5,2, tostring(indvix1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(indvix1 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,6,2, tostring(indvix2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(indvix2 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,7,2, tostring(indvix3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(indvix3 >= 0 ? cell_up : cell_dn ,cell_transp)) // 1 table.cell(t,1,3, str.replace_all(t1, 'NSE:', ''),text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,3, tostring(ts1) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts1p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,3,3, tostring(ts1Chng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts1p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,4,3, tostring(ts1p, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts1p >= 0 ? cell_up : cell_dn ,cell_transp) ) table.cell(t,5,3, tostring(ts1p1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts1p1 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,6,3, tostring(ts1p2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts1p2 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,7,3, tostring(ts1p3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts1p3 >= 0 ? cell_up : cell_dn ,cell_transp)) // 2 table.cell(t,1,4, str.replace_all(t2, 'NSE:', ''),text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,4, tostring(ts2) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts2p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,3,4, tostring(ts2Chng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts2p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,4,4, tostring(ts2p, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts2p >= 0 ? cell_up : cell_dn ,cell_transp) ) table.cell(t,5,4, tostring(ts2p1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts2p1 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,6,4, tostring(ts2p2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts2p2 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,7,4, tostring(ts2p3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts2p3 >= 0 ? cell_up : cell_dn ,cell_transp)) // 3 table.cell(t,1,5, str.replace_all(t3, 'NSE:', ''),text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,5, tostring(ts3) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts3p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,3,5, tostring(ts3Chng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts3p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,4,5, tostring(ts3p, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts3p >= 0 ? cell_up : cell_dn ,cell_transp) ) table.cell(t,5,5, tostring(ts3p1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts3p1 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,6,5, tostring(ts3p2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts3p2 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,7,5, tostring(ts3p3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts3p3 >= 0 ? cell_up : cell_dn ,cell_transp)) // 4 table.cell(t,1,6, str.replace_all(t4, 'NSE:', ''),text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,6, tostring(ts4) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts4p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,3,6, tostring(ts4Chng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts4p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,4,6, tostring(ts4p, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts4p >= 0 ? cell_up : cell_dn ,cell_transp) ) table.cell(t,5,6, tostring(ts4p1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts4p1 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,6,6, tostring(ts4p2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts4p2 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,7,6, tostring(ts4p3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts4p3 >= 0 ? cell_up : cell_dn ,cell_transp)) // 5 table.cell(t,1,7, str.replace_all(t5, 'NSE:', ''),text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,7, tostring(ts5) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts5p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,3,7, tostring(ts5Chng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts5p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,4,7, tostring(ts5p, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts5p >= 0 ? cell_up : cell_dn ,cell_transp) ) table.cell(t,5,7, tostring(ts5p1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts5p1 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,6,7, tostring(ts5p2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts5p2 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,7,7, tostring(ts5p3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts5p3 >= 0 ? cell_up : cell_dn ,cell_transp)) // 6 table.cell(t,1,8, str.replace_all(t6, 'NSE:', ''),text_color=color.white,text_size=table_text_size,bgcolor=color.black) table.cell(t,2,8, tostring(ts6) ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts6p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,3,8, tostring(ts6Chng),text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts6p >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,4,8, tostring(ts6p, '#.##') +'%',text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts6p >= 0 ? cell_up : cell_dn ,cell_transp) ) table.cell(t,5,8, tostring(ts6p1, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts6p1 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,6,8, tostring(ts6p2, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts6p2 >= 0 ? cell_up : cell_dn ,cell_transp)) table.cell(t,7,8, tostring(ts6p3, '#.##') +'%' ,text_color=txt_col,text_size=table_text_size, bgcolor=color.new(ts6p3 >= 0 ? cell_up : cell_dn ,cell_transp)) //textRSI = 'RSI :' +tostring( round(rsi(close, 14)))