PROTECTED SOURCE SCRIPT

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

41
Summary of This Indicator


I Have Created This Gainers/Losers dashboard for selected NSE Indices
It is Divided in to symbol groups
1. Nifty Top 39 -High Weight Stocks
2. Nifty Rest 11-Remaining 11 Nifty stocks Low Weightage
3. Bank Nifty,
4. Financial Services,
5. Midcap Select

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

Main Features of Indicator

It Has Two Display Modes


Full Table → Shows each stock’s name and its daily % change, sorted from top gainer to top loser.

Compact Count Table → Shows just total number of gainers vs losers.

Customizable Inputs

  1. Choose symbol list (High-weight Nifty, Bank Nifty, etc.).
  2. Select table size (tiny → large).
  3. Control table position (Top/Bottom/Middle, Left/Right/Center).
  4. Customize gainer/loser colors.
  5. Option to toggle full table or compact table on/off.


Data Handling

  • Fetches each stock’s close price vs previous day using request.security().
  • Calculates % change for all symbols.
  • Uses a bubble sort function to arrange stocks in descending order of % change.


Outputs
  • Full Gainers/Losers Table (sorted, detailed).
  • Compact Summary Table (just counts).



After Selecting Nifty Indices

syot kilat


Data Fetch Command Summary


Symbol Loop & Data Fetch
Pine Script®
for i = 0 to array.size(symbolList)-1 sym = array.get(symbolList, i) [c, y] = request.security(sym, 'D', [close, close[1]]) chg = na(y) ? na : (c - y) / y * 100 if not na(chg) array.push(chgList, chg) // store % change array.push(nameList, sym) // store symbol name gainers += chg > 0 ? 1 : 0 losers += chg < 0 ? 1 : 0



Sorting Function (Bubble Sort, Descending by % Change)
Pine Script®
f_sortDesc(_a, _b) => len = array.size(_a) if len > 1 for i = 0 to len - 2 for j = i + 1 to len - 1 if array.get(_a, j) > array.get(_a, i) tempVal = array.get(_a, i) tempSym = array.get(_b, i) array.set(_a, i, array.get(_a, j)) array.set(_b, i, array.get(_b, j)) array.set(_a, j, tempVal) array.set(_b, j, tempSym)



Thanks

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.