NSE Paper Stocks Index
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © davenderb
// Made by Stef @Scheplick 
// Modified by DB for having NSE paper stocks
// Release Sep 9 2022

//@version=5

indicator(title = "NSE Paper Stocks Index", shorttitle = "NSE Paper Index", overlay = false)

// Inputs

weightType = input.string("Custom Weighted", "Index Type", options=["Custom Weighted"])

symbol_1     = input.bool(title='Andhra Papers',  defval=true,  inline='1')
ticker_1     = input.symbol(title='',         defval='ANDHRAPAP',  inline='1')
weighting_1  = input.float(title='Weight',    defval=10,     inline='1') / 100.0

symbol_2     = input.bool(title='Seshayee Paper',  defval=true,    inline='2')
ticker_2     = input.symbol(title='',        defval='SESHAPAPER',     inline='2')
weighting_2  = input.float(title='Weight',     defval=10,      inline='2') / 100.0

symbol_3     = input.bool(title='Pudumjee Paper',  defval=true,    inline='3')
ticker_3     = input.symbol(title='',        defval='PDMJEPAPER',     inline='3')
weighting_3  = input.float(title='Weight',     defval=10,      inline='3') / 100.0

symbol_4     = input.bool(title='JK PAPER',  defval=true,    inline='4')
ticker_4     = input.symbol(title='',        defval='JKPAPER',   inline='4')
weighting_4  = input.float(title='Weight',     defval=10,      inline='4') / 100.0

symbol_5     = input.bool(title='WEST COAST PAPERS',  defval=true,    inline='5')
ticker_5     = input.symbol(title='',        defval='WSTCSTPAPR',   inline='5')
weighting_5  = input.float(title='Weight',     defval=10,      inline='5') / 100.0

symbol_6     = input.bool(title='ORIENT PAPER',  defval=true,    inline='6')
ticker_6     = input.symbol(title='',        defval='ORIENTPPR',   inline='6')
weighting_6  = input.float(title='Weight',     defval=10,      inline='6') / 100.0

symbol_7     = input.bool(title='RUCHIRA PAPERS',  defval=true,    inline='7')
ticker_7     = input.symbol(title='',        defval='RUCHIRA',   inline='7')
weighting_7  = input.float(title='Weight',     defval=10,      inline='7') / 100.0

symbol_8     = input.bool(title='GENUS PAPER AND BOARD',  defval=true,    inline='8')
ticker_8     = input.symbol(title='',        defval='GENUSPAPER',   inline='8')
weighting_8  = input.float(title='Weight',     defval=5,      inline='8') / 100.0

symbol_9     = input.bool(title='YASH PAPERS',  defval=true,    inline='9')
ticker_9     = input.symbol(title='',        defval='YASHPAKKA',   inline='9')
weighting_9  = input.float(title='Weight',     defval=5,      inline='9') / 100.0

symbol_10     = input.bool(title='BALLARPUR',  defval=true,    inline='10')
ticker_10     = input.symbol(title='',        defval='BALLARPUR',   inline='10')
weighting_10  = input.float(title='Weight',     defval=10,      inline='10') / 100.0

symbol_11     = input.bool(title='STAR PAPER',  defval=true,    inline='10')
ticker_11     = input.symbol(title='',        defval='STARPAPER',   inline='10')
weighting_11  = input.float(title='Weight',     defval=10,      inline='10') / 100.0

// Security

symcalc01 = symbol_1  ? request.security(ticker_2, timeframe.period, close) : 0
symcalc02 = symbol_2  ? request.security(ticker_2, timeframe.period, close) : 0
symcalc03 = symbol_3  ? request.security(ticker_3, timeframe.period, close) : 0
symcalc04 = symbol_4  ? request.security(ticker_4, timeframe.period, close) : 0
symcalc05 = symbol_5  ? request.security(ticker_5, timeframe.period, close) : 0
symcalc06 = symbol_6  ? request.security(ticker_6, timeframe.period, close) : 0
symcalc07 = symbol_7  ? request.security(ticker_7, timeframe.period, close) : 0
symcalc08 = symbol_8  ? request.security(ticker_8, timeframe.period, close) : 0
symcalc09 = symbol_9  ? request.security(ticker_9, timeframe.period, close) : 0
symcalc10 = symbol_10 ? request.security(ticker_10, timeframe.period, close) : 0
symcalc11 = symbol_11 ? request.security(ticker_11, timeframe.period, close) : 0

// Plot

plot(symcalc01*weighting_1+symcalc02*weighting_2+symcalc03*weighting_3+symcalc04*weighting_4+symcalc05*weighting_5+symcalc06*weighting_6+symcalc07*weighting_7+symcalc08*weighting_8+symcalc09*weighting_9+symcalc10*weighting_10+symcalc11*weighting_11)

