PROTECTED SOURCE SCRIPT
Aggiornato

NSE: N50, BN, MIDCP, FINNIFTY Gainers/Losers Jitendra

117

Title: NSE: N50, BN, MIDCP, FINNIFTY Gainers/Losers + Compact View by Jitendra


Purpose

Script Designed to Check Advance Decline Stocks of that Indices
It is Divided in to Two Part

1st part - Full Gainers/Losers Table:
Lists stock names and their daily percentage change.


2nd part - Compact Count Table:
Shows the number of gaining and losing stocks.




How To Use This Script


To Analysis NSE Indices :- Stocks Component You Can Easily Plot On chart or in 1 click Dropdown setting You can change Indices

Settings Detail

https://drive.google.com/file/d/1p3M9i9jA2XRGY2z5YH0fXvJGA-hmKO3J/view?usp=drive_link


Symbol Lists Defined:

The script uses array.from() to define these symbol groups:


  • highWeightList: Top 39 Nifty stocks by weightage.
  • lowWeightList: Remaining 11 Nifty stocks.
  • bankNiftyList: 12 Bank Nifty stocks.
  • finServList: 20 Financial Services index stocks.
  • midcapList: 25 selected Midcap stocks.


All Stock Used in Script is As per Latest Data Published by NSE, you can also check buy clicking below link

https://www.niftyindices.com/reports/monthly-reports

📤 Data Fetch Logic:
For each symbol in the selected list:
Pine Script®
[c, y] = request.security(sym, 'D', [close, close[1]])


This fetches today's close (c) and previous close (y) using request.security().
Percentage change:
Pine Script®
chg = na(y) ? na : (c - y) / y * 100




Display Logic:
🧾 Full Table:
Shows columns: Script Name and % Change.

Lists each symbol with its daily % change.

Row text color changes based on whether % change is positive, negative, or neutral.

📌 Compact Count Table:
Displays total number of gainers and losers in the list.

Each count shown with respective color-coded background.

📎 Data Fetch Command Summary:


Pine Script®
[c, y] = request.security(sym, 'D', [close, close[1]])



Additional Settings

You can choose from 9 positions for each table:

Table Location Option Available
Text Size Option Available

Pine Script®
f_getPos(posStr) => posStr == "Top Left" ? position.top_left : posStr == "Top Center" ? position.top_center : posStr == "Top Right" ? position.top_right : posStr == "Middle Left" ? position.middle_left : posStr == "Middle Center" ? position.middle_center : posStr == "Middle Right" ? position.middle_right : posStr == "Bottom Left" ? position.bottom_left : posStr == "Bottom Center" ? position.bottom_center : posStr == "Bottom Right" ? position.bottom_right : position.top_right // default fallback



Thanks

Note di rilascio

Update Summary

Sorted By Gainer to Looser for Quick Identification Stocks in Table

istantanea
Note di rilascio
Update Summary

1. Fixed Array Range Issue when User Change Indices
istantanea

Thanks
Keep Enjoying in Trading Journey
Note di rilascio
Update Summary

Fixed out-of-bounds errors when user Select Nifty Financial Option

Added safety checks before loops
Wrapped the for loop that populates the full table inside if array.size(chgList) > 0.
This prevents array.get() from running when arrays are empty.
Improved table rendering conditions:

Full table and compact table updates now run only when arrays have data.

This ensures no attempt to access array.get() on an empty array.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.