Why this Script : Nifty 50 does not provide volume and some time it is really useful to understand the volume .
This is the pine script which calculate the nifty 50 volume .
Logic :
Take each stock contribute to nifty 50 and find it's volume . Multiply the same with contribution percentage of the same on Nifty 50 Add up all of them and find the total volume .
I took the open source code from @daytraderph script called, Custom Volume
I will make sure I will update the contribution percentage of all stocks my self instead o you update using input methods. This is the difference. Some people don't know where to look at this to update the value, so for them this script might be useful. And this is the only difference comparing to Custom Volume script.
Notes de version
⋅
Simplify the script, remove some code from the original script which does not match with this script as of now.
@tobhanusingh, looks like not. Weightages are not right.
et_ab
⋅
Hi Bro
with changes in weigtage i did change values & removed the banks bank of baroda & PNB but while running it throws compilation error can you please check else upload latest script .
// custom function
sym(s) => security(s,timeframe.period, volume)
// make the weighted index
A = (W_HDFCBANK*sym("NSE:HDFCBANK")/100 + W_ICICIBANK*sym("NSE:ICICIBANK")/100 + W_AXISBANK*sym("NSE:AXISBANK")/100+W_KOTAKBANK*sym("NSE:KOTAKBANK")/100+ W_SBIN*sym("NSE:SBIN")/100+W_INDUSINDBK*sym("NSE:INDUSINDBK")/100 +W_FEDERALBNK*sym("NSE:FEDERALBNK")/100 +W_RBLBANK*sym("NSE:RBLBANK")/100+W_IDFC*sym("NSE:IDFC")/
colorofbar = open < close ? color.green : color.red
@lifekarofficial, Hi I am getting study error.I copy pasted your code and it is throwing error message Could not find function of function reference 'study') Can you pls help Thanks.
yanithkumar12345
⋅
@ssundarrajan, now the version is 5, so study does not work....use indicator in place of study. and in place of security use request.security
Delete these W_BANDHANBNK=1.98 W_PNB=0.91 //W_RBLBANK=1.15 //W_IDFC=0.92
// custom function sym(s) => security(s,timeframe.period, volume)
// make the weighted index A = (W_HDFCBANK*sym("NSE:HDFCBANK")/100 + W_ICICIBANK*sym("NSE:ICICIBANK")/100 + W_AXISBANK*sym("NSE:AXISBANK")/100+W_KOTAKBANK*sym("NSE:KOTAKBANK")/100+ W_SBIN*sym("NSE:SBIN")/100+W_INDUSINDBK*sym("NSE:INDUSINDBK")/100 +W_FEDERALBNK*sym("NSE:FEDERALBNK")/100 +W_BANKBARODA*sym("NSE:BANKBARODA")/100+W_BANDHANBNK*sym("NSE:BANDHANBNK")/100+W_IDFCFIRSTB*sym("NSE:IDFCFIRSTB")/100+W_AUBANK*sym("NSE:AUBANK")/100+W_PNB*sym("NSE:PNB")/100)
colorofbar = open < close ? color.green : color.red