Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- //Author : @ILuvMarkets
- study("BANKNIFTY Public v1.0", overlay=true)
- _res = input(title="Resolution", type=input.resolution, defval="D")
- LIGHTTRANSP = 90
- AVGTRANSP = 80
- HEAVYTRANSP = 70
- i_posColor = input(color.rgb(38, 166, 154), title="Positive Color")
- i_negColor = input(color.rgb(240, 83, 80), title="Negative Color")
- var table _table = table.new(position.top_right, 10, 20, border_width = 1)
- if barstate.isfirst
- _r = 0, _c = 0
- table.cell(_table,_c, _r, "Symbol", bgcolor = color.black, text_color = color.white, text_halign = text.align_center, text_size = size.small ), _c := _c+1
- table.cell(_table,_c, _r, "Vol T", bgcolor = color.black, text_color = color.white, text_halign = text.align_center, text_size = size.small ), _c := _c+1
- table.cell(_table,_c, _r, "Close", bgcolor = color.black, text_color = color.white, text_halign = text.align_center, text_size = size.small ), _c := _c+1
- table.cell(_table,_c, _r, "Chg %", bgcolor = color.black, text_color = color.white, text_halign = text.align_center, text_size = size.small ), _c := _c+1
- table.cell(_table,_c, _r, "Pts", bgcolor = color.black, text_color = color.white, text_halign = text.align_center, text_size = size.small ), _c := _c+1
- f_fillRow(_row_orig, _symbol) =>
- _c = 0
- _row = _row_orig + 0 // to accomodate for the INDEX data
- [_pts, _chg_pct, _close,_vol] = security("NSE:" + _symbol, _res, [close - close[1], (close - close[1])/close[1], close, volume])
- _c_color = _pts > 0 ? i_posColor : i_negColor
- _transp = abs(_chg_pct) > .01 ? HEAVYTRANSP : abs(_chg_pct) > 0.005? AVGTRANSP : LIGHTTRANSP
- table.cell(_table, _c, _row, _symbol, bgcolor = color.new(_c_color, _transp), text_color = _c_color, text_halign = text.align_left, text_size = size.small), _c := _c+1
- table.cell(_table, _c, _row, tostring(_vol/pow(10,3), '#,###'), bgcolor = color.new(_c_color, _transp), text_color = _c_color, text_halign = text.align_right, text_size = size.small), _c := _c+1
- table.cell(_table, _c, _row, tostring(_close, '#,###.##'), bgcolor = color.new(_c_color, _transp), text_color = _c_color, text_halign = text.align_right, text_size = size.small), _c := _c+1
- table.cell(_table, _c, _row, tostring(_chg_pct, '#,###.##%'), bgcolor = color.new(_c_color, _transp), text_color = _c_color, text_halign = text.align_right, text_size = size.small), _c := _c+1
- table.cell(_table, _c, _row, tostring(_pts, '#,###.#'), bgcolor = color.new(_c_color, _transp), text_color = _c_color, text_halign = text.align_right, text_size = size.small), _c := _c+1
- if barstate.islast
- f_fillRow(1, "HDFCBANK")
- f_fillRow(2, "ICICIBANK")
- f_fillRow(3, "KOTAKBANK")
- f_fillRow(4, "AXISBANK")
- f_fillRow(5, "SBIN")
- f_fillRow(6, "INDUSINDBK")
- f_fillRow(7, "AUBANK")
- f_fillRow(8, "BANDHANBNK")
- f_fillRow(9, "FEDERALBNK")
- f_fillRow(10, "IDFCFIRSTB")
- f_fillRow(11, "PNB")
- f_fillRow(12, "RBLBANK")
Advertisement
Add Comment
Please, Sign In to add comment