From a61c25b5b0baa18831b79341d965cd9cac7693e9 Mon Sep 17 00:00:00 2001 From: Tanishq Patni Date: Sat, 18 Jul 2026 05:54:33 +0530 Subject: [PATCH] Add preset index lists for quick symbol selection --- .../[Scanner] ICT Displacement Candles.txt | 1270 +++++----- ...ICT Equal Highs and Lows with Screener.txt | 816 ++++--- ...ner - ICT Fair Value Gap (FVG) Scanner.txt | 2062 +++++++++-------- ... - ICT Liquidity Sweep Pattern Scanner.txt | 1558 +++++++------ ...anner] ICT Liquidity Void Fill Scanner.txt | 1172 ++++++---- .../ICT Liquidity Void Screener.txt | 950 +++++--- ... Market Structure Shift (MSS) Screener.txt | 1128 +++++---- ...[Scanner] ICT Mitigation Block Scanner.txt | 1752 ++++++++------ ... Momentum Investing Setup with Scanner.txt | 1300 ++++++----- ...entum Setup - RSI Directional Momentum.txt | 1788 +++++++------- ...ion Buying Scalping Setup with Scanner.txt | 1602 +++++++------ ...y Thakare Option Buying Scalping Setup.txt | 2 +- ...etup - Sideways Market Skipper Scanner.txt | 1380 ++++++----- ...tracement to Order Block with Screener.txt | 1169 ++++++---- ...n [RS]Market Profile by RicardoSantos).txt | 971 +++++--- 15 files changed, 11027 insertions(+), 7893 deletions(-) diff --git a/ICT Displacement Candles/[Scanner] ICT Displacement Candles.txt b/ICT Displacement Candles/[Scanner] ICT Displacement Candles.txt index bcaa052..88f17d7 100644 --- a/ICT Displacement Candles/[Scanner] ICT Displacement Candles.txt +++ b/ICT Displacement Candles/[Scanner] ICT Displacement Candles.txt @@ -1,523 +1,747 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=6 -indicator(title = 'ICT Displacement Candles Scanner', shorttitle = 'ICTDCScan', overlay = true, max_lines_count = 500, max_labels_count = 500, behind_chart = false) - -//___________________________ Menu Start - -string g_scn_tb = '█████████████████ Scanner █████████████████' - -string tt_ch = - "Displacement:" + - "\n• Strong, sudden price move (up/down) with long candles, minimal wicks." + - - "\n\n Retracement:" + - "\n• Price retraces to a Fibonacci level of the displacement." + - "\n• Potential entry point for trend continuation." - -string tt_is = - "• Reads only the first 40 symbols." + - "\n• Max 4096 characters." + - "\n• Format: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_scn_choose = input.string( - defval = 'Displacement', - title = 'Scanning Method', - options = ['Displacement', 'Retracement'], tooltip = tt_ch, group = g_scn_tb) - -string i_symbols = input.text_area( - defval = 'NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:BIOCON,NSE:BPCL,NSE:CESC,NSE:DELHIVERY,NSE:FEDERALBNK,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IGL,NSE:IIFL,NSE:INDUSTOWER,NSE:IOC,NSE:IREDA,NSE:IRFC,NSE:JIOFIN,NSE:LTF,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:M_MFIN,NSE:NATIONALUM,NSE:NCC,NSE:NYKAA,NSE:ONGC,NSE:PETRONET,NSE:POWERGRID,NSE:RBLBANK,NSE:SAIL,NSE:TATASTEEL,NSE:UNIONBANK,NSE:WIPRO,NSE:ZOMATO', - title = 'Paste Symbols', tooltip = tt_is, group = g_scn_tb) - -bool i_scn_show_table = input.bool(defval = true, title = 'Display Table', group = g_scn_tb) -bool i_scn_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scn_tb) -bool i_scn_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scn_tb) - -int i_scn_tbl_show_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scn_tb) -string i_scn_tbl_pos = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scn_tb) -string i_scn_tbl_txt_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scn_tb) - -string g_dc = '████████████ Displacement Candles ████████████' - -string tt_mb = "Shows if bars exceed the set value." -string tt_dev = "Specifies the minimal size of displament, as a percentage of the average high-low range for the last 14 bars." -string tt_ret_fib = - "• 0: Top of bullish & bottom of bearish displacement." + - "\n• 1: Bottom of bullish & top of bearish displacement." + - "\n• 0.5: 50% of the displacement." - -int i_dc_min_bars = input.int(defval = 3, title = 'Minimum Bars', minval = 1, tooltip = tt_mb, group = g_dc) -float i_dc_dev_percent = nz(input.float(60.0, "Minimal Deviation (%)", minval=1, step = 10, tooltip = tt_dev, group = g_dc) / 100 * ta.sma(high-low, 14)) -bool i_dc_close_filter = input.bool(defval = true, title = 'Apply Close Above/Below Prev Close', group = g_dc) -bool i_dc_hl_filter = input.bool(defval = false, title = 'Apply Close Above/Below Prev High/Low', group = g_dc) -float i_dc_fib_val = input.float(defval = 0.5, title = 'Fibonacci Value', step = 0.1, tooltip = tt_ret_fib, group = g_dc) - -string g_af = '██████████████ Additional Fiters ██████████████' - -string tt_atr = "• Filters out longer or more volatile displacement candles." -string tt_atr_mul = "• Higher values filter longer or more volatile candles." -string tt_bf = "• 80 means the body covers 80%+ of the displacement candle." -string tt_tf = "• Filter signals within a given time." -string tt_df = "• Filter signals on specified dates (for Retracement Candles only)." - -bool i_atr_filter = input.bool(defval = false, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) -int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) -float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) - -bool i_body_filter = input.bool(defval = false, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) -float i_body_percent = input.float(defval = 70, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 - -bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) -int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) -int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) -int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) -int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) - -bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) -int i_day = input.int(defval = 30, minval = 1, maxval = 31, title = 'Day', group = g_af) -int i_month = input.int(defval = 3, minval = 1, maxval = 12, title = 'Month', group = g_af) -int i_year = input.int(defval = 2025, minval = 0, title = 'Year', group = g_af) - -string g_cum = '█████████████ Performance Table █████████████' - -bool i_cum_tbl_disp = input.bool(defval = true, title = 'Display', group = g_cum) -string i_cum_tbl_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_cum) -string i_cum_tbl_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_cum) - -//string g_ch = '█████████████████ Colors █████████████████' -color i_pos_color = #089981 //input.color(defval = #089981, title = 'Positive', group = g_ch) -color i_pos_light_color = #70CCBD //input.color(defval = #70CCBD, title = 'Positive Light', group = g_ch) -color i_neg_light_color = #FAA1A4 //input.color(defval = #FAA1A4, title = 'Negative Light', group = g_ch) -color i_neg_color = #F23645 //input.color(defval = #F23645, title = 'Negative', group = g_ch) -color i_neu_color = #D1D4DC //input.color(defval = #D1D4DC, title = 'Neutral Light', group = g_ch) -color i_neu_dark_color = #0F0F0F //input.color(defval = #0F0F0F, title = 'Neutral', group = g_ch) - -//___________________________ Menu End - -//___________________________ Performance Start - -is_new_day = ta.change(time('D')) != 0 - -// Cumulative Percentage Change -var float cum_pchg = na -day_pchg = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 -cum_pchg := is_new_day ? day_pchg : na(cum_pchg) ? day_pchg : cum_pchg + day_pchg - -// Cumulative Volume and Volume Percentage Change -var float curr_cum_vol = na -var float prev_cum_vol = na -if is_new_day - prev_cum_vol := curr_cum_vol - curr_cum_vol := volume - curr_cum_vol -else - curr_cum_vol := na(curr_cum_vol) ? volume : curr_cum_vol + volume - curr_cum_vol -prev_vol_safe = nz(prev_cum_vol, curr_cum_vol) -cum_vol_pchg = (curr_cum_vol - prev_vol_safe) / prev_vol_safe * 100 - -var table tbl_cum = table.new(position=i_cum_tbl_pos, columns=2, rows=4, border_width=1, force_overlay=true) - -cell_perform(col, row, txt, txt_color, aligh) => - table.cell(tbl_cum, col, row, txt, text_color=txt_color, text_halign=aligh, bgcolor=i_neu_dark_color, text_size=i_cum_tbl_size) - -if barstate.islast and i_cum_tbl_disp - pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color - vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color - prev_vol_pchg_col = prev_vol_safe < curr_cum_vol ? i_neg_color : i_pos_color - - cell_perform(0, 0, '%Chg', chart.fg_color, text.align_left) - cell_perform(1, 0, str.tostring(cum_pchg, '#.##') + ' %', pchg_col, text.align_right) - cell_perform(0, 1, 'Vol %Chg', chart.fg_color, text.align_left) - cell_perform(1, 1, str.tostring(cum_vol_pchg, '#.##') + ' %', vol_pchg_col, text.align_right) - cell_perform(0, 2, 'Vol', chart.fg_color, text.align_left) - cell_perform(1, 2, str.tostring(curr_cum_vol / 100000, '#.##') + ' L', vol_pchg_col, text.align_right) - cell_perform(0, 3, 'PD Vol', chart.fg_color, text.align_left) - cell_perform(1, 3, str.tostring(prev_vol_safe / 100000, '#.##') + ' L', prev_vol_pchg_col, text.align_right) - -//___________________________ Performance End - -//___________________________ Additional Filters Start - -// Pre-calculate common values -candle_range = high - low -body_size = math.abs(close - open) - -// ATR Filter -atr_filter = not i_atr_filter or candle_range > ta.atr(i_atr_length) * i_atr_multi - -// Body Filters -body_filter = not i_body_filter or candle_range > 0 and body_size / candle_range >= i_body_percent - -// Time Filter -time_filter = - not i_time_filter or - (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and - (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) - -// Date Filter -date_filter = not i_date_filter or year == i_year and month == i_month and dayofmonth == i_day - -//___________________________ Additional Filters End - -//___________________________ Displacement Candles Start - -// Combined tracking variables -var int bullCnt = 0 -var int bearCnt = 0 -var float bullHi = na -var float bullLo = na -var float bearHi = na -var float bearLo = na -var float bullFib = na -var float bearFib = na -var bullHighs = array.new_float() -var bullLows = array.new_float() -var bearHighs = array.new_float() -var bearLows = array.new_float() - -// Conditions and filters combined -float priceChg = (high - low) -bool bullish = priceChg >= i_dc_dev_percent and close > open and (not i_dc_close_filter or close > close[1]) and (not i_dc_hl_filter or close > high[1]) and atr_filter -bool bearish = priceChg >= i_dc_dev_percent and close < open and (not i_dc_close_filter or close < close[1]) and (not i_dc_hl_filter or close < low[1]) and atr_filter - -// Optimized counting and array management -if bullish - bullCnt := bullCnt + 1 - bearCnt := 0 - array.push(bullHighs, high) - array.push(bullLows, low) - if bullCnt == 1 - array.clear(bearHighs) - array.clear(bearLows) -else if bearish - bearCnt := bearCnt + 1 - bullCnt := 0 - array.push(bearHighs, high) - array.push(bearLows, low) - if bearCnt == 1 - array.clear(bullHighs) - array.clear(bullLows) -else - bullCnt := 0 - bearCnt := 0 - array.clear(bullHighs) - array.clear(bullLows) - array.clear(bearHighs) - array.clear(bearLows) - -// Calculate high-low range and percentage -float bullRange = na -float bearRange = na -float bullRangePercent = na -float bearRangePercent = na - -if bullCnt >= i_dc_min_bars - bullHi := array.max(bullHighs) - bullLo := array.min(bullLows) - bullRange := bullHi - bullLo - bullRangePercent := (bullRange / bullLo) * 100 - bullFib := bullHi - (bullHi - bullLo) * i_dc_fib_val -if bearCnt >= i_dc_min_bars - bearHi := array.max(bearHighs) - bearLo := array.min(bearLows) - bearRange := bearHi - bearLo - bearRangePercent := (bearRange / bearLo) * 100 - bearFib := bearLo + (bearHi - bearLo) * i_dc_fib_val - -bearMaxCnt = bearCnt[1] >= i_dc_min_bars and bearCnt == 0 -bullMaxCnt = bullCnt[1] >= i_dc_min_bars and bullCnt == 0 - -// Plot -if bearMaxCnt and i_scn_show_short - label.new(x = bar_index[1], y = low[1], text = str.tostring(bearCnt[1]), color = na, textcolor = i_neg_light_color, size = size.small, style = label.style_label_up, yloc = yloc.belowbar) -// label.new(x = bar_index[1], y = low[1], text = str.format("{0,number,#.##}%", bearRangePercent[1]), color = na, textcolor = i_neg_light_color, size = size.small, style = label.style_label_up, yloc = yloc.belowbar) - -if bullMaxCnt and i_scn_show_long - label.new(x = bar_index[1], y = high[1], text = str.tostring(bullCnt[1]), color = na, textcolor = i_pos_light_color, size = size.small, style = label.style_label_down, yloc = yloc.abovebar) -// label.new(x = bar_index[1], y = high[1], text = str.format("{0,number,#.##}%", bullRangePercent[1]), color = na, textcolor = i_pos_light_color, size = size.small, style = label.style_label_down, yloc = yloc.abovebar) - -// Plot counts -//if bearCnt >= i_dc_min_bars and i_scn_show_short -// label.new(x = bar_index, y = low, text = str.tostring(bearCnt), color = na, textcolor = i_neg_light_color, size = size.small, style = label.style_label_up, yloc = yloc.belowbar) -//if bullCnt >= i_dc_min_barst and i_scn_show_long -// label.new(x = bar_index, y = high, text = str.tostring(bullCnt), color = na, textcolor = i_pos_light_color, size = size.small, style = label.style_label_down, yloc = yloc.abovebar) - -plot(series = bearFib, title = 'Bearish Fib Line', color = i_neg_color, style = plot.style_stepline, display = display.none) -plot(series = bullFib, title = 'Bullish Fib Line', color = i_pos_color, style = plot.style_stepline, display = display.none) - -// Track the final count before reset -var int lastBullCnt = 0 -var int lastBearCnt = 0 - -// Update when sequence ends -if bullMaxCnt - lastBullCnt := bullCnt[1] -if bearMaxCnt - lastBearCnt := bearCnt[1] - -// Retracement tracking combined -var bool bullActive = false -var bool bearActive = false -var bool bullDone = false -var bool bearDone = false -var int bullBar = na -var int bearBar = na -var int bullStart = na -var int bearStart = na -var float bullLow = na -var float bearHigh = na -var line bullLine = na -var line bearLine = na - -// Activate sequences -if bullCnt >= i_dc_min_bars and bullCnt[1] < i_dc_min_bars - bullActive := true - bearActive := false - bullDone := false - bearDone := false - bullStart := bar_index - bullCnt + 1 -if bearCnt >= i_dc_min_bars and bearCnt[1] < i_dc_min_bars - bearActive := true - bullActive := false - bearDone := false - bullDone := false - bearStart := bar_index - bearCnt + 1 - -// Detect and mark retracements -bool bearRet = bearActive and not bearDone and ta.crossover(high, bearFib) and high[1] < bearFib and time_filter and date_filter -bool bullRet = bullActive and not bullDone and ta.crossunder(low, bullFib) and low[1] > bullFib and time_filter and date_filter -if bearRet and i_scn_choose == 'Retracement' and i_scn_show_short - bearDone := true - bearBar := bar_index - bearHigh := high - bearLine := line.new(x1 = bearStart, y1 = bearFib, x2 = bearBar, y2 = bearFib, color = i_neg_light_color, style = line.style_dotted) -if bullRet and i_scn_choose == 'Retracement' and i_scn_show_long - bullDone := true - bullBar := bar_index - bullLow := low - bullLine := line.new(x1 = bullStart, y1 = bullFib, x2 = bullBar, y2 = bullFib, color = i_pos_light_color, style = line.style_dotted) - -// Plot signals -plotshape(i_scn_show_short and i_scn_choose == 'Retracement' ? bearRet : false, title = 'Bearish Retracement', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny) -plotshape(i_scn_show_long and i_scn_choose == 'Retracement' ? bullRet : false, title = 'Bullish Retracement', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny) -barcolor(i_scn_show_short and i_scn_choose == 'Retracement' and bearRet ? i_neg_light_color : i_scn_show_long and i_scn_choose == 'Retracement' and bullRet ? i_pos_light_color : na, title = 'Retracement Candle') - -//___________________________ Displacement Candles End - -//___________________________ Get Symbols List for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -// Feed Function -feed(input_string) => - if na(input_string) or str.length(input_string) == 0 - [string(na), string(na)] - else - result = str.split(input_string, ',') - first_item = '' - for i = 0 to array.size(result) - 1 by 1 - trimmed = str.trim(array.get(result, i)) - if trimmed != '' - first_item := trimmed - break - remaining = str.replace(input_string, first_item + ',', '', 1) - [first_item, remaining] - -// Flexible Symbol Extraction -sym_split_arr = str.split(i_symbols, ',') -new_sym_arr = array.new_string(array.size(sym_split_arr), na) -for i = 0 to array.size(sym_split_arr) - 1 by 1 - trimmed = str.trim(array.get(sym_split_arr, i)) - if trimmed != '' - array.set(new_sym_arr, i, trimmed) - -// Assign symbols dynamically -t_01 = array.size(new_sym_arr) > 0 ? array.get(new_sym_arr, 0) : na -t_02 = array.size(new_sym_arr) > 1 ? array.get(new_sym_arr, 1) : na -t_03 = array.size(new_sym_arr) > 2 ? array.get(new_sym_arr, 2) : na -t_04 = array.size(new_sym_arr) > 3 ? array.get(new_sym_arr, 3) : na -t_05 = array.size(new_sym_arr) > 4 ? array.get(new_sym_arr, 4) : na -t_06 = array.size(new_sym_arr) > 5 ? array.get(new_sym_arr, 5) : na -t_07 = array.size(new_sym_arr) > 6 ? array.get(new_sym_arr, 6) : na -t_08 = array.size(new_sym_arr) > 7 ? array.get(new_sym_arr, 7) : na -t_09 = array.size(new_sym_arr) > 8 ? array.get(new_sym_arr, 8) : na -t_10 = array.size(new_sym_arr) > 9 ? array.get(new_sym_arr, 9) : na -t_11 = array.size(new_sym_arr) > 10 ? array.get(new_sym_arr, 10) : na -t_12 = array.size(new_sym_arr) > 11 ? array.get(new_sym_arr, 11) : na -t_13 = array.size(new_sym_arr) > 12 ? array.get(new_sym_arr, 12) : na -t_14 = array.size(new_sym_arr) > 13 ? array.get(new_sym_arr, 13) : na -t_15 = array.size(new_sym_arr) > 14 ? array.get(new_sym_arr, 14) : na -t_16 = array.size(new_sym_arr) > 15 ? array.get(new_sym_arr, 15) : na -t_17 = array.size(new_sym_arr) > 16 ? array.get(new_sym_arr, 16) : na -t_18 = array.size(new_sym_arr) > 17 ? array.get(new_sym_arr, 17) : na -t_19 = array.size(new_sym_arr) > 18 ? array.get(new_sym_arr, 18) : na -t_20 = array.size(new_sym_arr) > 19 ? array.get(new_sym_arr, 19) : na -t_21 = array.size(new_sym_arr) > 20 ? array.get(new_sym_arr, 20) : na -t_22 = array.size(new_sym_arr) > 21 ? array.get(new_sym_arr, 21) : na -t_23 = array.size(new_sym_arr) > 22 ? array.get(new_sym_arr, 22) : na -t_24 = array.size(new_sym_arr) > 23 ? array.get(new_sym_arr, 23) : na -t_25 = array.size(new_sym_arr) > 24 ? array.get(new_sym_arr, 24) : na -t_26 = array.size(new_sym_arr) > 25 ? array.get(new_sym_arr, 25) : na -t_27 = array.size(new_sym_arr) > 26 ? array.get(new_sym_arr, 26) : na -t_28 = array.size(new_sym_arr) > 27 ? array.get(new_sym_arr, 27) : na -t_29 = array.size(new_sym_arr) > 28 ? array.get(new_sym_arr, 28) : na -t_30 = array.size(new_sym_arr) > 29 ? array.get(new_sym_arr, 29) : na -t_31 = array.size(new_sym_arr) > 30 ? array.get(new_sym_arr, 30) : na -t_32 = array.size(new_sym_arr) > 31 ? array.get(new_sym_arr, 31) : na -t_33 = array.size(new_sym_arr) > 32 ? array.get(new_sym_arr, 32) : na -t_34 = array.size(new_sym_arr) > 33 ? array.get(new_sym_arr, 33) : na -t_35 = array.size(new_sym_arr) > 34 ? array.get(new_sym_arr, 34) : na -t_36 = array.size(new_sym_arr) > 35 ? array.get(new_sym_arr, 35) : na -t_37 = array.size(new_sym_arr) > 36 ? array.get(new_sym_arr, 36) : na -t_38 = array.size(new_sym_arr) > 37 ? array.get(new_sym_arr, 37) : na -t_39 = array.size(new_sym_arr) > 38 ? array.get(new_sym_arr, 38) : na -t_40 = array.size(new_sym_arr) > 39 ? array.get(new_sym_arr, 39) : na - -//___________________________ Get Symbols List for Screener End - -//___________________________ Scanner Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Scanner Conditions -bool short_cond = - i_scn_choose == 'Displacement' ? bearMaxCnt : bearRet - -bool long_cond = - i_scn_choose == 'Displacement' ? bullMaxCnt : bullRet - -// Indicator Calculation Function -indicator_calculation() => - // Declare variables with var for persistence - var int _time = na - var int bars = na - var float _range = na - var float pchg = na - var int signal = na - - if barstate.isconfirmed - // Single-line signal assignment - signal := i_scn_show_long and long_cond ? 1 : i_scn_show_short and short_cond ? -1 : na - - if not na(signal) - _time := time - bars := bearMaxCnt ? bearCnt[1] : bullMaxCnt ? bullCnt[1] : na //math.round_to_mintick(close) - _range := bearMaxCnt ? bearRangePercent[1] : bullMaxCnt ? bullRangePercent[1] : na - pchg := cum_pchg - - [_time, bars, _range, pchg, signal] - -// Time Formatting Function -format_time(x) => - str.format_time(x, timeframe.isintraday ? 'HH:mm dd-MM-yyyy' : 'dd-MM-yyyy', syminfo.timezone) - -// Symbol Extraction Function -ticker_extract(s) => - array.get(str.split(s, ':'), 1) - -// Matrix setup -var matrix = matrix.new(0, 6, na) - -// Add Rows Function -rows_to_matix(symbol, _time, bars, _range, pchg, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, bars, _range, pchg, signal)) - -// Scanner Function -scan(new_sym_arr) => - for i = 0 to array.size(new_sym_arr) - 1 by 1 - sym = ticker.modify(array.get(new_sym_arr, i), syminfo.session) - [_time, bars, _range, pchg, signal] = request.security(sym, timeframe.period, indicator_calculation()) - if not na(signal) and _time == time - rows_to_matix( - ticker_extract(array.get(new_sym_arr, i)), - format_time(_time), - str.tostring(bars), - str.tostring(_range, '#.##'), - str.tostring(pchg, '#.##'), - str.tostring(signal)) - -// Scan Symbols Array -scan(new_sym_arr) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scn_tbl_show_rows - while matrix.rows(matrix) > i_scn_tbl_show_rows - matrix.remove_row(matrix, matrix.rows(matrix) - 1) - -// Draw Table -var table tbl_scan = table.new(position = i_scn_tbl_pos, columns = 5, rows = 102, border_width = 1, force_overlay = true) - -// Cells Function -cell_scan_title(int _column, int _row, string _title, string tool_tip) => - table.cell(table_id = tbl_scan, column = _column, row = _row, text = _title, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size, tooltip = tool_tip) - -cell_scan(col, row, txt, _text_color) => - table.cell(tbl_scan, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size) - -string tt_bar = "Number of displacement candles." -string tt_pRng = "Percentage between the displacement candles." -string tt_pChg = "Percentage change of the day." - -// Scanner Table -if barstate.islast and i_scn_show_table - // Clear existing data in the table - table.clear(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 2, end_row = 101) - - cell_scan_title(0, 0, i_scn_choose, '') - table.merge_cells(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 4, end_row = 0) - cell_scan_title(0, 1, 'Symbol', '') - cell_scan_title(1, 1, 'Time', '') - cell_scan_title(2, 1, 'Bar', tt_bar) - cell_scan_title(3, 1, '%Rng', tt_pRng) - cell_scan_title(4, 1, '%Chg', tt_pChg) - j = 4 - - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 by 1 - color txt_color = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : na - - cell_scan(0, j, matrix.get(matrix, i, 0), txt_color) - cell_scan(1, j, matrix.get(matrix, i, 1), txt_color) - cell_scan(2, j, matrix.get(matrix, i, 2), txt_color) - cell_scan(3, j, matrix.get(matrix, i, 3), txt_color) - cell_scan(4, j, matrix.get(matrix, i, 4), txt_color) - j := j + 1 - -//___________________________ Scanner End - -//___________________________ Code End - -// Readme -// -// Indicator Title: "ICT Displacement Candles Scanner" -// -// Overview -// - A price action trading method based on strong price moves (displacement). -// - Helps identify trend direction and potential trade entries. -// -// Features -// - Scanning Methods: -// - Displacement: Strong, sudden price move (up/down) with long candles, minimal wicks. -// - Retracement: Price retraces to a Fibonacci level of the displacement. -// -// How to Use? -// 1. Identify Displacement: Look for strong price movement after liquidity is taken. -// 2. Wait for Retracement: Use Fibonacci to find entry levels (e.g., 61.8%). -// 3. Confirm with Order Blocks or Fair Value Gap(FVG): Ensure price reacts at an institutional level. -// 4. Enter Trade: Buy or sell based on trend continuation signals. -// 5. Set Targets: Aim for the next liquidity zone. -// -// Note: Read tooltips for more clarity. -// -// Questions?: Message the author on TradingView: https://www.tradingview.com/u/Arun_K_Bhaskar/ -// -// More Indicators: Free TradingView indicators and source code on GitHub: https://github.com/ArunKBhaskar/PineScript +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=6 +indicator(title = 'ICT Displacement Candles Scanner', shorttitle = 'ICTDCScan', overlay = true, max_lines_count = 500, max_labels_count = 500, behind_chart = false) + +//___________________________ Menu Start + +string g_scn_tb = '█████████████████ Scanner █████████████████' + +string tt_ch = + "Displacement:" + + "\n• Strong, sudden price move (up/down) with long candles, minimal wicks." + + + "\n\n Retracement:" + + "\n• Price retraces to a Fibonacci level of the displacement." + + "\n• Potential entry point for trend continuation." + +string tt_is = + "• Reads only the first 40 symbols." + + "\n• Max 4096 characters." + + "\n• Format: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_scn_choose = input.string( + defval = 'Displacement', + title = 'Scanning Method', + options = ['Displacement', 'Retracement'], tooltip = tt_ch, group = g_scn_tb) + +string i_symbols = input.text_area( + defval = 'NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:BIOCON,NSE:BPCL,NSE:CESC,NSE:DELHIVERY,NSE:FEDERALBNK,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IGL,NSE:IIFL,NSE:INDUSTOWER,NSE:IOC,NSE:IREDA,NSE:IRFC,NSE:JIOFIN,NSE:LTF,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:M_MFIN,NSE:NATIONALUM,NSE:NCC,NSE:NYKAA,NSE:ONGC,NSE:PETRONET,NSE:POWERGRID,NSE:RBLBANK,NSE:SAIL,NSE:TATASTEEL,NSE:UNIONBANK,NSE:WIPRO,NSE:ETERNAL', + title = 'Paste Symbols', tooltip = tt_is, group = g_scn_tb) + +bool i_scn_show_table = input.bool(defval = true, title = 'Display Table', group = g_scn_tb) +bool i_scn_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scn_tb) +bool i_scn_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scn_tb) + +int i_scn_tbl_show_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scn_tb) +string i_scn_tbl_pos = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scn_tb) +string i_scn_tbl_txt_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scn_tb) + +string g_dc = '████████████ Displacement Candles ████████████' + +string tt_mb = "Shows if bars exceed the set value." +string tt_dev = "Specifies the minimal size of displament, as a percentage of the average high-low range for the last 14 bars." +string tt_ret_fib = + "• 0: Top of bullish & bottom of bearish displacement." + + "\n• 1: Bottom of bullish & top of bearish displacement." + + "\n• 0.5: 50% of the displacement." + +int i_dc_min_bars = input.int(defval = 3, title = 'Minimum Bars', minval = 1, tooltip = tt_mb, group = g_dc) +float i_dc_dev_percent = nz(input.float(60.0, "Minimal Deviation (%)", minval=1, step = 10, tooltip = tt_dev, group = g_dc) / 100 * ta.sma(high-low, 14)) +bool i_dc_close_filter = input.bool(defval = true, title = 'Apply Close Above/Below Prev Close', group = g_dc) +bool i_dc_hl_filter = input.bool(defval = false, title = 'Apply Close Above/Below Prev High/Low', group = g_dc) +float i_dc_fib_val = input.float(defval = 0.5, title = 'Fibonacci Value', step = 0.1, tooltip = tt_ret_fib, group = g_dc) + +string g_af = '██████████████ Additional Fiters ██████████████' + +string tt_atr = "• Filters out longer or more volatile displacement candles." +string tt_atr_mul = "• Higher values filter longer or more volatile candles." +string tt_bf = "• 80 means the body covers 80%+ of the displacement candle." +string tt_tf = "• Filter signals within a given time." +string tt_df = "• Filter signals on specified dates (for Retracement Candles only)." + +bool i_atr_filter = input.bool(defval = false, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) +int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) +float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) + +bool i_body_filter = input.bool(defval = false, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) +float i_body_percent = input.float(defval = 70, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 + +bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) +int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) +int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) +int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) +int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) + +bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) +int i_day = input.int(defval = 30, minval = 1, maxval = 31, title = 'Day', group = g_af) +int i_month = input.int(defval = 3, minval = 1, maxval = 12, title = 'Month', group = g_af) +int i_year = input.int(defval = 2025, minval = 0, title = 'Year', group = g_af) + +string g_cum = '█████████████ Performance Table █████████████' + +bool i_cum_tbl_disp = input.bool(defval = true, title = 'Display', group = g_cum) +string i_cum_tbl_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_cum) +string i_cum_tbl_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_cum) + +//string g_ch = '█████████████████ Colors █████████████████' +color i_pos_color = #089981 //input.color(defval = #089981, title = 'Positive', group = g_ch) +color i_pos_light_color = #70CCBD //input.color(defval = #70CCBD, title = 'Positive Light', group = g_ch) +color i_neg_light_color = #FAA1A4 //input.color(defval = #FAA1A4, title = 'Negative Light', group = g_ch) +color i_neg_color = #F23645 //input.color(defval = #F23645, title = 'Negative', group = g_ch) +color i_neu_color = #D1D4DC //input.color(defval = #D1D4DC, title = 'Neutral Light', group = g_ch) +color i_neu_dark_color = #0F0F0F //input.color(defval = #0F0F0F, title = 'Neutral', group = g_ch) + +//___________________________ Menu End + +//___________________________ Performance Start + +is_new_day = ta.change(time('D')) != 0 + +// Cumulative Percentage Change +var float cum_pchg = na +day_pchg = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 +cum_pchg := is_new_day ? day_pchg : na(cum_pchg) ? day_pchg : cum_pchg + day_pchg + +// Cumulative Volume and Volume Percentage Change +var float curr_cum_vol = na +var float prev_cum_vol = na +if is_new_day + prev_cum_vol := curr_cum_vol + curr_cum_vol := volume + curr_cum_vol +else + curr_cum_vol := na(curr_cum_vol) ? volume : curr_cum_vol + volume + curr_cum_vol +prev_vol_safe = nz(prev_cum_vol, curr_cum_vol) +cum_vol_pchg = (curr_cum_vol - prev_vol_safe) / prev_vol_safe * 100 + +var table tbl_cum = table.new(position=i_cum_tbl_pos, columns=2, rows=4, border_width=1, force_overlay=true) + +cell_perform(col, row, txt, txt_color, aligh) => + table.cell(tbl_cum, col, row, txt, text_color=txt_color, text_halign=aligh, bgcolor=i_neu_dark_color, text_size=i_cum_tbl_size) + +if barstate.islast and i_cum_tbl_disp + pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color + vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color + prev_vol_pchg_col = prev_vol_safe < curr_cum_vol ? i_neg_color : i_pos_color + + cell_perform(0, 0, '%Chg', chart.fg_color, text.align_left) + cell_perform(1, 0, str.tostring(cum_pchg, '#.##') + ' %', pchg_col, text.align_right) + cell_perform(0, 1, 'Vol %Chg', chart.fg_color, text.align_left) + cell_perform(1, 1, str.tostring(cum_vol_pchg, '#.##') + ' %', vol_pchg_col, text.align_right) + cell_perform(0, 2, 'Vol', chart.fg_color, text.align_left) + cell_perform(1, 2, str.tostring(curr_cum_vol / 100000, '#.##') + ' L', vol_pchg_col, text.align_right) + cell_perform(0, 3, 'PD Vol', chart.fg_color, text.align_left) + cell_perform(1, 3, str.tostring(prev_vol_safe / 100000, '#.##') + ' L', prev_vol_pchg_col, text.align_right) + +//___________________________ Performance End + +//___________________________ Additional Filters Start + +// Pre-calculate common values +candle_range = high - low +body_size = math.abs(close - open) + +// ATR Filter +atr_filter = not i_atr_filter or candle_range > ta.atr(i_atr_length) * i_atr_multi + +// Body Filters +body_filter = not i_body_filter or candle_range > 0 and body_size / candle_range >= i_body_percent + +// Time Filter +time_filter = + not i_time_filter or + (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and + (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) + +// Date Filter +date_filter = not i_date_filter or year == i_year and month == i_month and dayofmonth == i_day + +//___________________________ Additional Filters End + +//___________________________ Displacement Candles Start + +// Combined tracking variables +var int bullCnt = 0 +var int bearCnt = 0 +var float bullHi = na +var float bullLo = na +var float bearHi = na +var float bearLo = na +var float bullFib = na +var float bearFib = na +var bullHighs = array.new_float() +var bullLows = array.new_float() +var bearHighs = array.new_float() +var bearLows = array.new_float() + +// Conditions and filters combined +float priceChg = (high - low) +bool bullish = priceChg >= i_dc_dev_percent and close > open and (not i_dc_close_filter or close > close[1]) and (not i_dc_hl_filter or close > high[1]) and atr_filter +bool bearish = priceChg >= i_dc_dev_percent and close < open and (not i_dc_close_filter or close < close[1]) and (not i_dc_hl_filter or close < low[1]) and atr_filter + +// Optimized counting and array management +if bullish + bullCnt := bullCnt + 1 + bearCnt := 0 + array.push(bullHighs, high) + array.push(bullLows, low) + if bullCnt == 1 + array.clear(bearHighs) + array.clear(bearLows) +else if bearish + bearCnt := bearCnt + 1 + bullCnt := 0 + array.push(bearHighs, high) + array.push(bearLows, low) + if bearCnt == 1 + array.clear(bullHighs) + array.clear(bullLows) +else + bullCnt := 0 + bearCnt := 0 + array.clear(bullHighs) + array.clear(bullLows) + array.clear(bearHighs) + array.clear(bearLows) + +// Calculate high-low range and percentage +float bullRange = na +float bearRange = na +float bullRangePercent = na +float bearRangePercent = na + +if bullCnt >= i_dc_min_bars + bullHi := array.max(bullHighs) + bullLo := array.min(bullLows) + bullRange := bullHi - bullLo + bullRangePercent := (bullRange / bullLo) * 100 + bullFib := bullHi - (bullHi - bullLo) * i_dc_fib_val +if bearCnt >= i_dc_min_bars + bearHi := array.max(bearHighs) + bearLo := array.min(bearLows) + bearRange := bearHi - bearLo + bearRangePercent := (bearRange / bearLo) * 100 + bearFib := bearLo + (bearHi - bearLo) * i_dc_fib_val + +bearMaxCnt = bearCnt[1] >= i_dc_min_bars and bearCnt == 0 +bullMaxCnt = bullCnt[1] >= i_dc_min_bars and bullCnt == 0 + +// Plot +if bearMaxCnt and i_scn_show_short + label.new(x = bar_index[1], y = low[1], text = str.tostring(bearCnt[1]), color = na, textcolor = i_neg_light_color, size = size.small, style = label.style_label_up, yloc = yloc.belowbar) +// label.new(x = bar_index[1], y = low[1], text = str.format("{0,number,#.##}%", bearRangePercent[1]), color = na, textcolor = i_neg_light_color, size = size.small, style = label.style_label_up, yloc = yloc.belowbar) + +if bullMaxCnt and i_scn_show_long + label.new(x = bar_index[1], y = high[1], text = str.tostring(bullCnt[1]), color = na, textcolor = i_pos_light_color, size = size.small, style = label.style_label_down, yloc = yloc.abovebar) +// label.new(x = bar_index[1], y = high[1], text = str.format("{0,number,#.##}%", bullRangePercent[1]), color = na, textcolor = i_pos_light_color, size = size.small, style = label.style_label_down, yloc = yloc.abovebar) + +// Plot counts +//if bearCnt >= i_dc_min_bars and i_scn_show_short +// label.new(x = bar_index, y = low, text = str.tostring(bearCnt), color = na, textcolor = i_neg_light_color, size = size.small, style = label.style_label_up, yloc = yloc.belowbar) +//if bullCnt >= i_dc_min_barst and i_scn_show_long +// label.new(x = bar_index, y = high, text = str.tostring(bullCnt), color = na, textcolor = i_pos_light_color, size = size.small, style = label.style_label_down, yloc = yloc.abovebar) + +plot(series = bearFib, title = 'Bearish Fib Line', color = i_neg_color, style = plot.style_stepline, display = display.none) +plot(series = bullFib, title = 'Bullish Fib Line', color = i_pos_color, style = plot.style_stepline, display = display.none) + +// Track the final count before reset +var int lastBullCnt = 0 +var int lastBearCnt = 0 + +// Update when sequence ends +if bullMaxCnt + lastBullCnt := bullCnt[1] +if bearMaxCnt + lastBearCnt := bearCnt[1] + +// Retracement tracking combined +var bool bullActive = false +var bool bearActive = false +var bool bullDone = false +var bool bearDone = false +var int bullBar = na +var int bearBar = na +var int bullStart = na +var int bearStart = na +var float bullLow = na +var float bearHigh = na +var line bullLine = na +var line bearLine = na + +// Activate sequences +if bullCnt >= i_dc_min_bars and bullCnt[1] < i_dc_min_bars + bullActive := true + bearActive := false + bullDone := false + bearDone := false + bullStart := bar_index - bullCnt + 1 +if bearCnt >= i_dc_min_bars and bearCnt[1] < i_dc_min_bars + bearActive := true + bullActive := false + bearDone := false + bullDone := false + bearStart := bar_index - bearCnt + 1 + +// Detect and mark retracements +bool bearRet = bearActive and not bearDone and ta.crossover(high, bearFib) and high[1] < bearFib and time_filter and date_filter +bool bullRet = bullActive and not bullDone and ta.crossunder(low, bullFib) and low[1] > bullFib and time_filter and date_filter +if bearRet and i_scn_choose == 'Retracement' and i_scn_show_short + bearDone := true + bearBar := bar_index + bearHigh := high + bearLine := line.new(x1 = bearStart, y1 = bearFib, x2 = bearBar, y2 = bearFib, color = i_neg_light_color, style = line.style_dotted) +if bullRet and i_scn_choose == 'Retracement' and i_scn_show_long + bullDone := true + bullBar := bar_index + bullLow := low + bullLine := line.new(x1 = bullStart, y1 = bullFib, x2 = bullBar, y2 = bullFib, color = i_pos_light_color, style = line.style_dotted) + +// Plot signals +plotshape(i_scn_show_short and i_scn_choose == 'Retracement' ? bearRet : false, title = 'Bearish Retracement', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny) +plotshape(i_scn_show_long and i_scn_choose == 'Retracement' ? bullRet : false, title = 'Bullish Retracement', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny) +barcolor(i_scn_show_short and i_scn_choose == 'Retracement' and bearRet ? i_neg_light_color : i_scn_show_long and i_scn_choose == 'Retracement' and bullRet ? i_pos_light_color : na, title = 'Retracement Candle') + +//___________________________ Displacement Candles End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//___________________________ Get Symbols List for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +// Feed Function +feed(input_string) => + if na(input_string) or str.length(input_string) == 0 + [string(na), string(na)] + else + result = str.split(input_string, ',') + first_item = '' + for i = 0 to array.size(result) - 1 by 1 + trimmed = str.trim(array.get(result, i)) + if trimmed != '' + first_item := trimmed + break + remaining = str.replace(input_string, first_item + ',', '', 1) + [first_item, remaining] + +// Flexible Symbol Extraction +sym_split_arr = str.split(effective_symbols, ',') +new_sym_arr = array.new_string(array.size(sym_split_arr), na) +for i = 0 to array.size(sym_split_arr) - 1 by 1 + trimmed = str.trim(array.get(sym_split_arr, i)) + if trimmed != '' + array.set(new_sym_arr, i, trimmed) + +// Assign symbols dynamically +t_01 = array.size(new_sym_arr) > 0 ? array.get(new_sym_arr, 0) : na +t_02 = array.size(new_sym_arr) > 1 ? array.get(new_sym_arr, 1) : na +t_03 = array.size(new_sym_arr) > 2 ? array.get(new_sym_arr, 2) : na +t_04 = array.size(new_sym_arr) > 3 ? array.get(new_sym_arr, 3) : na +t_05 = array.size(new_sym_arr) > 4 ? array.get(new_sym_arr, 4) : na +t_06 = array.size(new_sym_arr) > 5 ? array.get(new_sym_arr, 5) : na +t_07 = array.size(new_sym_arr) > 6 ? array.get(new_sym_arr, 6) : na +t_08 = array.size(new_sym_arr) > 7 ? array.get(new_sym_arr, 7) : na +t_09 = array.size(new_sym_arr) > 8 ? array.get(new_sym_arr, 8) : na +t_10 = array.size(new_sym_arr) > 9 ? array.get(new_sym_arr, 9) : na +t_11 = array.size(new_sym_arr) > 10 ? array.get(new_sym_arr, 10) : na +t_12 = array.size(new_sym_arr) > 11 ? array.get(new_sym_arr, 11) : na +t_13 = array.size(new_sym_arr) > 12 ? array.get(new_sym_arr, 12) : na +t_14 = array.size(new_sym_arr) > 13 ? array.get(new_sym_arr, 13) : na +t_15 = array.size(new_sym_arr) > 14 ? array.get(new_sym_arr, 14) : na +t_16 = array.size(new_sym_arr) > 15 ? array.get(new_sym_arr, 15) : na +t_17 = array.size(new_sym_arr) > 16 ? array.get(new_sym_arr, 16) : na +t_18 = array.size(new_sym_arr) > 17 ? array.get(new_sym_arr, 17) : na +t_19 = array.size(new_sym_arr) > 18 ? array.get(new_sym_arr, 18) : na +t_20 = array.size(new_sym_arr) > 19 ? array.get(new_sym_arr, 19) : na +t_21 = array.size(new_sym_arr) > 20 ? array.get(new_sym_arr, 20) : na +t_22 = array.size(new_sym_arr) > 21 ? array.get(new_sym_arr, 21) : na +t_23 = array.size(new_sym_arr) > 22 ? array.get(new_sym_arr, 22) : na +t_24 = array.size(new_sym_arr) > 23 ? array.get(new_sym_arr, 23) : na +t_25 = array.size(new_sym_arr) > 24 ? array.get(new_sym_arr, 24) : na +t_26 = array.size(new_sym_arr) > 25 ? array.get(new_sym_arr, 25) : na +t_27 = array.size(new_sym_arr) > 26 ? array.get(new_sym_arr, 26) : na +t_28 = array.size(new_sym_arr) > 27 ? array.get(new_sym_arr, 27) : na +t_29 = array.size(new_sym_arr) > 28 ? array.get(new_sym_arr, 28) : na +t_30 = array.size(new_sym_arr) > 29 ? array.get(new_sym_arr, 29) : na +t_31 = array.size(new_sym_arr) > 30 ? array.get(new_sym_arr, 30) : na +t_32 = array.size(new_sym_arr) > 31 ? array.get(new_sym_arr, 31) : na +t_33 = array.size(new_sym_arr) > 32 ? array.get(new_sym_arr, 32) : na +t_34 = array.size(new_sym_arr) > 33 ? array.get(new_sym_arr, 33) : na +t_35 = array.size(new_sym_arr) > 34 ? array.get(new_sym_arr, 34) : na +t_36 = array.size(new_sym_arr) > 35 ? array.get(new_sym_arr, 35) : na +t_37 = array.size(new_sym_arr) > 36 ? array.get(new_sym_arr, 36) : na +t_38 = array.size(new_sym_arr) > 37 ? array.get(new_sym_arr, 37) : na +t_39 = array.size(new_sym_arr) > 38 ? array.get(new_sym_arr, 38) : na +t_40 = array.size(new_sym_arr) > 39 ? array.get(new_sym_arr, 39) : na + +//___________________________ Get Symbols List for Screener End + +//___________________________ Scanner Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Scanner Conditions +bool short_cond = + i_scn_choose == 'Displacement' ? bearMaxCnt : bearRet + +bool long_cond = + i_scn_choose == 'Displacement' ? bullMaxCnt : bullRet + +// Indicator Calculation Function +indicator_calculation() => + // Declare variables with var for persistence + var int _time = na + var int bars = na + var float _range = na + var float pchg = na + var int signal = na + + if barstate.isconfirmed + // Single-line signal assignment + signal := i_scn_show_long and long_cond ? 1 : i_scn_show_short and short_cond ? -1 : na + + if not na(signal) + _time := time + bars := bearMaxCnt ? bearCnt[1] : bullMaxCnt ? bullCnt[1] : na //math.round_to_mintick(close) + _range := bearMaxCnt ? bearRangePercent[1] : bullMaxCnt ? bullRangePercent[1] : na + pchg := cum_pchg + + [_time, bars, _range, pchg, signal] + +// Time Formatting Function +format_time(x) => + str.format_time(x, timeframe.isintraday ? 'HH:mm dd-MM-yyyy' : 'dd-MM-yyyy', syminfo.timezone) + +// Symbol Extraction Function +ticker_extract(s) => + array.get(str.split(s, ':'), 1) + +// Matrix setup +var matrix = matrix.new(0, 6, na) + +// Add Rows Function +rows_to_matix(symbol, _time, bars, _range, pchg, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, bars, _range, pchg, signal)) + +// Scanner Function +scan(new_sym_arr) => + for i = 0 to array.size(new_sym_arr) - 1 by 1 + [_time, bars, _range, pchg, signal] = request.security(array.get(new_sym_arr, i), timeframe.period, indicator_calculation()) + if not na(signal) and _time == time + rows_to_matix( + ticker_extract(array.get(new_sym_arr, i)), + format_time(_time), + str.tostring(bars), + str.tostring(_range, '#.##'), + str.tostring(pchg, '#.##'), + str.tostring(signal)) + +// Scan Symbols Array +scan(new_sym_arr) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scn_tbl_show_rows + while matrix.rows(matrix) > i_scn_tbl_show_rows + matrix.remove_row(matrix, matrix.rows(matrix) - 1) + +// Draw Table +var table tbl_scan = table.new(position = i_scn_tbl_pos, columns = 5, rows = 102, border_width = 1, force_overlay = true) + +// Cells Function +cell_scan_title(int _column, int _row, string _title, string tool_tip) => + table.cell(table_id = tbl_scan, column = _column, row = _row, text = _title, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size, tooltip = tool_tip) + +cell_scan(col, row, txt, _text_color) => + table.cell(tbl_scan, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size) + +string tt_bar = "Number of displacement candles." +string tt_pRng = "Percentage between the displacement candles." +string tt_pChg = "Percentage change of the day." + +// Scanner Table +if barstate.islast and i_scn_show_table + // Clear existing data in the table + table.clear(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 2, end_row = 101) + + cell_scan_title(0, 0, i_scn_choose, '') + table.merge_cells(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 4, end_row = 0) + cell_scan_title(0, 1, 'Symbol', '') + cell_scan_title(1, 1, 'Time', '') + cell_scan_title(2, 1, 'Bar', tt_bar) + cell_scan_title(3, 1, '%Rng', tt_pRng) + cell_scan_title(4, 1, '%Chg', tt_pChg) + j = 4 + + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 by 1 + color txt_color = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : na + + cell_scan(0, j, matrix.get(matrix, i, 0), txt_color) + cell_scan(1, j, matrix.get(matrix, i, 1), txt_color) + cell_scan(2, j, matrix.get(matrix, i, 2), txt_color) + cell_scan(3, j, matrix.get(matrix, i, 3), txt_color) + cell_scan(4, j, matrix.get(matrix, i, 4), txt_color) + j := j + 1 + +//___________________________ Scanner End + +//___________________________ Code End + +// Readme +// +// Indicator Title: "ICT Displacement Candles Scanner" +// +// Overview +// - A price action trading method based on strong price moves (displacement). +// - Helps identify trend direction and potential trade entries. +// +// Features +// - Scanning Methods: +// - Displacement: Strong, sudden price move (up/down) with long candles, minimal wicks. +// - Retracement: Price retraces to a Fibonacci level of the displacement. +// +// How to Use? +// 1. Identify Displacement: Look for strong price movement after liquidity is taken. +// 2. Wait for Retracement: Use Fibonacci to find entry levels (e.g., 61.8%). +// 3. Confirm with Order Blocks or Fair Value Gap(FVG): Ensure price reacts at an institutional level. +// 4. Enter Trade: Buy or sell based on trend continuation signals. +// 5. Set Targets: Aim for the next liquidity zone. +// +// Note: Read tooltips for more clarity. +// +// Questions?: Message the author on TradingView: https://www.tradingview.com/u/Arun_K_Bhaskar/ +// +// More Indicators: Free TradingView indicators and source code on GitHub: https://github.com/ArunKBhaskar/PineScript + diff --git a/ICT Equal Highs and Lows/ICT Equal Highs and Lows with Screener.txt b/ICT Equal Highs and Lows/ICT Equal Highs and Lows with Screener.txt index 42d5229..9ca9ebc 100644 --- a/ICT Equal Highs and Lows/ICT Equal Highs and Lows with Screener.txt +++ b/ICT Equal Highs and Lows/ICT Equal Highs and Lows with Screener.txt @@ -1,296 +1,520 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -i_max_bars_back = 300 -indicator(title="ICT Equal Highs and Lows with Screener", shorttitle="Equal HL Scr", overlay=true, max_bars_back=i_max_bars_back, max_lines_count=500, max_labels_count=500) - -//_____________________________ Menu Screener Start - -g_tb = '█████████████████ Screener █████████████████' - -string i_scr_choose = input.string(defval='Equals', title='Screening Method', options=['Equals', 'Equals Sweep'], group=g_tb) - -tt_is = "• Input exactly 40 symbols, nothing more or less." + - "\n• Total characters cannot exceed 4096." + - "\n• Use comma as delimiter without any space." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" -string i_symbols = input.text_area( - defval="NSE:AEGISCHEM,NSE:BANKINDIA,NSE:BHEL,NSE:BLS,NSE:CASTROLIND,NSE:CESC,NSE:ENGINERSIN,NSE:EQUITASBNK,NSE:FSL,NSE:GICRE,NSE:GPPL,NSE:GSPL,NSE:HFCL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IBULHSGFIN,NSE:INDIACEM,NSE:INDUSTOWER,NSE:IOC,NSE:IRCON,NSE:IRFC,NSE:KARURVYSYA,NSE:NATIONALUM,NSE:NETWORK18,NSE:NIACL,NSE:NLCINDIA,NSE:PCBL,NSE:PFC,NSE:PNB,NSE:PNCINFRA,NSE:RVNL,NSE:SAIL,NSE:SJVN,NSE:TTML,NSE:UNIONBANK,NSE:USHAMART,NSE:VAIBHAVGBL,NSE:WELSPUNLIV,NSE:ZEEL,NSE:ZOMATO,", - title="Paste Symbols", tooltip=tt_is, group=g_tb) - -string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) -bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) -bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) - -int i_tbl_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) -string i_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) -string i_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) - -//_____________________________ Menu Screener End - -//____________________________ Menu Pivot High Low Start - -g_phl_eq = '███████████████ Equal High Low ███████████████' -int i_phl_1_left = input.int(defval=60, title='Left', group=g_phl_eq) -int i_phl_1_right = input.int(defval=30, title='Right', group=g_phl_eq) -tt_eq = "Lower values mean highs and lows are closer." -float i_phl_eq_percent = input.float(defval=0.05, minval=0, step=0.01, title='Equal HL %', tooltip=tt_eq, group=g_phl_eq) -string i_phl_1_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close'], group=g_phl_eq) -color i_phl_1_h_ln_color = input.color(defval=#F7525F, title='Bearish Color', group=g_phl_eq) -color i_phl_1_l_ln_color = input.color(defval=#22AB94, title='Bullish Color', group=g_phl_eq) -color i_phl_txt_color = input.color(defval=#B2B5BE, title='Neutral Color', group=g_phl_eq) -int i_phl_eq_transp = input.int(defval=25, minval=0, title='Transparency', group=g_phl_eq) - -//____________________________ Menu Pivot High Low End - -//____________________________ Equal High Low Start - -// Get Source -float _high = i_phl_1_source == 'Open/Close' ? math.max(open, close) : high -float _low = i_phl_1_source == 'Open/Close' ? math.min(open, close) : low - -// Arrays to store the last 2 pivot highs and lows -var float[] ph_arr = array.new_float(2) -var int[] ph_bi_arr = array.new_int(2) -var float[] pl_arr = array.new_float(2) -var int[] pl_bi_arr = array.new_int(2) - -// Pivot calculations -int prev_ph_bi = na, int prev_pl_bi = na -bool ph = false, bool pl = false - -phl_1_ph = ta.pivothigh(_high, i_phl_1_left, i_phl_1_right) -phl_1_pl = ta.pivotlow(_low, i_phl_1_left, i_phl_1_right) - -// Update the arrays with the last 2 pivot highs and lows -if not na(phl_1_ph) - ph := true - prev_ph_bi := bar_index - i_phl_1_right - array.unshift(ph_bi_arr, bar_index) - array.pop(ph_bi_arr) - -if not na(phl_1_pl) - pl := true - prev_pl_bi := bar_index - i_phl_1_right - array.unshift(pl_bi_arr, bar_index) - array.pop(pl_bi_arr) - -// Function to update the arrays with the last 2 values -update_arrays(value, array_ref) => - array.unshift(array_ref, value) - array.pop(array_ref) - -// Update arrays with the last 2 pivot highs and lows -if ph - update_arrays(phl_1_ph, ph_arr) -if pl - update_arrays(phl_1_pl, pl_arr) - -// Get last two pivot highs and lows -ph_price_0 = array.get(ph_arr, 0), ph_price_1 = array.get(ph_arr, 1) -ph_bi_0 = array.get(ph_bi_arr, 0), ph_bi_1 = array.get(ph_bi_arr, 1) - -pl_price_0 = array.get(pl_arr, 0), pl_price_1 = array.get(pl_arr, 1) -pl_bi_0 = array.get(pl_bi_arr, 0), pl_bi_1 = array.get(pl_bi_arr, 1) - -// Function to calculate percentage change -pchg(price_1, price_2) => - change = price_1 - price_2 - percent_change = math.abs((change / price_2) * 100) - percent_change - -// Calculate percentage change between the last two pivot highs and lows -var float ph_pchg = na -var float pl_pchg = na - -if array.size(ph_arr) >= 2 - ph_pchg := pchg(array.get(ph_arr, 0), array.get(ph_arr, 1)) - -if array.size(pl_arr) >= 2 - pl_pchg := pchg(array.get(pl_arr, 0), array.get(pl_arr, 1)) - -// Draw Equals Box -var levelBoxes_equal = array.new_box() - -ph_condition = ph and ph_pchg < i_phl_eq_percent and barstate.isconfirmed -pl_condition = pl and pl_pchg < i_phl_eq_percent and barstate.isconfirmed - -if ph_condition - ph_box = box.new(left=ph_bi_1 - i_phl_1_right, top=ph_price_1, right=ph_bi_0 - i_phl_1_right, bottom=ph_price_0, border_color=color.new(i_phl_1_h_ln_color, i_phl_eq_transp), bgcolor=color.new(i_phl_1_h_ln_color, i_phl_eq_transp)) - array.push(levelBoxes_equal, ph_box) - -if pl_condition - pl_box = box.new(left=pl_bi_1 - i_phl_1_right, top=pl_price_1, right=pl_bi_0 - i_phl_1_right, bottom=pl_price_0, border_color=color.new(i_phl_1_l_ln_color, i_phl_eq_transp), bgcolor=color.new(i_phl_1_l_ln_color, i_phl_eq_transp)) - array.push(levelBoxes_equal, pl_box) - -// Plot Equal Labels -plotshape(ph_condition ? high[i_phl_1_right] : na, style=shape.xcross, location=location.absolute, offset=-i_phl_1_right, color=color.new(i_phl_1_h_ln_color, i_phl_eq_transp), size=size.small) -plotshape(pl_condition ? low[i_phl_1_right] : na, style=shape.xcross, location=location.absolute, offset=-i_phl_1_right, color=color.new(i_phl_1_l_ln_color, i_phl_eq_transp), size=size.small) - -//____________________________ Equal High Low End - -//____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_001, out_001] = feed(i_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), -[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), -[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), -[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), -[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), -[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), -[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), -[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), -[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), -[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) - -//____________________________ Get Symbols for Screener End - -// _____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Choose Screening Method -bull_method = - i_scr_choose == 'Equals' ? ph_condition : - ph_pchg < i_phl_eq_percent and ta.crossover(high, ph_price_0) and barstate.isconfirmed - -bear_method = - i_scr_choose == 'Equals' ? pl_condition : - pl_pchg < i_phl_eq_percent and ta.crossunder(low, pl_price_0) and barstate.isconfirmed - -// Screener Conditions -bullish_cond = bull_method -bearish_cond = bear_method - -// Define Bull and Bear Conditions -bull = not(i_scr_direction == "Bearish") -bear = not(i_scr_direction == "Bullish") - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - indicator = "" - signal = int(na) - - if barstate.isconfirmed - // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_bull and bearish_cond and bear - indicator := "L" - signal := -1 - - // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_bear and bullish_cond and bull - indicator := "H" - signal := 1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - - [_time, indicator, price, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 5, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, indicator, price, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, indicator, price, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, indicator, price, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, indicator, strPrice, strSignal) - -// Call Screener function for multiple symbols -screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), -screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), -screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), -screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), -screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), -screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_tbl_disp_rows - while matrix.rows(matrix) > i_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table tbl = table.new(position=i_tbl_position, columns=4, rows=102, border_width=1) - -// Function to populate cells in the table -cell(col, row, txt, color) => - table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) - -// Check if it's the last bar -if barstate.islast - // Clear existing data in the table - table.clear(tbl, 0, 0, 3, 101) - - // Set headers for the table - cell(0, 0, "Symbol", i_phl_txt_color) - cell(1, 0, "Time", i_phl_txt_color) - cell(2, 0, "Dir" , i_phl_txt_color) - cell(3, 0, "Price", i_phl_txt_color) - - j = 1 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - col = matrix.get(matrix, i, 4) == "1" ? i_phl_1_h_ln_color : - matrix.get(matrix, i, 4) == "-1" ? i_phl_1_l_ln_color : i_phl_txt_color - - // Populate cells in the table - cell(0, j, matrix.get(matrix, i, 0), col) - cell(1, j, matrix.get(matrix, i, 1), col) - cell(2, j, matrix.get(matrix, i, 2), col) - cell(3, j, matrix.get(matrix, i, 3), col) - - j += 1 - -// _____________________________ Screener End - -// _____________________________ Code End +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +i_max_bars_back = 300 +indicator(title="ICT Equal Highs and Lows with Screener", shorttitle="Equal HL Scr", overlay=true, max_bars_back=i_max_bars_back, max_lines_count=500, max_labels_count=500) + +//_____________________________ Menu Screener Start + +g_tb = '█████████████████ Screener █████████████████' + +string i_scr_choose = input.string(defval='Equals', title='Screening Method', options=['Equals', 'Equals Sweep'], group=g_tb) + +tt_is = "• Input exactly 40 symbols, nothing more or less." + + "\n• Total characters cannot exceed 4096." + + "\n• Use comma as delimiter without any space." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" +string i_symbols = input.text_area( + defval="NSE:AEGISLOG,NSE:BANKINDIA,NSE:BHEL,NSE:BLS,NSE:CASTROLIND,NSE:CESC,NSE:ENGINERSIN,NSE:EQUITASBNK,NSE:FSL,NSE:GICRE,NSE:GPPL,BSE:GSPL,NSE:HFCL,NSE:HINDCOPPER,NSE:HUDCO,NSE:SAMMAANCAP,NSE:INDIACEM,NSE:INDUSTOWER,NSE:IOC,NSE:IRCON,NSE:IRFC,NSE:KARURVYSYA,NSE:NATIONALUM,NSE:NETWORK18,NSE:NIACL,NSE:NLCINDIA,NSE:PCBL,NSE:PFC,NSE:PNB,NSE:PNCINFRA,NSE:RVNL,NSE:SAIL,NSE:SJVN,NSE:TTML,NSE:UNIONBANK,NSE:USHAMART,NSE:VAIBHAVGBL,NSE:WELSPUNLIV,NSE:ZEEL,NSE:ETERNAL,", + title="Paste Symbols", tooltip=tt_is, group=g_tb) + +string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) +bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) +bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) + +int i_tbl_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) +string i_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) +string i_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) + +//_____________________________ Menu Screener End + +//____________________________ Menu Pivot High Low Start + +g_phl_eq = '███████████████ Equal High Low ███████████████' +int i_phl_1_left = input.int(defval=60, title='Left', group=g_phl_eq) +int i_phl_1_right = input.int(defval=30, title='Right', group=g_phl_eq) +tt_eq = "Lower values mean highs and lows are closer." +float i_phl_eq_percent = input.float(defval=0.05, minval=0, step=0.01, title='Equal HL %', tooltip=tt_eq, group=g_phl_eq) +string i_phl_1_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close'], group=g_phl_eq) +color i_phl_1_h_ln_color = input.color(defval=#F7525F, title='Bearish Color', group=g_phl_eq) +color i_phl_1_l_ln_color = input.color(defval=#22AB94, title='Bullish Color', group=g_phl_eq) +color i_phl_txt_color = input.color(defval=#B2B5BE, title='Neutral Color', group=g_phl_eq) +int i_phl_eq_transp = input.int(defval=25, minval=0, title='Transparency', group=g_phl_eq) + +//____________________________ Menu Pivot High Low End + +//____________________________ Equal High Low Start + +// Get Source +float _high = i_phl_1_source == 'Open/Close' ? math.max(open, close) : high +float _low = i_phl_1_source == 'Open/Close' ? math.min(open, close) : low + +// Arrays to store the last 2 pivot highs and lows +var float[] ph_arr = array.new_float(2) +var int[] ph_bi_arr = array.new_int(2) +var float[] pl_arr = array.new_float(2) +var int[] pl_bi_arr = array.new_int(2) + +// Pivot calculations +int prev_ph_bi = na, int prev_pl_bi = na +bool ph = false, bool pl = false + +phl_1_ph = ta.pivothigh(_high, i_phl_1_left, i_phl_1_right) +phl_1_pl = ta.pivotlow(_low, i_phl_1_left, i_phl_1_right) + +// Update the arrays with the last 2 pivot highs and lows +if not na(phl_1_ph) + ph := true + prev_ph_bi := bar_index - i_phl_1_right + array.unshift(ph_bi_arr, bar_index) + array.pop(ph_bi_arr) + +if not na(phl_1_pl) + pl := true + prev_pl_bi := bar_index - i_phl_1_right + array.unshift(pl_bi_arr, bar_index) + array.pop(pl_bi_arr) + +// Function to update the arrays with the last 2 values +update_arrays(value, array_ref) => + array.unshift(array_ref, value) + array.pop(array_ref) + +// Update arrays with the last 2 pivot highs and lows +if ph + update_arrays(phl_1_ph, ph_arr) +if pl + update_arrays(phl_1_pl, pl_arr) + +// Get last two pivot highs and lows +ph_price_0 = array.get(ph_arr, 0), ph_price_1 = array.get(ph_arr, 1) +ph_bi_0 = array.get(ph_bi_arr, 0), ph_bi_1 = array.get(ph_bi_arr, 1) + +pl_price_0 = array.get(pl_arr, 0), pl_price_1 = array.get(pl_arr, 1) +pl_bi_0 = array.get(pl_bi_arr, 0), pl_bi_1 = array.get(pl_bi_arr, 1) + +// Function to calculate percentage change +pchg(price_1, price_2) => + change = price_1 - price_2 + percent_change = math.abs((change / price_2) * 100) + percent_change + +// Calculate percentage change between the last two pivot highs and lows +var float ph_pchg = na +var float pl_pchg = na + +if array.size(ph_arr) >= 2 + ph_pchg := pchg(array.get(ph_arr, 0), array.get(ph_arr, 1)) + +if array.size(pl_arr) >= 2 + pl_pchg := pchg(array.get(pl_arr, 0), array.get(pl_arr, 1)) + +// Draw Equals Box +var levelBoxes_equal = array.new_box() + +ph_condition = ph and ph_pchg < i_phl_eq_percent and barstate.isconfirmed +pl_condition = pl and pl_pchg < i_phl_eq_percent and barstate.isconfirmed + +if ph_condition + ph_box = box.new(left=ph_bi_1 - i_phl_1_right, top=ph_price_1, right=ph_bi_0 - i_phl_1_right, bottom=ph_price_0, border_color=color.new(i_phl_1_h_ln_color, i_phl_eq_transp), bgcolor=color.new(i_phl_1_h_ln_color, i_phl_eq_transp)) + array.push(levelBoxes_equal, ph_box) + +if pl_condition + pl_box = box.new(left=pl_bi_1 - i_phl_1_right, top=pl_price_1, right=pl_bi_0 - i_phl_1_right, bottom=pl_price_0, border_color=color.new(i_phl_1_l_ln_color, i_phl_eq_transp), bgcolor=color.new(i_phl_1_l_ln_color, i_phl_eq_transp)) + array.push(levelBoxes_equal, pl_box) + +// Plot Equal Labels +plotshape(ph_condition ? high[i_phl_1_right] : na, style=shape.xcross, location=location.absolute, offset=-i_phl_1_right, color=color.new(i_phl_1_h_ln_color, i_phl_eq_transp), size=size.small) +plotshape(pl_condition ? low[i_phl_1_right] : na, style=shape.xcross, location=location.absolute, offset=-i_phl_1_right, color=color.new(i_phl_1_l_ln_color, i_phl_eq_transp), size=size.small) + +//____________________________ Equal High Low End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_001, out_001] = feed(effective_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), +[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), +[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), +[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), +[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), +[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), +[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), +[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), +[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), +[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) + +//____________________________ Get Symbols for Screener End + +// _____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Choose Screening Method +bull_method = + i_scr_choose == 'Equals' ? ph_condition : + ph_pchg < i_phl_eq_percent and ta.crossover(high, ph_price_0) and barstate.isconfirmed + +bear_method = + i_scr_choose == 'Equals' ? pl_condition : + pl_pchg < i_phl_eq_percent and ta.crossunder(low, pl_price_0) and barstate.isconfirmed + +// Screener Conditions +bullish_cond = bull_method +bearish_cond = bear_method + +// Define Bull and Bear Conditions +bull = not(i_scr_direction == "Bearish") +bear = not(i_scr_direction == "Bullish") + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + indicator = "" + signal = int(na) + + if barstate.isconfirmed + // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_bull and bearish_cond and bear + indicator := "L" + signal := -1 + + // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_bear and bullish_cond and bull + indicator := "H" + signal := 1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + + [_time, indicator, price, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 5, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, indicator, price, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, indicator, price, signal)) + +// Screener function to collect data +screener(s) => + [_time, indicator, price, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, indicator, strPrice, strSignal) + +// Call Screener function for multiple symbols +screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), +screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), +screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), +screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), +screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), +screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_tbl_disp_rows + while matrix.rows(matrix) > i_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table tbl = table.new(position=i_tbl_position, columns=4, rows=102, border_width=1) + +// Function to populate cells in the table +cell(col, row, txt, color) => + table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) + +// Check if it's the last bar +if barstate.islast + // Clear existing data in the table + table.clear(tbl, 0, 0, 3, 101) + + // Set headers for the table + cell(0, 0, "Symbol", i_phl_txt_color) + cell(1, 0, "Time", i_phl_txt_color) + cell(2, 0, "Dir" , i_phl_txt_color) + cell(3, 0, "Price", i_phl_txt_color) + + j = 1 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + col = matrix.get(matrix, i, 4) == "1" ? i_phl_1_h_ln_color : + matrix.get(matrix, i, 4) == "-1" ? i_phl_1_l_ln_color : i_phl_txt_color + + // Populate cells in the table + cell(0, j, matrix.get(matrix, i, 0), col) + cell(1, j, matrix.get(matrix, i, 1), col) + cell(2, j, matrix.get(matrix, i, 2), col) + cell(3, j, matrix.get(matrix, i, 3), col) + + j += 1 + +// _____________________________ Screener End + +// _____________________________ Code End + diff --git a/ICT Fair Value Gap (FVG) Scanner/Scanner - ICT Fair Value Gap (FVG) Scanner.txt b/ICT Fair Value Gap (FVG) Scanner/Scanner - ICT Fair Value Gap (FVG) Scanner.txt index b897ee3..d6234ed 100644 --- a/ICT Fair Value Gap (FVG) Scanner/Scanner - ICT Fair Value Gap (FVG) Scanner.txt +++ b/ICT Fair Value Gap (FVG) Scanner/Scanner - ICT Fair Value Gap (FVG) Scanner.txt @@ -1,919 +1,1143 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=6 -indicator(title = 'ICT Fair Value Gap (FVG) Scanner v2', shorttitle = 'FVG Scan v2', overlay = true, max_boxes_count = 500) - -//___________________________ Menu Screener Start - -g_scrtb = '█████████████████ Scanner █████████████████' - -string i_scr_choose = input.string(defval = 'First Touch Confirmed', title = 'Scanning Method', options = ['FVG %', 'First Touch', 'First Touch Confirmed', 'Full Fill', 'Full Fill Confirmed', 'Reversal'], group = g_scrtb) - -string tt_is = - "• Reads only up to first 40 symbols." + - "\n• Total characters cannot exceed 4096." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ABFRL,NSE:BANDHANBNK,NSE:BHEL,NSE:BLS,NSE:CENTRALBK,NSE:CESC,NSE:ENGINERSIN,NSE:EXIDEIND,NSE:FINPIPE,NSE:HINDCOPPER,NSE:IEX,NSE:IGL,NSE:IIFL,NSE:INOXWIND,NSE:IOB,NSE:IRB,NSE:IRCON,NSE:IRFC,NSE:LTF,NSE:MAHABANK,NSE:MANAPPURAM,NSE:MMTC,NSE:MRPL,NSE:NATIONALUM,NSE:NETWORK18,NSE:NLCINDIA,NSE:NMDC,NSE:PPLPHARMA,NSE:RAILTEL,NSE:RBLBANK,NSE:RCF,NSE:RTNINDIA,NSE:SAIL,NSE:SAMMAANCAP,NSE:SBFC,NSE:SCI,NSE:SJVN,NSE:SUZLON,NSE:TTML,NSE:FSL", - title="Paste Symbols", tooltip=tt_is, group=g_scrtb) - -bool i_scr_show_table = input.bool(defval = true, title = 'Display Table', group = g_scrtb) -bool i_scr_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scrtb) -bool i_scr_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scrtb) - -int i_scr_tbl_disp_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scrtb) -string i_scr_tbl_position = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scrtb) -string i_scr_tbl_text_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scrtb) - -//___________________________ Menu Screener End - -//___________________________ Menu Indicators Start - -g_gap = '███████████████████ FVG ███████████████████' - -bool closeGapsPartially = input.bool(defval = true, title = 'Close FVG Partially', group = g_gap) -int boxLimitInput = input.int(defval = 15, title = 'Max Number of FVG', minval = 1, maxval = 500, group = g_gap) -string minimalDeviationTooltip = 'Specifies the minimal size of detected gaps, as a percentage of the average high-low range for the last 14 bars.' -float minimalDeviationInput = nz(input.float(defval = 70.0, title = 'Minimal Deviation (%)', tooltip = minimalDeviationTooltip, minval = 1, maxval = 100, group = g_gap) / 100 * ta.sma(high - low, 14)) -bool limitBoxLengthBoolInput = input.bool(defval = false, title = 'Max Bars', tooltip = 'Limit Max Gap Trail Length (bars)', inline = 'Length Limit', group = g_gap) -int limitBoxLengthIntInput = input.int(defval = 300, title = '', inline = 'Length Limit', minval = 1, group = g_gap) - -//___________________________ Menu Indicators End - -//___________________________ Menu Additional Fiters Start - -g_af = '██████████████ Additional Fiters ██████████████' -tt_pchg = - "• If '% Change Above/Below +/-' is 4, it means relative volume is considered when the price change is above 4%." + - "\n• A value of 4% is positive for bullish scenarios and negative for bearish scenarios." + - "\n• The percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." -tt_vpchg = - "• If 'Volume % Change Above' is 0, it means Relative Volume is considered when today's volume is greater than the previous day's volume." + - "\n• For 'Screening Method' choice 'Retracement to EMA,' the 'Apply Volume % Change Filter' can be unchecked." + - "\n• A 'Volume % Change Above' 300% or more often indicates a major breakout, which may happen today or the next day." + - "\n• The volume percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." -tt_atr = - "• ATR helps filter out longer or more volatile signal candles." -tt_atr_mul = - "• Higher multiplier value filters a longer or more volatile signal candle." -tt_bf = - "• If the input is '80', it means the body covers over 80% of the candle." -tt_bs = - "• 2 means the candle is 2 times larger than the previous candle." -tt_vol = - "• Filter out a candle when its volume is greater than the SMA of the volume." -tt_rv = - "• Filter out a candle when its volume is greater than the Relative Volume." -tt_tf = - "• Filter out a signals between the given Time." -tt_df = - "• Filter out a signals on the given Date." + - "\n• This Time Filter is applicable only for 'Displacement Candles'." - -bool i_pchg_filter = input.bool(defval = false, title = 'Apply % Change Filter', tooltip = tt_pchg, group = g_af) -float i_pchg_above_below = input.float(defval = 2, title = '% Change Above/Below +/-', minval = 0, group = g_af) - -bool i_vol_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vpchg, group = g_af) -int i_vol_above = input.int(defval = 500000, title = 'Volume Above', minval = 0, group = g_af) - -bool i_vol_pchg_filter = input.bool(defval = false, title = 'Apply Volume % Change Filter', tooltip = tt_vpchg, group = g_af) -float i_vol_pchg_above = input.float(defval = 0, title = 'Volume % Change Above', minval = 0, group = g_af) - -bool i_atr_filter = input.bool(defval = false, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) -int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) -float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) - -bool i_body_filter = input.bool(defval = false, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) -float i_body_percent = input.float(defval = 70, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 - -bool i_body_size_filter = input.bool(defval = false, title = 'Apply Body Size Filter', tooltip = tt_bs, group = g_af) -int i_body_size_multiplier = input.int(defval = 2, title = 'Body Size Multiplier (x)', minval = 0, group = g_af) - -bool i_volume_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vol, group = g_af) -int i_vol_sma_length = input.int(defval = 20, minval = 1, title = 'Volume SMA Length', group = g_af) - -bool i_rel_vol_filter = input.bool(defval = false, title = 'Apply Relative Volume Filter', tooltip = tt_rv, group = g_af) -int i_rel_vol_avg_vol_len = input.int(defval = 90, title = 'Relative Volume Length', minval = 2, group = g_af) -float i_rel_vol_avg_vol_multi = input.float(defval = 5, title = 'Rel Vol SMA Multiplier', minval = 0, group = g_af) - -bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) -int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) -int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) -int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) -int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) - -bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) -int i_day = input.int(defval = 25, minval = 1, maxval = 31, title = 'Day', group = g_af) -int i_month = input.int(defval = 10, minval = 1, maxval = 12, title = 'Month', group = g_af) -int i_year = input.int(defval = 2024, minval = 0, title = 'Year', group = g_af) - -//___________________________ Menu Additional Fiters End - -//___________________________ Menu Table Start - -g_dtb = '█████████████████ Data Table █████████████████' -bool i_tbl_data_show = input.bool(defval = true, title = 'Display Table', group = g_dtb) -string i_tbl_data_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_dtb) -string i_tbl_data_txt_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_dtb) - -//___________________________ Menu Table End - -//___________________________ Chart Settings Start - -g_ch = '███████████████ Chart Settings ███████████████' -color i_pos_dark_color = input.color(defval = #03110F, title = 'Positive Dark', group = g_ch) -color i_pos_color = input.color(defval = #089981, title = 'Positive Mid', group = g_ch) -color i_pos_light_color = input.color(defval = #ACE5DC, title = 'Positive Light', group = g_ch) -color i_neg_light_color = input.color(defval = #FCCBCD, title = 'Negative Light', group = g_ch) -color i_neg_color = input.color(defval = #F23645, title = 'Negative Mid', group = g_ch) -color i_neg_dark_color = input.color(defval = #180809, title = 'Negative Dark', group = g_ch) -color i_indicator_color = input.color(defval = #2962FF, title = 'Indicator', group = g_ch) -color i_signal_color = input.color(defval = #FB8C00, title = 'Signal', group = g_ch) -color i_neu_color = input.color(defval = #9598A1, title = 'Neutral Light', group = g_ch) -color i_neu_mid_color = input.color(defval = #2A2E39, title = 'Neutral Mid', group = g_ch) -color i_neu_dark_color = input.color(defval = #141516, title = 'Neutral Dark', group = g_ch) - -float i_transp = input.float(defval=70, title="Transp", minval = 0, maxval = 100, group=g_ch) - -//___________________________ Chart Settings End - -//___________________________ FVG Start - -type AlertInfo - int countOpenGap - int countClosedGap - -method hasOpenedGap(AlertInfo this) => - this.countOpenGap > 0 - -method hasClosedGap(AlertInfo this) => - this.countClosedGap > 0 - -AlertInfo alertInfo = AlertInfo.new(0, 0) - -//@type A representation of a chart gap and all box drawings that it consists of. -//@field isActive If 'true', the gap has not yet been closed and is still being extended on the chart. -//@field isBull The direction of the gap: 'true' for upward gaps and 'false' for downward ones. -//@field inactiveBoxes An array of all boxes that have been drawn for this gap. The last element of the array is the box on the chart that is currently extended further. -type Gap - bool isActive - bool isBull - array boxes - -//@function Deletes all of the boxes that were drawn to represent the gap. -method delete(Gap this) => - for _box in this.boxes - _box.delete() - -add_transp = 20 - -//@function Closes the gap partially, stopping the previous box and creating a new, smaller box to continue the gap instead. -method partialClose(Gap this) => - activeBox = this.boxes.last() - activeBox.set_extend(extend.none) - - top = this.isBull ? activeBox.get_top() : low - bottom = this.isBull ? high : activeBox.get_bottom() - - this.boxes.push(box.new( - bar_index, - top, - bar_index, - bottom, - this.isBull ? color.new(i_neg_color, i_transp + add_transp) : color.new(i_pos_color, i_transp + add_transp), - bgcolor = this.isBull ? color.new(i_neg_color, i_transp) : color.new(i_pos_color, i_transp))) - - -//@function Closes the gap fully, stopping the box from being extended. -method fullClose(Gap this) => - alertInfo.countClosedGap += 1 - activeBox = this.boxes.last() - activeBox.set_extend(extend.none) - this.isActive := false - if closeGapsPartially - activeBox.delete() - -method checkForClose(Gap this) => - if this.isActive - activeBox = this.boxes.last() - top = activeBox.get_top() - bot = activeBox.get_bottom() - isBull = this.isBull - activeBox.set_right(bar_index) - - if (high > bot and isBull) or (low < top and not isBull) - if closeGapsPartially - this.partialClose() - else - this.fullClose() - - bool forceCloseBoxExceededLengthLimit = (limitBoxLengthBoolInput and bar_index - activeBox.get_left() >= limitBoxLengthIntInput) - if ((high > top and isBull) or (low < bot and not isBull)) or forceCloseBoxExceededLengthLimit - this.fullClose() - -var allGaps = array.new() - -// Detect gaps. -isFVGDown = high < low[2] and low[2] - high >= minimalDeviationInput -isFVGUp = low > high[2] and low - high[2] >= minimalDeviationInput -isFVG = isFVGDown or isFVGUp -boxBorderColor = isFVGDown ? color.new(i_neg_color, i_transp + add_transp) : color.new(i_pos_color, i_transp + add_transp) -boxBgcolor = isFVGDown ? color.new(i_neg_color, i_transp) : color.new(i_pos_color, i_transp) - -registerNewGap(bool isFVGDown) => - alertInfo.countOpenGap += 1 - - newBox = box.new( - bar_index - 2, - (isFVGDown ? low[2] : low), - bar_index, - (isFVGDown ? high : high[2]), - border_color = boxBorderColor, - bgcolor = boxBgcolor, - extend = extend.right) - - allGaps.push(Gap.new(true, isFVGDown, array.from(newBox))) - - if allGaps.size() > boxLimitInput - allGaps.shift().delete() - -// Detect covering of gaps. -for gap in allGaps - gap.checkForClose() - -// Add a box for each new gap, removing the oldest one if needed. -if isFVG - registerNewGap(isFVGDown) - -if barstate.islastconfirmedhistory and allGaps.size() == 0 - noGapText = "No gaps found on the current chart. \n The cause could be that some exchanges align the open of new bars on the close of the previous one, resulting in charts with no gaps. Alternatively, your Minimal Deviation might be too high." - var infoTable = table.new(position.bottom_right, 1, 1) - table.cell(infoTable, 0, 0, text = noGapText, text_color = chart.bg_color, bgcolor = chart.fg_color) - -//alertcondition(alertInfo.hasOpenedGap(), "New Gap Appeared", "A new gap has appeared.") -//alertcondition(alertInfo.hasClosedGap(), "Gap Closed", "A gap was closed.") - -// Define numeric values for plotting gaps -var isFVGDown_top = float(na) -var isFVGDown_bottom = float(na) -var float FVGDownPercent = na -if isFVGDown - isFVGDown_top := low[2] - isFVGDown_bottom := high - FVGDownPercent := (low[2] - high) / low[2] * 100 - FVGDownPercent - -var isFVGUp_top = float(na) -var isFVGUp_bottom = float(na) -var float FVGUpPercent = na -if isFVGUp - isFVGUp_top := low - isFVGUp_bottom := high[2] - FVGUpPercent := (low - high[2]) / high[2] * 100 - FVGUpPercent - -// Plot -plot(series = isFVGDown_top, title = 'FVG Down Top', color = i_neg_color, display = display.none) -plot(series = isFVGDown_bottom, title = 'FVG Down Bottom', color = i_neg_color, display = display.none) -plot(series = isFVGUp_top, title = 'FVG Up Top', color = i_pos_color, display = display.none) -plot(series = isFVGUp_bottom, title = 'FVG Up Bottom', color = i_pos_color, display = display.none) - -//___________________________ FVG End - -//___________________________ Cumulative Percentage Change Start - -// Function to calculate Daily Cumulative Percentage Change of Close Price -cumulative_percentage_change() => - var float _cum_pct_change = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 - _cum_pct_change := bool(_is_new_day) ? _daily_pct_change : na(_cum_pct_change) ? _daily_pct_change : _cum_pct_change + _daily_pct_change - _cum_pct_change - -// Calculate current cumulative percentage change -cum_pchg = cumulative_percentage_change() - -//___________________________ Cumulative Percentage Change End - -//___________________________ Cumulative Volume Percentage Change Start - -// Function to calculate Daily Cumulative Volume -cumulative_volume() => - var float _cum_vol = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _cum_vol := bool(_is_new_day) ? volume : na(_cum_vol) ? volume : _cum_vol + volume - _cum_vol - -// Calculate current and previous day cumulative volumes -var float current_cum_vol = na -var float prev_cum_vol = na - -if ta.change(time('D')) != 0 - prev_cum_vol := current_cum_vol - current_cum_vol := volume - current_cum_vol -else - current_cum_vol := current_cum_vol + volume - current_cum_vol - -// Calculate Cumulative Volume Percentage Change -cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 - -//___________________________ Cumulative Volume Percentage Change End - -//___________________________ Additional Filters Start - -// % Change Filter -bool pchg_above_filter = true -bool pchg_below_filter = true -if i_pchg_filter - pchg_above_filter := cum_pchg > i_pchg_above_below - pchg_below_filter := cum_pchg < -i_pchg_above_below - pchg_below_filter - -// Volume Filter -bool vol_filter = true -if i_vol_filter - vol_filter := current_cum_vol >= i_vol_above - vol_filter - -// Volume % Change Filter -bool vol_pchg_filter = true -if i_vol_pchg_filter - vol_pchg_filter := cum_vol_pchg >= i_vol_pchg_above - vol_pchg_filter - -// ATR Filter -bool atr_filter = true -if i_atr_filter - atr_filter := high - low > ta.atr(i_atr_length) * i_atr_multi - atr_filter - -// Body Percent Filter -bool body_filter = true -if i_body_filter - body_filter := math.abs(close - open) / (high - low) >= i_body_percent - body_filter - -// Body Size Filter -bool body_size_filter = true -if i_body_size_filter - body_size_filter := math.abs(close - open) / (high - low) >= i_body_percent and high - low >= (high[1] - low[1]) * i_body_size_multiplier - body_size_filter - -// Volume SMA Filter -bool volume_filter = true -if i_volume_filter - volume_filter := volume > ta.sma(volume, i_vol_sma_length) - volume_filter - -// Continuous Signals Filter -average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) -relative_volume = volume / average_volume[1] -rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi - -bool rel_vol_filter = true -if i_rel_vol_filter - rel_vol_filter := relative_volume > rel_vol_sma_multiplier - rel_vol_filter - -// Time Filter -bool time_filter = true -if i_time_filter - time_filter := (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) - time_filter - -// Date Filter -bool date_filter = true -if i_date_filter - date_filter := year == i_year and month == i_month and dayofmonth == i_day - date_filter - -//___________________________ Additional Filters End - -//___________________________ Fibonacci Start - -// Fibonacci Function -fibonacci(bool calc_from_high, high_value, low_value, float fib_value) => - if calc_from_high - low_value + (high_value - low_value) * fib_value - else - high_value - (high_value - low_value) * fib_value - -//___________________________ Fibonacci End - -//___________________________ Signals Start - -//___________________________ Continuous Signals Start - -//___________________________ Short Continuous Signals Start - -//___________________________ Short Continuous Break Signals - -// Short Condition 1 -short_cont_1 = - isFVGDown and - time_filter and - date_filter and - barstate.isconfirmed - -// Short Condition 2 -short_cont_2 = - ta.crossover(high, isFVGDown_bottom) and - time_filter and - date_filter and - barstate.isconfirmed - -var short_cont_2_low = float(na) -if short_cont_2 - short_cont_2_low := low - short_cont_2_low - -// Short Condition 2 Confirmed -short_cont_2_conf = - ta.crossunder(close, short_cont_2_low) and - time_filter and - date_filter and - barstate.isconfirmed - -// Short Condition 3 -short_cont_3 = - ta.crossover(high, isFVGDown_top) and - close < isFVGDown_top and - time_filter and - date_filter and - barstate.isconfirmed - -var short_cont_3_low = float(na) -if short_cont_3 - short_cont_3_low := low - short_cont_3_low - -// Short Condition 3 Confirmed -short_cont_3_conf = - ta.crossunder(close, short_cont_3_low) and - time_filter and - date_filter and - barstate.isconfirmed - -// Short Condition 4 -short_cont_4 = - ta.crossover(close, isFVGDown_top) and - time_filter and - date_filter and - barstate.isconfirmed - -// Short First Touch -var short_first_touch_current_state = 0 -short_first_touch_prev_state = nz(short_first_touch_current_state[1]) -short_first_touch_current_state := short_first_touch_prev_state == 2 ? 0 : short_first_touch_prev_state -if short_cont_1 and short_first_touch_current_state == 0 - short_first_touch_current_state := 1 - short_first_touch_current_state -if short_cont_2 and short_first_touch_current_state == 1 - short_first_touch_current_state := 2 - short_first_touch_current_state - -short_first_touch_signal = short_first_touch_current_state == 2 ? true : false - -// Short Confirmed First Touch -var short_first_touch_conf_current_state = 0 -short_first_touch_conf_prev_state = nz(short_first_touch_conf_current_state[1]) -short_first_touch_conf_current_state := short_first_touch_conf_prev_state == 3 ? 0 : short_first_touch_conf_prev_state -if short_cont_1 and short_first_touch_conf_current_state == 0 - short_first_touch_conf_current_state := 1 - short_first_touch_conf_current_state -if short_cont_2 and short_first_touch_conf_current_state == 1 - short_first_touch_conf_current_state := 2 - short_first_touch_conf_current_state -if short_cont_2_conf and short_first_touch_conf_current_state == 2 - short_first_touch_conf_current_state := 3 - short_first_touch_conf_current_state - -short_first_touch_conf_signal = short_first_touch_conf_current_state == 3 ? true : false - -// Short Full Fill -var short_full_fill_current_state = 0 -short_full_fill_prev_state = nz(short_full_fill_current_state[1]) -short_full_fill_current_state := short_full_fill_prev_state == 2 ? 0 : short_full_fill_prev_state -if short_cont_1 and short_full_fill_current_state == 0 - short_full_fill_current_state := 1 - short_full_fill_current_state -if short_cont_3 and short_full_fill_current_state == 1 - short_full_fill_current_state := 2 - short_full_fill_current_state - -short_full_fill_signal = short_full_fill_current_state == 2 ? true : false - -// Short Full Fill Confirmed -var short_full_fill_conf_current_state = 0 -short_full_fill_conf_prev_state = nz(short_full_fill_conf_current_state[1]) -short_full_fill_conf_current_state := short_full_fill_conf_prev_state == 3 ? 0 : short_full_fill_conf_prev_state -if short_cont_1 and short_full_fill_conf_current_state == 0 - short_full_fill_conf_current_state := 1 - short_full_fill_conf_current_state -if short_cont_3 and short_full_fill_conf_current_state == 1 - short_full_fill_conf_current_state := 2 - short_full_fill_conf_current_state -if short_cont_3_conf and short_full_fill_conf_current_state == 2 - short_full_fill_conf_current_state := 3 - short_full_fill_conf_current_state - -short_full_fill_conf_signal = short_full_fill_conf_current_state == 3 ? true : false - -// Short Reversal -var short_reversal_current_state = 0 -short_reversal_prev_state = nz(short_reversal_current_state[1]) -short_reversal_current_state := short_reversal_prev_state == 2 ? 0 : short_reversal_prev_state -if short_cont_1 and short_reversal_current_state == 0 - short_reversal_current_state := 1 - short_reversal_current_state -if short_cont_4 and short_reversal_current_state == 1 - short_reversal_current_state := 2 - short_reversal_current_state - -short_reversal_signal = short_reversal_current_state == 2 ? true : false - -//___________________________ Short Continuous Signals End - -//___________________________ Long Continuous Signals Start - -//___________________________ Long Continuous Break Signals - -// Long Condition 1 -long_cont_1 = - isFVGUp and - time_filter and - date_filter and - barstate.isconfirmed - -// Long Condition 2 -long_cont_2 = - ta.crossunder(low, isFVGUp_top) and - time_filter and - date_filter and - barstate.isconfirmed - -var long_cont_2_high = float(na) -if long_cont_2 - long_cont_2_high := high - long_cont_2_high - -// Long Condition 2 Confirmed -long_cont_2_conf = - ta.crossover(close, long_cont_2_high) and - time_filter and - date_filter and - barstate.isconfirmed - -// Long Condition 3 -long_cont_3 = - ta.crossunder(low, isFVGUp_bottom) and - close > isFVGUp_bottom and - time_filter and - date_filter and - barstate.isconfirmed - -var long_cont_3_high = float(na) -if long_cont_3 - long_cont_3_high := high - long_cont_3_high - -// Long Condition 3 Confirmed -long_cont_3_conf = - ta.crossover(close, long_cont_3_high) and - time_filter and - date_filter and - barstate.isconfirmed - -// Long Condition 4 -long_cont_4 = - ta.crossunder(close, isFVGUp_bottom) and - time_filter and - date_filter and - barstate.isconfirmed - -// Long First Touch -var long_first_touch_current_state = 0 -long_first_touch_prev_state = nz(long_first_touch_current_state[1]) -long_first_touch_current_state := long_first_touch_prev_state == 2 ? 0 : long_first_touch_prev_state -if long_cont_1 and long_first_touch_current_state == 0 - long_first_touch_current_state := 1 - long_first_touch_current_state -if long_cont_2 and long_first_touch_current_state == 1 - long_first_touch_current_state := 2 - long_first_touch_current_state - -long_first_touch_signal = long_first_touch_current_state == 2 ? true : false - -// Long First Touch Confirmed -var long_first_touch_conf_current_state = 0 -long_first_touch_conf_prev_state = nz(long_first_touch_conf_current_state[1]) -long_first_touch_conf_current_state := long_first_touch_conf_prev_state == 3 ? 0 : long_first_touch_conf_prev_state -if long_cont_1 and long_first_touch_conf_current_state == 0 - long_first_touch_conf_current_state := 1 - long_first_touch_conf_current_state -if long_cont_2 and long_first_touch_conf_current_state == 1 - long_first_touch_conf_current_state := 2 - long_first_touch_conf_current_state -if long_cont_2_conf and long_first_touch_conf_current_state == 2 - long_first_touch_conf_current_state := 3 - long_first_touch_conf_current_state - -long_first_touch_conf_signal = long_first_touch_conf_current_state == 3 ? true : false - -// Long Full Fill -var long_full_fill_current_state = 0 -long_full_fill_prev_state = nz(long_full_fill_current_state[1]) -long_full_fill_current_state := long_full_fill_prev_state == 2 ? 0 : long_full_fill_prev_state -if long_cont_1 and long_full_fill_current_state == 0 - long_full_fill_current_state := 1 - long_full_fill_current_state -if long_cont_3 and long_full_fill_current_state == 1 - long_full_fill_current_state := 2 - long_full_fill_current_state - -long_full_fill_signal = long_full_fill_current_state == 2 ? true : false - -// Long Full Fill Confirmed -var long_full_fill_conf_current_state = 0 -long_full_fill_conf_prev_state = nz(long_full_fill_conf_current_state[1]) -long_full_fill_conf_current_state := long_full_fill_conf_prev_state == 3 ? 0 : long_full_fill_conf_prev_state -if long_cont_1 and long_full_fill_conf_current_state == 0 - long_full_fill_conf_current_state := 1 - long_full_fill_conf_current_state -if long_cont_3 and long_full_fill_conf_current_state == 1 - long_full_fill_conf_current_state := 2 - long_full_fill_conf_current_state -if long_cont_3_conf and long_full_fill_conf_current_state == 2 - long_full_fill_conf_current_state := 3 - long_full_fill_conf_current_state - -long_full_fill_conf_signal = long_full_fill_conf_current_state == 3 ? true : false - -// Long Reversal -var long_reversal_current_state = 0 -long_reversal_prev_state = nz(long_reversal_current_state[1]) -long_reversal_current_state := long_reversal_prev_state == 2 ? 0 : long_reversal_prev_state -if long_cont_1 and long_reversal_current_state == 0 - long_reversal_current_state := 1 - long_reversal_current_state -if long_cont_4 and long_reversal_current_state == 1 - long_reversal_current_state := 2 - long_reversal_current_state - -long_reversal_signal = long_reversal_current_state == 2 ? true : false - -//___________________________ Long Continuous Signals End - -//___________________________ Plot Continuous Signals - -// 1 -plotchar(series = i_scr_show_short and i_scr_choose == 'First Touch' and short_first_touch_signal ? 3 : na, title = 'Short First Touch', char = '↷', location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) -plotchar(series = i_scr_show_long and i_scr_choose == 'First Touch' and long_first_touch_signal ? 3 : na, title = 'Long First Touch', char = '⤻', location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) -barcolor(color = i_scr_show_short and i_scr_choose == 'First Touch' and short_first_touch_signal ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'First Touch' and long_first_touch_signal ? i_pos_light_color : na, title = 'First Touch Candle') - -// 2 -plotshape(series = i_scr_show_short and i_scr_choose == 'First Touch Confirmed' and short_first_touch_conf_signal ? 4 : na, title = 'Short Confirmed First Touch', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) -plotshape(series = i_scr_show_long and i_scr_choose == 'First Touch Confirmed' and long_first_touch_conf_signal ? 4 : na, title = 'Long Confirmed First Touch', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) -barcolor(color = i_scr_show_short and i_scr_choose == 'First Touch Confirmed' and short_first_touch_conf_signal ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'First Touch Confirmed' and long_first_touch_conf_signal ? i_pos_light_color : na, title = 'Confirmed First Touch Candle') - -// 3 -plotchar(series = i_scr_show_short and i_scr_choose == 'Full Fill' and short_full_fill_signal ? 3 : na, title = 'Short Full Fill', char = '↷', location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) -plotchar(series = i_scr_show_long and i_scr_choose == 'Full Fill' and long_full_fill_signal ? 3 : na, title = 'Long Full Fill', char = '⤻', location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) -barcolor(color = i_scr_show_short and i_scr_choose == 'Full Fill' and short_full_fill_signal ? i_pos_light_color : i_scr_show_long and i_scr_choose == 'Full Fill' and long_full_fill_signal ? i_neg_light_color : na, title = 'Full Fill Candle') - -// 4 -plotshape(series = i_scr_show_short and i_scr_choose == 'Full Fill Confirmed' and short_full_fill_conf_signal ? 4 : na, title = 'Short Confirmed Full Fill', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) -plotshape(series = i_scr_show_long and i_scr_choose == 'Full Fill Confirmed' and long_full_fill_conf_signal ? 4 : na, title = 'Long Confirmed Full Fill', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) -barcolor(color = i_scr_show_short and i_scr_choose == 'Full Fill Confirmed' and short_full_fill_conf_signal ? i_pos_light_color : i_scr_show_long and i_scr_choose == 'Full Fill Confirmed' and long_full_fill_conf_signal ? i_neg_light_color : na, title = 'Confirmed Full Fill Candle') - -// 5 -plotshape(series = i_scr_show_short and i_scr_choose == 'Reversal' and short_reversal_signal ? 3 : na, title = 'Long Reversal', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) -plotshape(series = i_scr_show_long and i_scr_choose == 'Reversal' and long_reversal_signal ? 3 : na, title = 'Short Reversal', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) -barcolor(color = i_scr_show_short and i_scr_choose == 'Reversal' and short_reversal_signal ? i_pos_light_color : i_scr_show_long and i_scr_choose == 'Reversal' and long_reversal_signal ? i_neg_light_color : na, title = 'Reversal Candle') - -//___________________________ Continuous Signals End - -//___________________________ Signals End - -//___________________________ Data Table Start - -// To String -day_pchg_str = str.tostring(cum_pchg, '#.##') + ' %' -volume_pchg_str = str.tostring(cum_vol_pchg, '#.##') + ' %' -day_volume_str = str.tostring(current_cum_vol / 100000, '#.##') + ' L' -prev_day_volume_str = str.tostring(prev_cum_vol / 100000, '#.##') + ' L' - -// Color -bgcolor_1 = i_neu_dark_color -bgcolor_2 = i_neu_mid_color - -pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color -vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color -prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color - -// Plot Table -var table tbl_data = table.new(position = i_tbl_data_pos, columns = 2, rows = 4, border_width = 1, force_overlay = true) - -if barstate.islast and i_tbl_data_show - table.cell(table_id = tbl_data, column = 0, row = 0, text = '%Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 0, text = day_pchg_str, text_color = pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - - table.cell(table_id = tbl_data, column = 0, row = 1, text = 'Vol %Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 1, text = volume_pchg_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - - table.cell(table_id = tbl_data, column = 0, row = 2, text = 'Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 2, text = day_volume_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - - table.cell(table_id = tbl_data, column = 0, row = 3, text = 'PD Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 3, text = prev_day_volume_str, text_color = prev_vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - -//___________________________ Data Table End - -//___________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - loop - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - loop - [getT, loop] // return tickerid in first position & truncated list - -[tid_01, out_01] = feed(i_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), -[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), -[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), -[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), -[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), -[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), -[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), -[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), -[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), -[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) - -//___________________________ Get Symbols for Screener End - -//___________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Scanner Conditions -short_cond = - i_scr_choose == 'FVG %' ? short_cont_1 : - i_scr_choose == 'First Touch' ? short_first_touch_signal : - i_scr_choose == 'First Touch Confirmed' ? short_first_touch_conf_signal : - i_scr_choose == 'Full Fill' ? short_full_fill_signal : - i_scr_choose == 'Full Fill Confirmed' ? short_full_fill_conf_signal : - short_reversal_signal - -long_cond = - i_scr_choose == 'FVG %' ? long_cont_1 : - i_scr_choose == 'First Touch' ? long_first_touch_signal : - i_scr_choose == 'First Touch Confirmed' ? long_first_touch_conf_signal : - i_scr_choose == 'Full Fill' ? long_full_fill_signal : - i_scr_choose == 'Full Fill Confirmed' ? long_full_fill_conf_signal : - long_reversal_signal - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - gap_percent = float(na) - //price = float(na) - _time = int(na) - _cum_pchg = float(na) - _cum_vol_pchg = float(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Short Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_long and long_cond - gap_percent := FVGUpPercent - signal := 1 - signal - - // Check for Long Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_short and short_cond - gap_percent := FVGDownPercent - signal := -1 - signal - - // Update price and time if signal is not null - if not na(signal) - //price := math.round_to_mintick(close) - _time := time - _cum_pchg := cum_pchg - _cum_vol_pchg := cum_vol_pchg - _cum_vol_pchg - - [_time, gap_percent, _cum_pchg, _cum_vol_pchg, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, 'HH:mm dd-MM-yyyy', timezone) : str.format_time(x, 'dd-MM-yyyy', timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ':'), 1) - -// Matrix setup -var matrix = matrix.new(0, 6, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, gap_percent, _cum_pchg, _cum_vol_pchg, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, gap_percent, _cum_pchg, _cum_vol_pchg, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, gap_percent, _cum_pchg, _cum_vol_pchg, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - str_gap_percent = str.tostring(gap_percent, '#.##') - str_cum_pchg = str.tostring(_cum_pchg, '#.##') - str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, str_gap_percent, str_cum_pchg, str_cum_vol_pchg, strSignal) - -// Call Screener function for multiple symbols -screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), -screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), -screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), -screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), -screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), -screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_tbl_disp_rows - while matrix.rows(matrix) > i_scr_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix) - 1) - -// Plot Table -// Create table with specified properties -var table scr_tbl = table.new(position = i_scr_tbl_position, columns = 5, rows = 102, border_width = 1, force_overlay = true) - -// Function to populate cells in the table -scr_cell_title(col, row, txt) => - table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scr_tbl_text_size) - -scr_cell(col, row, txt, _text_color, _bgcolor) => - table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = _bgcolor, text_size = i_scr_tbl_text_size) - -// Check if it's the last bar -if barstate.islast and i_scr_show_table - // Clear existing data in the table - table.clear(scr_tbl, 0, 0, 2, 101) - - scr_cell_title(0, 0, i_scr_choose) - table.merge_cells(table_id = scr_tbl, start_column = 0, start_row = 0, end_column = 4, end_row = 0) - scr_cell_title(0, 1, 'Symbol') - scr_cell_title(1, 1, 'Time') - scr_cell_title(2, 1, 'FVG %') - scr_cell_title(3, 1, '%Chg') - scr_cell_title(4, 1, 'V %Chg') - - j = 4 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 by 1 - // Determine color based on the signal - - _textcolor = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : i_neu_color - - _bg_color = matrix.get(matrix, i, 5) == '1' ? i_pos_dark_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_dark_color : i_neu_color - - // Populate cells in the table - scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) - scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) - scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) - scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) - scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) - - j := j + 1 - j - -//___________________________ Screener End - -//___________________________ Code End +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=6 +indicator(title = 'ICT Fair Value Gap (FVG) Scanner v2', shorttitle = 'FVG Scan v2', overlay = true, max_boxes_count = 500) + +//___________________________ Menu Screener Start + +g_scrtb = '█████████████████ Scanner █████████████████' + +string i_scr_choose = input.string(defval = 'First Touch Confirmed', title = 'Scanning Method', options = ['FVG %', 'First Touch', 'First Touch Confirmed', 'Full Fill', 'Full Fill Confirmed', 'Reversal'], group = g_scrtb) + +string tt_is = + "• Reads only up to first 40 symbols." + + "\n• Total characters cannot exceed 4096." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ABFRL,NSE:BANDHANBNK,NSE:BHEL,NSE:BLS,NSE:CENTRALBK,NSE:CESC,NSE:ENGINERSIN,NSE:EXIDEIND,NSE:FINPIPE,NSE:HINDCOPPER,NSE:IEX,NSE:IGL,NSE:IIFL,NSE:INOXWIND,NSE:IOB,NSE:IRB,NSE:IRCON,NSE:IRFC,NSE:LTF,NSE:MAHABANK,NSE:MANAPPURAM,NSE:MMTC,NSE:MRPL,NSE:NATIONALUM,NSE:NETWORK18,NSE:NLCINDIA,NSE:NMDC,NSE:PPLPHARMA,NSE:RAILTEL,NSE:RBLBANK,NSE:RCF,NSE:RTNINDIA,NSE:SAIL,NSE:SAMMAANCAP,NSE:SBFC,NSE:SCI,NSE:SJVN,NSE:SUZLON,NSE:TTML,NSE:FSL", + title="Paste Symbols", tooltip=tt_is, group=g_scrtb) + +bool i_scr_show_table = input.bool(defval = true, title = 'Display Table', group = g_scrtb) +bool i_scr_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scrtb) +bool i_scr_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scrtb) + +int i_scr_tbl_disp_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scrtb) +string i_scr_tbl_position = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scrtb) +string i_scr_tbl_text_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scrtb) + +//___________________________ Menu Screener End + +//___________________________ Menu Indicators Start + +g_gap = '███████████████████ FVG ███████████████████' + +bool closeGapsPartially = input.bool(defval = true, title = 'Close FVG Partially', group = g_gap) +int boxLimitInput = input.int(defval = 15, title = 'Max Number of FVG', minval = 1, maxval = 500, group = g_gap) +string minimalDeviationTooltip = 'Specifies the minimal size of detected gaps, as a percentage of the average high-low range for the last 14 bars.' +float minimalDeviationInput = nz(input.float(defval = 70.0, title = 'Minimal Deviation (%)', tooltip = minimalDeviationTooltip, minval = 1, maxval = 100, group = g_gap) / 100 * ta.sma(high - low, 14)) +bool limitBoxLengthBoolInput = input.bool(defval = false, title = 'Max Bars', tooltip = 'Limit Max Gap Trail Length (bars)', inline = 'Length Limit', group = g_gap) +int limitBoxLengthIntInput = input.int(defval = 300, title = '', inline = 'Length Limit', minval = 1, group = g_gap) + +//___________________________ Menu Indicators End + +//___________________________ Menu Additional Fiters Start + +g_af = '██████████████ Additional Fiters ██████████████' +tt_pchg = + "• If '% Change Above/Below +/-' is 4, it means relative volume is considered when the price change is above 4%." + + "\n• A value of 4% is positive for bullish scenarios and negative for bearish scenarios." + + "\n• The percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." +tt_vpchg = + "• If 'Volume % Change Above' is 0, it means Relative Volume is considered when today's volume is greater than the previous day's volume." + + "\n• For 'Screening Method' choice 'Retracement to EMA,' the 'Apply Volume % Change Filter' can be unchecked." + + "\n• A 'Volume % Change Above' 300% or more often indicates a major breakout, which may happen today or the next day." + + "\n• The volume percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." +tt_atr = + "• ATR helps filter out longer or more volatile signal candles." +tt_atr_mul = + "• Higher multiplier value filters a longer or more volatile signal candle." +tt_bf = + "• If the input is '80', it means the body covers over 80% of the candle." +tt_bs = + "• 2 means the candle is 2 times larger than the previous candle." +tt_vol = + "• Filter out a candle when its volume is greater than the SMA of the volume." +tt_rv = + "• Filter out a candle when its volume is greater than the Relative Volume." +tt_tf = + "• Filter out a signals between the given Time." +tt_df = + "• Filter out a signals on the given Date." + + "\n• This Time Filter is applicable only for 'Displacement Candles'." + +bool i_pchg_filter = input.bool(defval = false, title = 'Apply % Change Filter', tooltip = tt_pchg, group = g_af) +float i_pchg_above_below = input.float(defval = 2, title = '% Change Above/Below +/-', minval = 0, group = g_af) + +bool i_vol_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vpchg, group = g_af) +int i_vol_above = input.int(defval = 500000, title = 'Volume Above', minval = 0, group = g_af) + +bool i_vol_pchg_filter = input.bool(defval = false, title = 'Apply Volume % Change Filter', tooltip = tt_vpchg, group = g_af) +float i_vol_pchg_above = input.float(defval = 0, title = 'Volume % Change Above', minval = 0, group = g_af) + +bool i_atr_filter = input.bool(defval = false, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) +int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) +float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) + +bool i_body_filter = input.bool(defval = false, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) +float i_body_percent = input.float(defval = 70, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 + +bool i_body_size_filter = input.bool(defval = false, title = 'Apply Body Size Filter', tooltip = tt_bs, group = g_af) +int i_body_size_multiplier = input.int(defval = 2, title = 'Body Size Multiplier (x)', minval = 0, group = g_af) + +bool i_volume_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vol, group = g_af) +int i_vol_sma_length = input.int(defval = 20, minval = 1, title = 'Volume SMA Length', group = g_af) + +bool i_rel_vol_filter = input.bool(defval = false, title = 'Apply Relative Volume Filter', tooltip = tt_rv, group = g_af) +int i_rel_vol_avg_vol_len = input.int(defval = 90, title = 'Relative Volume Length', minval = 2, group = g_af) +float i_rel_vol_avg_vol_multi = input.float(defval = 5, title = 'Rel Vol SMA Multiplier', minval = 0, group = g_af) + +bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) +int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) +int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) +int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) +int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) + +bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) +int i_day = input.int(defval = 25, minval = 1, maxval = 31, title = 'Day', group = g_af) +int i_month = input.int(defval = 10, minval = 1, maxval = 12, title = 'Month', group = g_af) +int i_year = input.int(defval = 2024, minval = 0, title = 'Year', group = g_af) + +//___________________________ Menu Additional Fiters End + +//___________________________ Menu Table Start + +g_dtb = '█████████████████ Data Table █████████████████' +bool i_tbl_data_show = input.bool(defval = true, title = 'Display Table', group = g_dtb) +string i_tbl_data_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_dtb) +string i_tbl_data_txt_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_dtb) + +//___________________________ Menu Table End + +//___________________________ Chart Settings Start + +g_ch = '███████████████ Chart Settings ███████████████' +color i_pos_dark_color = input.color(defval = #03110F, title = 'Positive Dark', group = g_ch) +color i_pos_color = input.color(defval = #089981, title = 'Positive Mid', group = g_ch) +color i_pos_light_color = input.color(defval = #ACE5DC, title = 'Positive Light', group = g_ch) +color i_neg_light_color = input.color(defval = #FCCBCD, title = 'Negative Light', group = g_ch) +color i_neg_color = input.color(defval = #F23645, title = 'Negative Mid', group = g_ch) +color i_neg_dark_color = input.color(defval = #180809, title = 'Negative Dark', group = g_ch) +color i_indicator_color = input.color(defval = #2962FF, title = 'Indicator', group = g_ch) +color i_signal_color = input.color(defval = #FB8C00, title = 'Signal', group = g_ch) +color i_neu_color = input.color(defval = #9598A1, title = 'Neutral Light', group = g_ch) +color i_neu_mid_color = input.color(defval = #2A2E39, title = 'Neutral Mid', group = g_ch) +color i_neu_dark_color = input.color(defval = #141516, title = 'Neutral Dark', group = g_ch) + +float i_transp = input.float(defval=70, title="Transp", minval = 0, maxval = 100, group=g_ch) + +//___________________________ Chart Settings End + +//___________________________ FVG Start + +type AlertInfo + int countOpenGap + int countClosedGap + +method hasOpenedGap(AlertInfo this) => + this.countOpenGap > 0 + +method hasClosedGap(AlertInfo this) => + this.countClosedGap > 0 + +AlertInfo alertInfo = AlertInfo.new(0, 0) + +//@type A representation of a chart gap and all box drawings that it consists of. +//@field isActive If 'true', the gap has not yet been closed and is still being extended on the chart. +//@field isBull The direction of the gap: 'true' for upward gaps and 'false' for downward ones. +//@field inactiveBoxes An array of all boxes that have been drawn for this gap. The last element of the array is the box on the chart that is currently extended further. +type Gap + bool isActive + bool isBull + array boxes + +//@function Deletes all of the boxes that were drawn to represent the gap. +method delete(Gap this) => + for _box in this.boxes + _box.delete() + +add_transp = 20 + +//@function Closes the gap partially, stopping the previous box and creating a new, smaller box to continue the gap instead. +method partialClose(Gap this) => + activeBox = this.boxes.last() + activeBox.set_extend(extend.none) + + top = this.isBull ? activeBox.get_top() : low + bottom = this.isBull ? high : activeBox.get_bottom() + + this.boxes.push(box.new( + bar_index, + top, + bar_index, + bottom, + this.isBull ? color.new(i_neg_color, i_transp + add_transp) : color.new(i_pos_color, i_transp + add_transp), + bgcolor = this.isBull ? color.new(i_neg_color, i_transp) : color.new(i_pos_color, i_transp))) + + +//@function Closes the gap fully, stopping the box from being extended. +method fullClose(Gap this) => + alertInfo.countClosedGap += 1 + activeBox = this.boxes.last() + activeBox.set_extend(extend.none) + this.isActive := false + if closeGapsPartially + activeBox.delete() + +method checkForClose(Gap this) => + if this.isActive + activeBox = this.boxes.last() + top = activeBox.get_top() + bot = activeBox.get_bottom() + isBull = this.isBull + activeBox.set_right(bar_index) + + if (high > bot and isBull) or (low < top and not isBull) + if closeGapsPartially + this.partialClose() + else + this.fullClose() + + bool forceCloseBoxExceededLengthLimit = (limitBoxLengthBoolInput and bar_index - activeBox.get_left() >= limitBoxLengthIntInput) + if ((high > top and isBull) or (low < bot and not isBull)) or forceCloseBoxExceededLengthLimit + this.fullClose() + +var allGaps = array.new() + +// Detect gaps. +isFVGDown = high < low[2] and low[2] - high >= minimalDeviationInput +isFVGUp = low > high[2] and low - high[2] >= minimalDeviationInput +isFVG = isFVGDown or isFVGUp +boxBorderColor = isFVGDown ? color.new(i_neg_color, i_transp + add_transp) : color.new(i_pos_color, i_transp + add_transp) +boxBgcolor = isFVGDown ? color.new(i_neg_color, i_transp) : color.new(i_pos_color, i_transp) + +registerNewGap(bool isFVGDown) => + alertInfo.countOpenGap += 1 + + newBox = box.new( + bar_index - 2, + (isFVGDown ? low[2] : low), + bar_index, + (isFVGDown ? high : high[2]), + border_color = boxBorderColor, + bgcolor = boxBgcolor, + extend = extend.right) + + allGaps.push(Gap.new(true, isFVGDown, array.from(newBox))) + + if allGaps.size() > boxLimitInput + allGaps.shift().delete() + +// Detect covering of gaps. +for gap in allGaps + gap.checkForClose() + +// Add a box for each new gap, removing the oldest one if needed. +if isFVG + registerNewGap(isFVGDown) + +if barstate.islastconfirmedhistory and allGaps.size() == 0 + noGapText = "No gaps found on the current chart. \n The cause could be that some exchanges align the open of new bars on the close of the previous one, resulting in charts with no gaps. Alternatively, your Minimal Deviation might be too high." + var infoTable = table.new(position.bottom_right, 1, 1) + table.cell(infoTable, 0, 0, text = noGapText, text_color = chart.bg_color, bgcolor = chart.fg_color) + +//alertcondition(alertInfo.hasOpenedGap(), "New Gap Appeared", "A new gap has appeared.") +//alertcondition(alertInfo.hasClosedGap(), "Gap Closed", "A gap was closed.") + +// Define numeric values for plotting gaps +var isFVGDown_top = float(na) +var isFVGDown_bottom = float(na) +var float FVGDownPercent = na +if isFVGDown + isFVGDown_top := low[2] + isFVGDown_bottom := high + FVGDownPercent := (low[2] - high) / low[2] * 100 + FVGDownPercent + +var isFVGUp_top = float(na) +var isFVGUp_bottom = float(na) +var float FVGUpPercent = na +if isFVGUp + isFVGUp_top := low + isFVGUp_bottom := high[2] + FVGUpPercent := (low - high[2]) / high[2] * 100 + FVGUpPercent + +// Plot +plot(series = isFVGDown_top, title = 'FVG Down Top', color = i_neg_color, display = display.none) +plot(series = isFVGDown_bottom, title = 'FVG Down Bottom', color = i_neg_color, display = display.none) +plot(series = isFVGUp_top, title = 'FVG Up Top', color = i_pos_color, display = display.none) +plot(series = isFVGUp_bottom, title = 'FVG Up Bottom', color = i_pos_color, display = display.none) + +//___________________________ FVG End + +//___________________________ Cumulative Percentage Change Start + +// Function to calculate Daily Cumulative Percentage Change of Close Price +cumulative_percentage_change() => + var float _cum_pct_change = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 + _cum_pct_change := bool(_is_new_day) ? _daily_pct_change : na(_cum_pct_change) ? _daily_pct_change : _cum_pct_change + _daily_pct_change + _cum_pct_change + +// Calculate current cumulative percentage change +cum_pchg = cumulative_percentage_change() + +//___________________________ Cumulative Percentage Change End + +//___________________________ Cumulative Volume Percentage Change Start + +// Function to calculate Daily Cumulative Volume +cumulative_volume() => + var float _cum_vol = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _cum_vol := bool(_is_new_day) ? volume : na(_cum_vol) ? volume : _cum_vol + volume + _cum_vol + +// Calculate current and previous day cumulative volumes +var float current_cum_vol = na +var float prev_cum_vol = na + +if ta.change(time('D')) != 0 + prev_cum_vol := current_cum_vol + current_cum_vol := volume + current_cum_vol +else + current_cum_vol := current_cum_vol + volume + current_cum_vol + +// Calculate Cumulative Volume Percentage Change +cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 + +//___________________________ Cumulative Volume Percentage Change End + +//___________________________ Additional Filters Start + +// % Change Filter +bool pchg_above_filter = true +bool pchg_below_filter = true +if i_pchg_filter + pchg_above_filter := cum_pchg > i_pchg_above_below + pchg_below_filter := cum_pchg < -i_pchg_above_below + pchg_below_filter + +// Volume Filter +bool vol_filter = true +if i_vol_filter + vol_filter := current_cum_vol >= i_vol_above + vol_filter + +// Volume % Change Filter +bool vol_pchg_filter = true +if i_vol_pchg_filter + vol_pchg_filter := cum_vol_pchg >= i_vol_pchg_above + vol_pchg_filter + +// ATR Filter +bool atr_filter = true +if i_atr_filter + atr_filter := high - low > ta.atr(i_atr_length) * i_atr_multi + atr_filter + +// Body Percent Filter +bool body_filter = true +if i_body_filter + body_filter := math.abs(close - open) / (high - low) >= i_body_percent + body_filter + +// Body Size Filter +bool body_size_filter = true +if i_body_size_filter + body_size_filter := math.abs(close - open) / (high - low) >= i_body_percent and high - low >= (high[1] - low[1]) * i_body_size_multiplier + body_size_filter + +// Volume SMA Filter +bool volume_filter = true +if i_volume_filter + volume_filter := volume > ta.sma(volume, i_vol_sma_length) + volume_filter + +// Continuous Signals Filter +average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) +relative_volume = volume / average_volume[1] +rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi + +bool rel_vol_filter = true +if i_rel_vol_filter + rel_vol_filter := relative_volume > rel_vol_sma_multiplier + rel_vol_filter + +// Time Filter +bool time_filter = true +if i_time_filter + time_filter := (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) + time_filter + +// Date Filter +bool date_filter = true +if i_date_filter + date_filter := year == i_year and month == i_month and dayofmonth == i_day + date_filter + +//___________________________ Additional Filters End + +//___________________________ Fibonacci Start + +// Fibonacci Function +fibonacci(bool calc_from_high, high_value, low_value, float fib_value) => + if calc_from_high + low_value + (high_value - low_value) * fib_value + else + high_value - (high_value - low_value) * fib_value + +//___________________________ Fibonacci End + +//___________________________ Signals Start + +//___________________________ Continuous Signals Start + +//___________________________ Short Continuous Signals Start + +//___________________________ Short Continuous Break Signals + +// Short Condition 1 +short_cont_1 = + isFVGDown and + time_filter and + date_filter and + barstate.isconfirmed + +// Short Condition 2 +short_cont_2 = + ta.crossover(high, isFVGDown_bottom) and + time_filter and + date_filter and + barstate.isconfirmed + +var short_cont_2_low = float(na) +if short_cont_2 + short_cont_2_low := low + short_cont_2_low + +// Short Condition 2 Confirmed +short_cont_2_conf = + ta.crossunder(close, short_cont_2_low) and + time_filter and + date_filter and + barstate.isconfirmed + +// Short Condition 3 +short_cont_3 = + ta.crossover(high, isFVGDown_top) and + close < isFVGDown_top and + time_filter and + date_filter and + barstate.isconfirmed + +var short_cont_3_low = float(na) +if short_cont_3 + short_cont_3_low := low + short_cont_3_low + +// Short Condition 3 Confirmed +short_cont_3_conf = + ta.crossunder(close, short_cont_3_low) and + time_filter and + date_filter and + barstate.isconfirmed + +// Short Condition 4 +short_cont_4 = + ta.crossover(close, isFVGDown_top) and + time_filter and + date_filter and + barstate.isconfirmed + +// Short First Touch +var short_first_touch_current_state = 0 +short_first_touch_prev_state = nz(short_first_touch_current_state[1]) +short_first_touch_current_state := short_first_touch_prev_state == 2 ? 0 : short_first_touch_prev_state +if short_cont_1 and short_first_touch_current_state == 0 + short_first_touch_current_state := 1 + short_first_touch_current_state +if short_cont_2 and short_first_touch_current_state == 1 + short_first_touch_current_state := 2 + short_first_touch_current_state + +short_first_touch_signal = short_first_touch_current_state == 2 ? true : false + +// Short Confirmed First Touch +var short_first_touch_conf_current_state = 0 +short_first_touch_conf_prev_state = nz(short_first_touch_conf_current_state[1]) +short_first_touch_conf_current_state := short_first_touch_conf_prev_state == 3 ? 0 : short_first_touch_conf_prev_state +if short_cont_1 and short_first_touch_conf_current_state == 0 + short_first_touch_conf_current_state := 1 + short_first_touch_conf_current_state +if short_cont_2 and short_first_touch_conf_current_state == 1 + short_first_touch_conf_current_state := 2 + short_first_touch_conf_current_state +if short_cont_2_conf and short_first_touch_conf_current_state == 2 + short_first_touch_conf_current_state := 3 + short_first_touch_conf_current_state + +short_first_touch_conf_signal = short_first_touch_conf_current_state == 3 ? true : false + +// Short Full Fill +var short_full_fill_current_state = 0 +short_full_fill_prev_state = nz(short_full_fill_current_state[1]) +short_full_fill_current_state := short_full_fill_prev_state == 2 ? 0 : short_full_fill_prev_state +if short_cont_1 and short_full_fill_current_state == 0 + short_full_fill_current_state := 1 + short_full_fill_current_state +if short_cont_3 and short_full_fill_current_state == 1 + short_full_fill_current_state := 2 + short_full_fill_current_state + +short_full_fill_signal = short_full_fill_current_state == 2 ? true : false + +// Short Full Fill Confirmed +var short_full_fill_conf_current_state = 0 +short_full_fill_conf_prev_state = nz(short_full_fill_conf_current_state[1]) +short_full_fill_conf_current_state := short_full_fill_conf_prev_state == 3 ? 0 : short_full_fill_conf_prev_state +if short_cont_1 and short_full_fill_conf_current_state == 0 + short_full_fill_conf_current_state := 1 + short_full_fill_conf_current_state +if short_cont_3 and short_full_fill_conf_current_state == 1 + short_full_fill_conf_current_state := 2 + short_full_fill_conf_current_state +if short_cont_3_conf and short_full_fill_conf_current_state == 2 + short_full_fill_conf_current_state := 3 + short_full_fill_conf_current_state + +short_full_fill_conf_signal = short_full_fill_conf_current_state == 3 ? true : false + +// Short Reversal +var short_reversal_current_state = 0 +short_reversal_prev_state = nz(short_reversal_current_state[1]) +short_reversal_current_state := short_reversal_prev_state == 2 ? 0 : short_reversal_prev_state +if short_cont_1 and short_reversal_current_state == 0 + short_reversal_current_state := 1 + short_reversal_current_state +if short_cont_4 and short_reversal_current_state == 1 + short_reversal_current_state := 2 + short_reversal_current_state + +short_reversal_signal = short_reversal_current_state == 2 ? true : false + +//___________________________ Short Continuous Signals End + +//___________________________ Long Continuous Signals Start + +//___________________________ Long Continuous Break Signals + +// Long Condition 1 +long_cont_1 = + isFVGUp and + time_filter and + date_filter and + barstate.isconfirmed + +// Long Condition 2 +long_cont_2 = + ta.crossunder(low, isFVGUp_top) and + time_filter and + date_filter and + barstate.isconfirmed + +var long_cont_2_high = float(na) +if long_cont_2 + long_cont_2_high := high + long_cont_2_high + +// Long Condition 2 Confirmed +long_cont_2_conf = + ta.crossover(close, long_cont_2_high) and + time_filter and + date_filter and + barstate.isconfirmed + +// Long Condition 3 +long_cont_3 = + ta.crossunder(low, isFVGUp_bottom) and + close > isFVGUp_bottom and + time_filter and + date_filter and + barstate.isconfirmed + +var long_cont_3_high = float(na) +if long_cont_3 + long_cont_3_high := high + long_cont_3_high + +// Long Condition 3 Confirmed +long_cont_3_conf = + ta.crossover(close, long_cont_3_high) and + time_filter and + date_filter and + barstate.isconfirmed + +// Long Condition 4 +long_cont_4 = + ta.crossunder(close, isFVGUp_bottom) and + time_filter and + date_filter and + barstate.isconfirmed + +// Long First Touch +var long_first_touch_current_state = 0 +long_first_touch_prev_state = nz(long_first_touch_current_state[1]) +long_first_touch_current_state := long_first_touch_prev_state == 2 ? 0 : long_first_touch_prev_state +if long_cont_1 and long_first_touch_current_state == 0 + long_first_touch_current_state := 1 + long_first_touch_current_state +if long_cont_2 and long_first_touch_current_state == 1 + long_first_touch_current_state := 2 + long_first_touch_current_state + +long_first_touch_signal = long_first_touch_current_state == 2 ? true : false + +// Long First Touch Confirmed +var long_first_touch_conf_current_state = 0 +long_first_touch_conf_prev_state = nz(long_first_touch_conf_current_state[1]) +long_first_touch_conf_current_state := long_first_touch_conf_prev_state == 3 ? 0 : long_first_touch_conf_prev_state +if long_cont_1 and long_first_touch_conf_current_state == 0 + long_first_touch_conf_current_state := 1 + long_first_touch_conf_current_state +if long_cont_2 and long_first_touch_conf_current_state == 1 + long_first_touch_conf_current_state := 2 + long_first_touch_conf_current_state +if long_cont_2_conf and long_first_touch_conf_current_state == 2 + long_first_touch_conf_current_state := 3 + long_first_touch_conf_current_state + +long_first_touch_conf_signal = long_first_touch_conf_current_state == 3 ? true : false + +// Long Full Fill +var long_full_fill_current_state = 0 +long_full_fill_prev_state = nz(long_full_fill_current_state[1]) +long_full_fill_current_state := long_full_fill_prev_state == 2 ? 0 : long_full_fill_prev_state +if long_cont_1 and long_full_fill_current_state == 0 + long_full_fill_current_state := 1 + long_full_fill_current_state +if long_cont_3 and long_full_fill_current_state == 1 + long_full_fill_current_state := 2 + long_full_fill_current_state + +long_full_fill_signal = long_full_fill_current_state == 2 ? true : false + +// Long Full Fill Confirmed +var long_full_fill_conf_current_state = 0 +long_full_fill_conf_prev_state = nz(long_full_fill_conf_current_state[1]) +long_full_fill_conf_current_state := long_full_fill_conf_prev_state == 3 ? 0 : long_full_fill_conf_prev_state +if long_cont_1 and long_full_fill_conf_current_state == 0 + long_full_fill_conf_current_state := 1 + long_full_fill_conf_current_state +if long_cont_3 and long_full_fill_conf_current_state == 1 + long_full_fill_conf_current_state := 2 + long_full_fill_conf_current_state +if long_cont_3_conf and long_full_fill_conf_current_state == 2 + long_full_fill_conf_current_state := 3 + long_full_fill_conf_current_state + +long_full_fill_conf_signal = long_full_fill_conf_current_state == 3 ? true : false + +// Long Reversal +var long_reversal_current_state = 0 +long_reversal_prev_state = nz(long_reversal_current_state[1]) +long_reversal_current_state := long_reversal_prev_state == 2 ? 0 : long_reversal_prev_state +if long_cont_1 and long_reversal_current_state == 0 + long_reversal_current_state := 1 + long_reversal_current_state +if long_cont_4 and long_reversal_current_state == 1 + long_reversal_current_state := 2 + long_reversal_current_state + +long_reversal_signal = long_reversal_current_state == 2 ? true : false + +//___________________________ Long Continuous Signals End + +//___________________________ Plot Continuous Signals + +// 1 +plotchar(series = i_scr_show_short and i_scr_choose == 'First Touch' and short_first_touch_signal ? 3 : na, title = 'Short First Touch', char = '↷', location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) +plotchar(series = i_scr_show_long and i_scr_choose == 'First Touch' and long_first_touch_signal ? 3 : na, title = 'Long First Touch', char = '⤻', location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) +barcolor(color = i_scr_show_short and i_scr_choose == 'First Touch' and short_first_touch_signal ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'First Touch' and long_first_touch_signal ? i_pos_light_color : na, title = 'First Touch Candle') + +// 2 +plotshape(series = i_scr_show_short and i_scr_choose == 'First Touch Confirmed' and short_first_touch_conf_signal ? 4 : na, title = 'Short Confirmed First Touch', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) +plotshape(series = i_scr_show_long and i_scr_choose == 'First Touch Confirmed' and long_first_touch_conf_signal ? 4 : na, title = 'Long Confirmed First Touch', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) +barcolor(color = i_scr_show_short and i_scr_choose == 'First Touch Confirmed' and short_first_touch_conf_signal ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'First Touch Confirmed' and long_first_touch_conf_signal ? i_pos_light_color : na, title = 'Confirmed First Touch Candle') + +// 3 +plotchar(series = i_scr_show_short and i_scr_choose == 'Full Fill' and short_full_fill_signal ? 3 : na, title = 'Short Full Fill', char = '↷', location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) +plotchar(series = i_scr_show_long and i_scr_choose == 'Full Fill' and long_full_fill_signal ? 3 : na, title = 'Long Full Fill', char = '⤻', location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) +barcolor(color = i_scr_show_short and i_scr_choose == 'Full Fill' and short_full_fill_signal ? i_pos_light_color : i_scr_show_long and i_scr_choose == 'Full Fill' and long_full_fill_signal ? i_neg_light_color : na, title = 'Full Fill Candle') + +// 4 +plotshape(series = i_scr_show_short and i_scr_choose == 'Full Fill Confirmed' and short_full_fill_conf_signal ? 4 : na, title = 'Short Confirmed Full Fill', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) +plotshape(series = i_scr_show_long and i_scr_choose == 'Full Fill Confirmed' and long_full_fill_conf_signal ? 4 : na, title = 'Long Confirmed Full Fill', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) +barcolor(color = i_scr_show_short and i_scr_choose == 'Full Fill Confirmed' and short_full_fill_conf_signal ? i_pos_light_color : i_scr_show_long and i_scr_choose == 'Full Fill Confirmed' and long_full_fill_conf_signal ? i_neg_light_color : na, title = 'Confirmed Full Fill Candle') + +// 5 +plotshape(series = i_scr_show_short and i_scr_choose == 'Reversal' and short_reversal_signal ? 3 : na, title = 'Long Reversal', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) +plotshape(series = i_scr_show_long and i_scr_choose == 'Reversal' and long_reversal_signal ? 3 : na, title = 'Short Reversal', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) +barcolor(color = i_scr_show_short and i_scr_choose == 'Reversal' and short_reversal_signal ? i_pos_light_color : i_scr_show_long and i_scr_choose == 'Reversal' and long_reversal_signal ? i_neg_light_color : na, title = 'Reversal Candle') + +//___________________________ Continuous Signals End + +//___________________________ Signals End + +//___________________________ Data Table Start + +// To String +day_pchg_str = str.tostring(cum_pchg, '#.##') + ' %' +volume_pchg_str = str.tostring(cum_vol_pchg, '#.##') + ' %' +day_volume_str = str.tostring(current_cum_vol / 100000, '#.##') + ' L' +prev_day_volume_str = str.tostring(prev_cum_vol / 100000, '#.##') + ' L' + +// Color +bgcolor_1 = i_neu_dark_color +bgcolor_2 = i_neu_mid_color + +pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color +vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color +prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color + +// Plot Table +var table tbl_data = table.new(position = i_tbl_data_pos, columns = 2, rows = 4, border_width = 1, force_overlay = true) + +if barstate.islast and i_tbl_data_show + table.cell(table_id = tbl_data, column = 0, row = 0, text = '%Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 0, text = day_pchg_str, text_color = pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + + table.cell(table_id = tbl_data, column = 0, row = 1, text = 'Vol %Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 1, text = volume_pchg_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + + table.cell(table_id = tbl_data, column = 0, row = 2, text = 'Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 2, text = day_volume_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + + table.cell(table_id = tbl_data, column = 0, row = 3, text = 'PD Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 3, text = prev_day_volume_str, text_color = prev_vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + +//___________________________ Data Table End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//___________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + loop + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + loop + [getT, loop] // return tickerid in first position & truncated list + +[tid_01, out_01] = feed(effective_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), +[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), +[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), +[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), +[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), +[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), +[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), +[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), +[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), +[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) + +//___________________________ Get Symbols for Screener End + +//___________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Scanner Conditions +short_cond = + i_scr_choose == 'FVG %' ? short_cont_1 : + i_scr_choose == 'First Touch' ? short_first_touch_signal : + i_scr_choose == 'First Touch Confirmed' ? short_first_touch_conf_signal : + i_scr_choose == 'Full Fill' ? short_full_fill_signal : + i_scr_choose == 'Full Fill Confirmed' ? short_full_fill_conf_signal : + short_reversal_signal + +long_cond = + i_scr_choose == 'FVG %' ? long_cont_1 : + i_scr_choose == 'First Touch' ? long_first_touch_signal : + i_scr_choose == 'First Touch Confirmed' ? long_first_touch_conf_signal : + i_scr_choose == 'Full Fill' ? long_full_fill_signal : + i_scr_choose == 'Full Fill Confirmed' ? long_full_fill_conf_signal : + long_reversal_signal + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + gap_percent = float(na) + //price = float(na) + _time = int(na) + _cum_pchg = float(na) + _cum_vol_pchg = float(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Short Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_long and long_cond + gap_percent := FVGUpPercent + signal := 1 + signal + + // Check for Long Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_short and short_cond + gap_percent := FVGDownPercent + signal := -1 + signal + + // Update price and time if signal is not null + if not na(signal) + //price := math.round_to_mintick(close) + _time := time + _cum_pchg := cum_pchg + _cum_vol_pchg := cum_vol_pchg + _cum_vol_pchg + + [_time, gap_percent, _cum_pchg, _cum_vol_pchg, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, 'HH:mm dd-MM-yyyy', timezone) : str.format_time(x, 'dd-MM-yyyy', timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ':'), 1) + +// Matrix setup +var matrix = matrix.new(0, 6, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, gap_percent, _cum_pchg, _cum_vol_pchg, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, gap_percent, _cum_pchg, _cum_vol_pchg, signal)) + +// Screener function to collect data +screener(s) => + [_time, gap_percent, _cum_pchg, _cum_vol_pchg, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + str_gap_percent = str.tostring(gap_percent, '#.##') + str_cum_pchg = str.tostring(_cum_pchg, '#.##') + str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, str_gap_percent, str_cum_pchg, str_cum_vol_pchg, strSignal) + +// Call Screener function for multiple symbols +screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), +screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), +screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), +screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), +screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), +screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_tbl_disp_rows + while matrix.rows(matrix) > i_scr_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix) - 1) + +// Plot Table +// Create table with specified properties +var table scr_tbl = table.new(position = i_scr_tbl_position, columns = 5, rows = 102, border_width = 1, force_overlay = true) + +// Function to populate cells in the table +scr_cell_title(col, row, txt) => + table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scr_tbl_text_size) + +scr_cell(col, row, txt, _text_color, _bgcolor) => + table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = _bgcolor, text_size = i_scr_tbl_text_size) + +// Check if it's the last bar +if barstate.islast and i_scr_show_table + // Clear existing data in the table + table.clear(scr_tbl, 0, 0, 2, 101) + + scr_cell_title(0, 0, i_scr_choose) + table.merge_cells(table_id = scr_tbl, start_column = 0, start_row = 0, end_column = 4, end_row = 0) + scr_cell_title(0, 1, 'Symbol') + scr_cell_title(1, 1, 'Time') + scr_cell_title(2, 1, 'FVG %') + scr_cell_title(3, 1, '%Chg') + scr_cell_title(4, 1, 'V %Chg') + + j = 4 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 by 1 + // Determine color based on the signal + + _textcolor = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : i_neu_color + + _bg_color = matrix.get(matrix, i, 5) == '1' ? i_pos_dark_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_dark_color : i_neu_color + + // Populate cells in the table + scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) + scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) + scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) + scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) + scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) + + j := j + 1 + j + +//___________________________ Screener End + +//___________________________ Code End + diff --git a/ICT Liquidity Sweep Pattern Scanner/Scanner - ICT Liquidity Sweep Pattern Scanner.txt b/ICT Liquidity Sweep Pattern Scanner/Scanner - ICT Liquidity Sweep Pattern Scanner.txt index edbc08c..c498ff6 100644 --- a/ICT Liquidity Sweep Pattern Scanner/Scanner - ICT Liquidity Sweep Pattern Scanner.txt +++ b/ICT Liquidity Sweep Pattern Scanner/Scanner - ICT Liquidity Sweep Pattern Scanner.txt @@ -1,667 +1,891 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -indicator(title='ICT Liquidity Sweep Pattern Scanner', shorttitle='ICT LSP Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) - -//_____________________________ Menu Screener Start - -g_scrtb = '█████████████████ Scanner █████████████████' - -string i_scr_choose = input.string(defval='Prev 2 Swing Sweep', title='Screening Method', options=['Prev 1 Swing Sweep', 'Prev 2 Swing Sweep', 'Prev 3 Swing Sweep'], group=g_scrtb) - -tt_is = "• Reads only up to first 40 symbols." + - "\n• Total characters cannot exceed 4096." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ABCAPITAL,NSE:BIOCON,NSE:BLS,NSE:BOMDYEING,NSE:CAPACITE,NSE:CESC,NSE:CHAMBLFERT,NSE:DCBBANK,NSE:ENGINERSIN,NSE:GIPCL,NSE:GMDCLTD,NSE:GSFC,NSE:HINDCOPPER,NSE:HINDOILEXP,NSE:INDIACEM,NSE:IOC,NSE:IRCON,NSE:IRFC,NSE:LTFOODS,NSE:MANAPPURAM,NSE:M_MFIN,NSE:NATIONALUM,NSE:NBCC,NSE:NFL,NSE:NLCINDIA,NSE:NMDC,NSE:PNB,NSE:PRAKASH,NSE:PTC,NSE:RAILTEL,NSE:RAIN,NSE:RBLBANK,NSE:RCF,NSE:RELINFRA,NSE:SAIL,NSE:SARDAEN,NSE:SJVN,NSE:TATASTEEL,NSE:TIMETECHNO,NSE:VEDL", - title="Paste Symbols", tooltip=tt_is, group=g_scrtb) - -bool i_scr_show_table = input.bool(defval=true, title='Display Table', group=g_scrtb) -bool i_scr_show_long = input.bool(defval=true, title='Long Signals', inline='tb_2', group=g_scrtb) -bool i_scr_show_short = input.bool(defval=true, title='Short Signals', inline='tb_2', group=g_scrtb) - -int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) -string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) -string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) - -//_____________________________ Menu Screener End - -//_____________________________ Menu Zig Zag Start - -g_zz = '██████████████████ Zig Zag ██████████████████' - -bool i_zz_display = input.bool(defval=true, title='Display Zig Zag', group=g_zz) -int i_zz_period = input.int(defval=4, title='Zig Zag Length', minval=2, group=g_zz) -string i_zz_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close'], group=g_zz) -color i_zz_bull_color = input.color(defval=#1E53E5, title='Color Up', group=g_zz) -color i_zz_bear_color = input.color(defval=#1E53E5, title='Color Down', group=g_zz) -string i_zz_ln_style = input.string(defval=line.style_solid, title="Line Style", options=[line.style_solid, line.style_dashed, line.style_dotted], group=g_zz) - -//_____________________________ Menu Zig Zag End - -//_____________________________ Menu Table Start - -g_dtb = '█████████████████ Data Table █████████████████' -bool i_tbl_data_show = input.bool(defval=true, title='Display Table', group=g_dtb) -string i_tbl_data_pos = input.string(defval=position.bottom_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_dtb) -string i_tbl_data_txt_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_dtb) - -//_____________________________ Menu Table End - -//_____________________________ Chart Settings Start - -g_ch = '███████████████ Chart Settings ███████████████' -color i_pos_dark_color = input.color(defval=#03110F, title='Positive Dark', group=g_ch) -color i_pos_color = input.color(defval=#26A69A, title='Positive Mid', group=g_ch) -color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) -color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) -color i_neg_color = input.color(defval=#FF5252, title='Negative Mid', group=g_ch) -color i_neg_dark_color = input.color(defval=#180809, title='Negative Dark', group=g_ch) -//color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) -//color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) -color i_neu_color = input.color(defval=#D1D4DC, title='Neutral Light', group=g_ch) -color i_neu_mid_color = input.color(defval=#2A2E39, title='Neutral Mid', group=g_ch) -color i_neu_dark_color = input.color(defval=#141516, title='Neutral Dark', group=g_ch) - -//_____________________________ Chart Settings End - -//_____________________________ Cumulative Percentage Change Start - -// Function to calculate Daily Cumulative Percentage Change of Close Price -cumulative_percentage_change() => - var float _cum_pct_change = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 - _cum_pct_change := _is_new_day ? _daily_pct_change : (na(_cum_pct_change) ? _daily_pct_change : (_cum_pct_change + _daily_pct_change)) - _cum_pct_change - -// Calculate current cumulative percentage change -cum_pchg = cumulative_percentage_change() - -//_____________________________ Cumulative Percentage Change End - -//_____________________________ Cumulative Volume Percentage Change Start - -// Function to calculate Daily Cumulative Volume -cumulative_volume() => - var float _cum_vol = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _cum_vol := _is_new_day ? volume : (na(_cum_vol) ? volume : (_cum_vol + volume)) - _cum_vol - -// Calculate current and previous day cumulative volumes -var float current_cum_vol = na -var float prev_cum_vol = na - -if ta.change(time('D')) != 0 - prev_cum_vol := current_cum_vol - current_cum_vol := volume -else - current_cum_vol += volume - -// Calculate Cumulative Volume Percentage Change -cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 - -//_____________________________ Cumulative Volume Percentage Change End - -//_____________________________ Zig Zag Start - -// Acknowledgement & Reference -// Trader: 'RozaniGhani-RG' -// Indicator Title: 'Zig Zag Ratio Simplified' -// Indicator Link: 'https://www.tradingview.com/script/CIk186OY-Zig-Zag-Ratio-Simplified/' - -//_____________________________ Get Source - -float _high = i_zz_source == 'Open/Close' ? math.max(open, close) : high -float _low = i_zz_source == 'Open/Close' ? math.min(open, close) : low - -//============================== 1. Variables - -//_____________________________ 1.1 Highest / Lowest -float ph = ta.highestbars(_high, i_zz_period) == 0 ? _high : na -float pl = ta.lowestbars(_low, i_zz_period) == 0 ? _low : na - -//_____________________________ 1.2 Dir -var int dir = 0, dir := pl and na(ph) ? -1 : ph and na(pl) ? 1 : dir - -//_____________________________ 1.4 Array -var max_array_size = 14, var zigzag = array.new_float(0), oldzigzag = array.copy(zigzag) - -//_____________________________ 1.5 Others -var line line_zz = na - -//============================== 3. Custom Functions - -add_to_zigzag(float[] pointer, float value, int bindex) => - array.unshift(pointer, bindex) - array.unshift(pointer, value) - if array.size(pointer) > max_array_size - array.pop(pointer) - array.pop(pointer) - -update_zigzag(float[] pointer, float value, int bindex, int dir) => - if array.size(pointer) == 0 - add_to_zigzag(pointer, value, bindex) - else - if dir == 1 and value > array.get(pointer, 0) or dir == -1 and value < array.get(pointer, 0) - array.set(pointer, 0, value) - array.set(pointer, 1, bindex) - 0. - -//============================== 4. Calculations - -dirchanged = ta.change(dir) - -if ph or pl - if dirchanged - add_to_zigzag(zigzag, dir == 1 ? ph : pl, bar_index) - else - update_zigzag(zigzag, dir == 1 ? ph : pl, bar_index, dir) - -//============================== 5. Constructs - -if array.size(zigzag) >= 6 - if array.get(zigzag, 0) != array.get(oldzigzag, 0) or array.get(zigzag, 1) != array.get(oldzigzag, 1) - if array.get(zigzag, 2) == array.get(oldzigzag, 2) and array.get(zigzag, 3) == array.get(oldzigzag, 3) - line.delete(line_zz) - if i_zz_display - line_zz := line.new(x1 = math.round(array.get(zigzag, 1)), y1 = array.get(zigzag, 0), x2 = math.round(array.get(zigzag, 3)), y2 = array.get(zigzag, 2), color = dir == 1 ? i_zz_bull_color : i_zz_bear_color, width=1) - -//_____________________________ Get Swing Price & Bar Index - -//zz_0 = array.size(zigzag) > 15 ? array.get(zigzag, array.size(zigzag) - 16) : na -//bi_0 = array.size(zigzag) > 14 ? array.get(zigzag, array.size(zigzag) - 15) : na -zz_1 = array.size(zigzag) > 13 ? array.get(zigzag, array.size(zigzag) - 14) : na -//bi_1 = array.size(zigzag) > 12 ? array.get(zigzag, array.size(zigzag) - 13) : na -zz_2 = array.size(zigzag) > 11 ? array.get(zigzag, array.size(zigzag) - 12) : na -//bi_2 = array.size(zigzag) > 10 ? array.get(zigzag, array.size(zigzag) - 11) : na -zz_3 = array.size(zigzag) > 9 ? array.get(zigzag, array.size(zigzag) - 10) : na -bi_3 = array.size(zigzag) > 8 ? array.get(zigzag, array.size(zigzag) - 9) : na -zz_4 = array.size(zigzag) > 7 ? array.get(zigzag, array.size(zigzag) - 8) : na -//bi_4 = array.size(zigzag) > 6 ? array.get(zigzag, array.size(zigzag) - 7) : na -zz_5 = array.size(zigzag) > 5 ? array.get(zigzag, array.size(zigzag) - 6) : na -bi_5 = array.size(zigzag) > 4 ? array.get(zigzag, array.size(zigzag) - 5) : na -zz_6 = array.size(zigzag) > 3 ? array.get(zigzag, array.size(zigzag) - 4) : na -//bi_6 = array.size(zigzag) > 2 ? array.get(zigzag, array.size(zigzag) - 3) : na -zz_7 = array.size(zigzag) > 1 ? array.get(zigzag, array.size(zigzag) - 2) : na -bi_7 = array.size(zigzag) > 0 ? array.get(zigzag, array.size(zigzag) - 1) : na - -// Create a single label for the last five zigzag values and their corresponding bar index -//label_text = str.tostring(zz_0) + "\n" + str.tostring(bi_0) + "\n" + str.tostring(zz_1) + "\n" + str.tostring(bi_1) + "\n" + str.tostring(zz_2) + -// "\n" + str.tostring(bi_2) + "\n" + str.tostring(zz_3) + "\n" + str.tostring(bi_3) + "\n" + str.tostring(zz_4) + "\n" + str.tostring(bi_4) -//if barstate.islast -// label.new(x = bar_index, y = high, text = label_text, color=color.white) - -//_____________________________ Zig Zag End - -//_____________________________ Signals Start - -// Short Condition -short_condition_1 = - zz_2 < zz_3 and - zz_2 < zz_4 and - zz_2 < zz_6 and - zz_2 < zz_7 and - - zz_3 < zz_5 and - zz_3 > zz_4 and - zz_3 > zz_2 and - - zz_4 < zz_3 and - zz_4 < zz_5 and - zz_4 < zz_6 and - zz_4 < zz_7 and - - zz_5 > zz_3 and - zz_5 > zz_4 and - zz_5 > zz_6 and - zz_5 < zz_7 and - - zz_6 < zz_5 and - zz_6 < zz_7 and - zz_6 > zz_4 and - - zz_7 > zz_2 and - zz_7 > zz_3 and - zz_7 > zz_4 and - zz_7 > zz_5 and - zz_7 > zz_6 and - - ta.crossover(zz_1, zz_3) and - - barstate.isconfirmed - -short_condition_2 = - zz_2 < zz_3 and - zz_2 < zz_4 and - zz_2 < zz_6 and - zz_2 < zz_7 and - - zz_3 < zz_5 and - zz_3 > zz_4 and - zz_3 > zz_2 and - - zz_4 < zz_3 and - zz_4 < zz_5 and - zz_4 < zz_6 and - zz_4 < zz_7 and - - zz_5 > zz_3 and - zz_5 > zz_4 and - zz_5 > zz_6 and - zz_5 < zz_7 and - - zz_6 < zz_5 and - zz_6 < zz_7 and - zz_6 > zz_4 and - - zz_7 > zz_2 and - zz_7 > zz_3 and - zz_7 > zz_4 and - zz_7 > zz_5 and - zz_7 > zz_6 and - - ta.crossover(zz_1, zz_5) and - - barstate.isconfirmed - -short_condition_3 = - zz_2 < zz_3 and - zz_2 < zz_4 and - zz_2 < zz_6 and - zz_2 < zz_7 and - - zz_3 < zz_5 and - zz_3 > zz_4 and - zz_3 > zz_2 and - - zz_4 < zz_3 and - zz_4 < zz_5 and - zz_4 < zz_6 and - zz_4 < zz_7 and - - zz_5 > zz_3 and - zz_5 > zz_4 and - zz_5 > zz_6 and - zz_5 < zz_7 and - - zz_6 < zz_5 and - zz_6 < zz_7 and - zz_6 > zz_4 and - - zz_7 > zz_2 and - zz_7 > zz_3 and - zz_7 > zz_4 and - zz_7 > zz_5 and - zz_7 > zz_6 and - - ta.crossover(zz_1, zz_7) and - - barstate.isconfirmed - -// Long Condition -long_condition_1 = - zz_2 < zz_3 and - zz_2 < zz_4 and - zz_2 < zz_6 and - zz_2 < zz_7 and - - zz_3 < zz_5 and - zz_3 > zz_4 and - zz_3 > zz_2 and - - zz_4 < zz_3 and - zz_4 < zz_5 and - zz_4 < zz_6 and - zz_4 < zz_7 and - - zz_5 > zz_3 and - zz_5 > zz_4 and - zz_5 > zz_6 and - zz_5 < zz_7 and - - zz_6 < zz_5 and - zz_6 < zz_7 and - zz_6 > zz_4 and - - zz_7 > zz_2 and - zz_7 > zz_3 and - zz_7 > zz_4 and - zz_7 > zz_5 and - zz_7 > zz_6 and - - ta.crossunder(zz_1, zz_3) and - - barstate.isconfirmed - -long_condition_2 = - zz_2 > zz_3 and - zz_2 > zz_4 and - zz_2 > zz_6 and - zz_2 > zz_7 and - - zz_3 > zz_5 and - zz_3 < zz_4 and - zz_3 < zz_2 and - - zz_4 > zz_3 and - zz_4 > zz_5 and - zz_4 > zz_6 and - zz_4 > zz_7 and - - zz_5 < zz_3 and - zz_5 < zz_4 and - zz_5 < zz_6 and - zz_5 > zz_7 and - - zz_6 > zz_5 and - zz_6 > zz_7 and - zz_6 < zz_4 and - - zz_7 < zz_2 and - zz_7 < zz_3 and - zz_7 < zz_4 and - zz_7 < zz_5 and - zz_7 < zz_6 and - - ta.crossunder(zz_1, zz_5) and - - barstate.isconfirmed - -long_condition_3 = - zz_2 > zz_3 and - zz_2 > zz_4 and - zz_2 > zz_6 and - zz_2 > zz_7 and - - zz_3 > zz_5 and - zz_3 < zz_4 and - zz_3 < zz_2 and - - zz_4 > zz_3 and - zz_4 > zz_5 and - zz_4 > zz_6 and - zz_4 > zz_7 and - - zz_5 < zz_3 and - zz_5 < zz_4 and - zz_5 < zz_6 and - zz_5 > zz_7 and - - zz_6 > zz_5 and - zz_6 > zz_7 and - zz_6 < zz_4 and - - zz_7 < zz_2 and - zz_7 < zz_3 and - zz_7 < zz_4 and - zz_7 < zz_5 and - zz_7 < zz_6 and - - ta.crossunder(zz_1, zz_7) and - - barstate.isconfirmed - -// Plot Signals -plotshape(series=i_scr_show_short and i_scr_choose == 'Prev 1 Swing Sweep' ? short_condition_1 : na, title='Prev 1 Bearish Sweep', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) -plotshape(series=i_scr_show_long and i_scr_choose == 'Prev 1 Swing Sweep' ? long_condition_1 : na, title='Prev 1 Bullish Sweep', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) -barcolor(color=i_scr_show_short and i_scr_choose == 'Prev 1 Swing Sweep' and short_condition_1 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Prev 1 Swing Sweep' and long_condition_1 ? i_pos_light_color : na, title='Prev 1 Candle') - -plotshape(series=i_scr_show_short and i_scr_choose == 'Prev 2 Swing Sweep' ? short_condition_2 : na, title='Prev 2 Bearish Sweep', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) -plotshape(series=i_scr_show_long and i_scr_choose == 'Prev 2 Swing Sweep' ? long_condition_2 : na, title='Prev 2 Bullish Sweep', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) -barcolor(color=i_scr_show_short and i_scr_choose == 'Prev 2 Swing Sweep' and short_condition_2 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Prev 2 Swing Sweep' and long_condition_2 ? i_pos_light_color : na, title='Prev 2 Candle') - -plotshape(series=i_scr_show_short and i_scr_choose == 'Prev 3 Swing Sweep' ? short_condition_3 : na, title='Prev 3 Bearish Sweep', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) -plotshape(series=i_scr_show_long and i_scr_choose == 'Prev 3 Swing Sweep' ? long_condition_3 : na, title='Prev 3 Bullish Sweep', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) -barcolor(color=i_scr_show_short and i_scr_choose == 'Prev 3 Swing Sweep' and short_condition_3 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Prev 3 Swing Sweep' and long_condition_3 ? i_pos_light_color : na, title='Prev 3 Candle') - -// -var line_array = array.new_line() -// 1 -if i_scr_show_short and i_scr_choose == 'Prev 1 Swing Sweep' and short_condition_1 - ph_line = line.new(x1=int(bi_3), y1=zz_3, x2=bar_index, y2=zz_3, color=i_neg_color, style=i_zz_ln_style) - array.push(line_array, ph_line) - -if i_scr_show_long and i_scr_choose == 'Prev 1 Swing Sweep' and long_condition_1 - pl_line = line.new(x1=int(bi_3), y1=zz_3, x2=bar_index, y2=zz_3, color=i_pos_color, style=i_zz_ln_style) - array.push(line_array, pl_line) - -// 2 -if i_scr_show_short and i_scr_choose == 'Prev 2 Swing Sweep' and short_condition_2 - ph_line = line.new(x1=int(bi_5), y1=zz_5, x2=bar_index, y2=zz_5, color=i_neg_color, style=i_zz_ln_style) - array.push(line_array, ph_line) - -if i_scr_show_long and i_scr_choose == 'Prev 2 Swing Sweep' and long_condition_2 - pl_line = line.new(x1=int(bi_5), y1=zz_5, x2=bar_index, y2=zz_5, color=i_pos_color, style=i_zz_ln_style) - array.push(line_array, pl_line) - -// 3 -if i_scr_show_short and i_scr_choose == 'Prev 3 Swing Sweep' and short_condition_3 - ph_line = line.new(x1=int(bi_7), y1=zz_7, x2=bar_index, y2=zz_7, color=i_neg_color, style=i_zz_ln_style) - array.push(line_array, ph_line) - -if i_scr_show_long and i_scr_choose == 'Prev 3 Swing Sweep' and long_condition_3 - pl_line = line.new(x1=int(bi_7), y1=zz_7, x2=bar_index, y2=zz_7, color=i_pos_color, style=i_zz_ln_style) - array.push(line_array, pl_line) - -//_____________________________ Signals End - -//_____________________________ Data Table Start - -// To String -day_pchg_str = str.tostring(cum_pchg,"#.##") + ' %' -volume_pchg_str = str.tostring(cum_vol_pchg,"#.##") + ' %' -day_volume_str = str.tostring(current_cum_vol/100000,"#.##") + ' L' -prev_day_volume_str = str.tostring(prev_cum_vol/100000,"#.##") + ' L' - -// Color -bgcolor_1 = i_neu_dark_color -bgcolor_2 = i_neu_mid_color - -pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color -vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color -prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color - -// Plot Table -var table tbl_data = table.new(position=i_tbl_data_pos, columns=2, rows=4, border_width=1, force_overlay=true) - -if barstate.islast and i_tbl_data_show - table.cell(table_id=tbl_data, column=0, row=0, text="%Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=0, text=day_pchg_str, text_color=pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=1, text="Vol %Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=1, text=volume_pchg_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=2, text="Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=2, text=day_volume_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=3, text="PD Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=3, text=prev_day_volume_str, text_color=prev_vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - -//_____________________________ Data Table End - -//_____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_01, out_01] = feed(i_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), -[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), -[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), -[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), -[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), -[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), -[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), -[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), -[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), -[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) - -//_____________________________ Get Symbols for Screener End - -//_____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Choose Screening Method -short_cond = - i_scr_choose == 'Prev 1 Swing Sweep' ? short_condition_1 : - i_scr_choose == 'Prev 2 Swing Sweep' ? short_condition_2 : short_condition_3 - -long_cond = - i_scr_choose == 'Prev 1 Swing Sweep' ? long_condition_1 : - i_scr_choose == 'Prev 2 Swing Sweep' ? long_condition_2 : long_condition_3 - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - _cum_pchg = float(na) - _cum_vol_pchg = float(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Short Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_long and long_cond - signal := 1 - - // Check for Long Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_short and short_cond - signal := -1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - _cum_pchg := cum_pchg - _cum_vol_pchg := cum_vol_pchg - - [_time, price, _cum_pchg, _cum_vol_pchg, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 6, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - str_cum_pchg = str.tostring(_cum_pchg, '#.##') - str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) - -// Call Screener function for multiple symbols -screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), -screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), -screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), -screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), -screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), -screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_tbl_disp_rows - while matrix.rows(matrix) > i_scr_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table scr_tbl = table.new(position=i_scr_tbl_position, columns=5, rows=102, border_width=1) - -// Function to populate cells in the table -scr_cell_title(col, row, txt) => - table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor=i_neu_dark_color, text_size=i_scr_tbl_text_size) - -scr_cell(col, row, txt, _text_color, _bgcolor) => - table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign=text.align_left, bgcolor=_bgcolor, text_size=i_scr_tbl_text_size) - -// Check if it's the last bar -if barstate.islast and i_scr_show_table - // Clear existing data in the table - table.clear(scr_tbl, 0, 0, 2, 101) - - scr_cell_title(0, 0, i_scr_choose) - table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=4, end_row=0) - scr_cell_title(0, 1, "Symbol") - scr_cell_title(1, 1, "Time") - scr_cell_title(2, 1, "Price") - scr_cell_title(3, 1, "%Chg") - scr_cell_title(4, 1, "V %Chg") - - j = 4 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - - _textcolor = - matrix.get(matrix, i, 5) == "1" ? i_pos_color : - matrix.get(matrix, i, 5) == "-1" ? i_neg_color : i_neu_color - - _bg_color = - matrix.get(matrix, i, 5) == "1" ? i_pos_dark_color : - matrix.get(matrix, i, 5) == "-1" ? i_neg_dark_color : i_neu_color - - // Populate cells in the table - scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) - scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) - scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) - scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) - scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) - - j += 1 - -//_____________________________ Screener End - -//_____________________________ Code End - -// Readme First: - -// ICT Liquidity Sweep Pattern Scanner - -// Logic -// - This generally identifies bullish or bearish liquidity sweeps of previous 1st, 2nd, or 3rd swings. - -// Notes -// - Use higher timeframes for stock selection and trade in lower timeframes. -// - The scanner may also generate incorrect signals. \ No newline at end of file +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +indicator(title='ICT Liquidity Sweep Pattern Scanner', shorttitle='ICT LSP Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) + +//_____________________________ Menu Screener Start + +g_scrtb = '█████████████████ Scanner █████████████████' + +string i_scr_choose = input.string(defval='Prev 2 Swing Sweep', title='Screening Method', options=['Prev 1 Swing Sweep', 'Prev 2 Swing Sweep', 'Prev 3 Swing Sweep'], group=g_scrtb) + +tt_is = "• Reads only up to first 40 symbols." + + "\n• Total characters cannot exceed 4096." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ABCAPITAL,NSE:BIOCON,NSE:BLS,NSE:BOMDYEING,NSE:CAPACITE,NSE:CESC,NSE:CHAMBLFERT,NSE:DCBBANK,NSE:ENGINERSIN,NSE:GIPCL,NSE:GMDCLTD,NSE:GSFC,NSE:HINDCOPPER,NSE:HINDOILEXP,NSE:INDIACEM,NSE:IOC,NSE:IRCON,NSE:IRFC,NSE:LTFOODS,NSE:MANAPPURAM,NSE:M_MFIN,NSE:NATIONALUM,NSE:NBCC,NSE:NFL,NSE:NLCINDIA,NSE:NMDC,NSE:PNB,NSE:PRAKASH,NSE:PTC,NSE:RAILTEL,NSE:RAIN,NSE:RBLBANK,NSE:RCF,NSE:RELINFRA,NSE:SAIL,NSE:SARDAEN,NSE:SJVN,NSE:TATASTEEL,NSE:TIMETECHNO,NSE:VEDL", + title="Paste Symbols", tooltip=tt_is, group=g_scrtb) + +bool i_scr_show_table = input.bool(defval=true, title='Display Table', group=g_scrtb) +bool i_scr_show_long = input.bool(defval=true, title='Long Signals', inline='tb_2', group=g_scrtb) +bool i_scr_show_short = input.bool(defval=true, title='Short Signals', inline='tb_2', group=g_scrtb) + +int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) +string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) +string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) + +//_____________________________ Menu Screener End + +//_____________________________ Menu Zig Zag Start + +g_zz = '██████████████████ Zig Zag ██████████████████' + +bool i_zz_display = input.bool(defval=true, title='Display Zig Zag', group=g_zz) +int i_zz_period = input.int(defval=4, title='Zig Zag Length', minval=2, group=g_zz) +string i_zz_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close'], group=g_zz) +color i_zz_bull_color = input.color(defval=#1E53E5, title='Color Up', group=g_zz) +color i_zz_bear_color = input.color(defval=#1E53E5, title='Color Down', group=g_zz) +string i_zz_ln_style = input.string(defval=line.style_solid, title="Line Style", options=[line.style_solid, line.style_dashed, line.style_dotted], group=g_zz) + +//_____________________________ Menu Zig Zag End + +//_____________________________ Menu Table Start + +g_dtb = '█████████████████ Data Table █████████████████' +bool i_tbl_data_show = input.bool(defval=true, title='Display Table', group=g_dtb) +string i_tbl_data_pos = input.string(defval=position.bottom_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_dtb) +string i_tbl_data_txt_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_dtb) + +//_____________________________ Menu Table End + +//_____________________________ Chart Settings Start + +g_ch = '███████████████ Chart Settings ███████████████' +color i_pos_dark_color = input.color(defval=#03110F, title='Positive Dark', group=g_ch) +color i_pos_color = input.color(defval=#26A69A, title='Positive Mid', group=g_ch) +color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) +color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) +color i_neg_color = input.color(defval=#FF5252, title='Negative Mid', group=g_ch) +color i_neg_dark_color = input.color(defval=#180809, title='Negative Dark', group=g_ch) +//color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) +//color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) +color i_neu_color = input.color(defval=#D1D4DC, title='Neutral Light', group=g_ch) +color i_neu_mid_color = input.color(defval=#2A2E39, title='Neutral Mid', group=g_ch) +color i_neu_dark_color = input.color(defval=#141516, title='Neutral Dark', group=g_ch) + +//_____________________________ Chart Settings End + +//_____________________________ Cumulative Percentage Change Start + +// Function to calculate Daily Cumulative Percentage Change of Close Price +cumulative_percentage_change() => + var float _cum_pct_change = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 + _cum_pct_change := _is_new_day ? _daily_pct_change : (na(_cum_pct_change) ? _daily_pct_change : (_cum_pct_change + _daily_pct_change)) + _cum_pct_change + +// Calculate current cumulative percentage change +cum_pchg = cumulative_percentage_change() + +//_____________________________ Cumulative Percentage Change End + +//_____________________________ Cumulative Volume Percentage Change Start + +// Function to calculate Daily Cumulative Volume +cumulative_volume() => + var float _cum_vol = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _cum_vol := _is_new_day ? volume : (na(_cum_vol) ? volume : (_cum_vol + volume)) + _cum_vol + +// Calculate current and previous day cumulative volumes +var float current_cum_vol = na +var float prev_cum_vol = na + +if ta.change(time('D')) != 0 + prev_cum_vol := current_cum_vol + current_cum_vol := volume +else + current_cum_vol += volume + +// Calculate Cumulative Volume Percentage Change +cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 + +//_____________________________ Cumulative Volume Percentage Change End + +//_____________________________ Zig Zag Start + +// Acknowledgement & Reference +// Trader: 'RozaniGhani-RG' +// Indicator Title: 'Zig Zag Ratio Simplified' +// Indicator Link: 'https://www.tradingview.com/script/CIk186OY-Zig-Zag-Ratio-Simplified/' + +//_____________________________ Get Source + +float _high = i_zz_source == 'Open/Close' ? math.max(open, close) : high +float _low = i_zz_source == 'Open/Close' ? math.min(open, close) : low + +//============================== 1. Variables + +//_____________________________ 1.1 Highest / Lowest +float ph = ta.highestbars(_high, i_zz_period) == 0 ? _high : na +float pl = ta.lowestbars(_low, i_zz_period) == 0 ? _low : na + +//_____________________________ 1.2 Dir +var int dir = 0, dir := pl and na(ph) ? -1 : ph and na(pl) ? 1 : dir + +//_____________________________ 1.4 Array +var max_array_size = 14, var zigzag = array.new_float(0), oldzigzag = array.copy(zigzag) + +//_____________________________ 1.5 Others +var line line_zz = na + +//============================== 3. Custom Functions + +add_to_zigzag(float[] pointer, float value, int bindex) => + array.unshift(pointer, bindex) + array.unshift(pointer, value) + if array.size(pointer) > max_array_size + array.pop(pointer) + array.pop(pointer) + +update_zigzag(float[] pointer, float value, int bindex, int dir) => + if array.size(pointer) == 0 + add_to_zigzag(pointer, value, bindex) + else + if dir == 1 and value > array.get(pointer, 0) or dir == -1 and value < array.get(pointer, 0) + array.set(pointer, 0, value) + array.set(pointer, 1, bindex) + 0. + +//============================== 4. Calculations + +dirchanged = ta.change(dir) + +if ph or pl + if dirchanged + add_to_zigzag(zigzag, dir == 1 ? ph : pl, bar_index) + else + update_zigzag(zigzag, dir == 1 ? ph : pl, bar_index, dir) + +//============================== 5. Constructs + +if array.size(zigzag) >= 6 + if array.get(zigzag, 0) != array.get(oldzigzag, 0) or array.get(zigzag, 1) != array.get(oldzigzag, 1) + if array.get(zigzag, 2) == array.get(oldzigzag, 2) and array.get(zigzag, 3) == array.get(oldzigzag, 3) + line.delete(line_zz) + if i_zz_display + line_zz := line.new(x1 = math.round(array.get(zigzag, 1)), y1 = array.get(zigzag, 0), x2 = math.round(array.get(zigzag, 3)), y2 = array.get(zigzag, 2), color = dir == 1 ? i_zz_bull_color : i_zz_bear_color, width=1) + +//_____________________________ Get Swing Price & Bar Index + +//zz_0 = array.size(zigzag) > 15 ? array.get(zigzag, array.size(zigzag) - 16) : na +//bi_0 = array.size(zigzag) > 14 ? array.get(zigzag, array.size(zigzag) - 15) : na +zz_1 = array.size(zigzag) > 13 ? array.get(zigzag, array.size(zigzag) - 14) : na +//bi_1 = array.size(zigzag) > 12 ? array.get(zigzag, array.size(zigzag) - 13) : na +zz_2 = array.size(zigzag) > 11 ? array.get(zigzag, array.size(zigzag) - 12) : na +//bi_2 = array.size(zigzag) > 10 ? array.get(zigzag, array.size(zigzag) - 11) : na +zz_3 = array.size(zigzag) > 9 ? array.get(zigzag, array.size(zigzag) - 10) : na +bi_3 = array.size(zigzag) > 8 ? array.get(zigzag, array.size(zigzag) - 9) : na +zz_4 = array.size(zigzag) > 7 ? array.get(zigzag, array.size(zigzag) - 8) : na +//bi_4 = array.size(zigzag) > 6 ? array.get(zigzag, array.size(zigzag) - 7) : na +zz_5 = array.size(zigzag) > 5 ? array.get(zigzag, array.size(zigzag) - 6) : na +bi_5 = array.size(zigzag) > 4 ? array.get(zigzag, array.size(zigzag) - 5) : na +zz_6 = array.size(zigzag) > 3 ? array.get(zigzag, array.size(zigzag) - 4) : na +//bi_6 = array.size(zigzag) > 2 ? array.get(zigzag, array.size(zigzag) - 3) : na +zz_7 = array.size(zigzag) > 1 ? array.get(zigzag, array.size(zigzag) - 2) : na +bi_7 = array.size(zigzag) > 0 ? array.get(zigzag, array.size(zigzag) - 1) : na + +// Create a single label for the last five zigzag values and their corresponding bar index +//label_text = str.tostring(zz_0) + "\n" + str.tostring(bi_0) + "\n" + str.tostring(zz_1) + "\n" + str.tostring(bi_1) + "\n" + str.tostring(zz_2) + +// "\n" + str.tostring(bi_2) + "\n" + str.tostring(zz_3) + "\n" + str.tostring(bi_3) + "\n" + str.tostring(zz_4) + "\n" + str.tostring(bi_4) +//if barstate.islast +// label.new(x = bar_index, y = high, text = label_text, color=color.white) + +//_____________________________ Zig Zag End + +//_____________________________ Signals Start + +// Short Condition +short_condition_1 = + zz_2 < zz_3 and + zz_2 < zz_4 and + zz_2 < zz_6 and + zz_2 < zz_7 and + + zz_3 < zz_5 and + zz_3 > zz_4 and + zz_3 > zz_2 and + + zz_4 < zz_3 and + zz_4 < zz_5 and + zz_4 < zz_6 and + zz_4 < zz_7 and + + zz_5 > zz_3 and + zz_5 > zz_4 and + zz_5 > zz_6 and + zz_5 < zz_7 and + + zz_6 < zz_5 and + zz_6 < zz_7 and + zz_6 > zz_4 and + + zz_7 > zz_2 and + zz_7 > zz_3 and + zz_7 > zz_4 and + zz_7 > zz_5 and + zz_7 > zz_6 and + + ta.crossover(zz_1, zz_3) and + + barstate.isconfirmed + +short_condition_2 = + zz_2 < zz_3 and + zz_2 < zz_4 and + zz_2 < zz_6 and + zz_2 < zz_7 and + + zz_3 < zz_5 and + zz_3 > zz_4 and + zz_3 > zz_2 and + + zz_4 < zz_3 and + zz_4 < zz_5 and + zz_4 < zz_6 and + zz_4 < zz_7 and + + zz_5 > zz_3 and + zz_5 > zz_4 and + zz_5 > zz_6 and + zz_5 < zz_7 and + + zz_6 < zz_5 and + zz_6 < zz_7 and + zz_6 > zz_4 and + + zz_7 > zz_2 and + zz_7 > zz_3 and + zz_7 > zz_4 and + zz_7 > zz_5 and + zz_7 > zz_6 and + + ta.crossover(zz_1, zz_5) and + + barstate.isconfirmed + +short_condition_3 = + zz_2 < zz_3 and + zz_2 < zz_4 and + zz_2 < zz_6 and + zz_2 < zz_7 and + + zz_3 < zz_5 and + zz_3 > zz_4 and + zz_3 > zz_2 and + + zz_4 < zz_3 and + zz_4 < zz_5 and + zz_4 < zz_6 and + zz_4 < zz_7 and + + zz_5 > zz_3 and + zz_5 > zz_4 and + zz_5 > zz_6 and + zz_5 < zz_7 and + + zz_6 < zz_5 and + zz_6 < zz_7 and + zz_6 > zz_4 and + + zz_7 > zz_2 and + zz_7 > zz_3 and + zz_7 > zz_4 and + zz_7 > zz_5 and + zz_7 > zz_6 and + + ta.crossover(zz_1, zz_7) and + + barstate.isconfirmed + +// Long Condition +long_condition_1 = + zz_2 < zz_3 and + zz_2 < zz_4 and + zz_2 < zz_6 and + zz_2 < zz_7 and + + zz_3 < zz_5 and + zz_3 > zz_4 and + zz_3 > zz_2 and + + zz_4 < zz_3 and + zz_4 < zz_5 and + zz_4 < zz_6 and + zz_4 < zz_7 and + + zz_5 > zz_3 and + zz_5 > zz_4 and + zz_5 > zz_6 and + zz_5 < zz_7 and + + zz_6 < zz_5 and + zz_6 < zz_7 and + zz_6 > zz_4 and + + zz_7 > zz_2 and + zz_7 > zz_3 and + zz_7 > zz_4 and + zz_7 > zz_5 and + zz_7 > zz_6 and + + ta.crossunder(zz_1, zz_3) and + + barstate.isconfirmed + +long_condition_2 = + zz_2 > zz_3 and + zz_2 > zz_4 and + zz_2 > zz_6 and + zz_2 > zz_7 and + + zz_3 > zz_5 and + zz_3 < zz_4 and + zz_3 < zz_2 and + + zz_4 > zz_3 and + zz_4 > zz_5 and + zz_4 > zz_6 and + zz_4 > zz_7 and + + zz_5 < zz_3 and + zz_5 < zz_4 and + zz_5 < zz_6 and + zz_5 > zz_7 and + + zz_6 > zz_5 and + zz_6 > zz_7 and + zz_6 < zz_4 and + + zz_7 < zz_2 and + zz_7 < zz_3 and + zz_7 < zz_4 and + zz_7 < zz_5 and + zz_7 < zz_6 and + + ta.crossunder(zz_1, zz_5) and + + barstate.isconfirmed + +long_condition_3 = + zz_2 > zz_3 and + zz_2 > zz_4 and + zz_2 > zz_6 and + zz_2 > zz_7 and + + zz_3 > zz_5 and + zz_3 < zz_4 and + zz_3 < zz_2 and + + zz_4 > zz_3 and + zz_4 > zz_5 and + zz_4 > zz_6 and + zz_4 > zz_7 and + + zz_5 < zz_3 and + zz_5 < zz_4 and + zz_5 < zz_6 and + zz_5 > zz_7 and + + zz_6 > zz_5 and + zz_6 > zz_7 and + zz_6 < zz_4 and + + zz_7 < zz_2 and + zz_7 < zz_3 and + zz_7 < zz_4 and + zz_7 < zz_5 and + zz_7 < zz_6 and + + ta.crossunder(zz_1, zz_7) and + + barstate.isconfirmed + +// Plot Signals +plotshape(series=i_scr_show_short and i_scr_choose == 'Prev 1 Swing Sweep' ? short_condition_1 : na, title='Prev 1 Bearish Sweep', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) +plotshape(series=i_scr_show_long and i_scr_choose == 'Prev 1 Swing Sweep' ? long_condition_1 : na, title='Prev 1 Bullish Sweep', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) +barcolor(color=i_scr_show_short and i_scr_choose == 'Prev 1 Swing Sweep' and short_condition_1 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Prev 1 Swing Sweep' and long_condition_1 ? i_pos_light_color : na, title='Prev 1 Candle') + +plotshape(series=i_scr_show_short and i_scr_choose == 'Prev 2 Swing Sweep' ? short_condition_2 : na, title='Prev 2 Bearish Sweep', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) +plotshape(series=i_scr_show_long and i_scr_choose == 'Prev 2 Swing Sweep' ? long_condition_2 : na, title='Prev 2 Bullish Sweep', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) +barcolor(color=i_scr_show_short and i_scr_choose == 'Prev 2 Swing Sweep' and short_condition_2 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Prev 2 Swing Sweep' and long_condition_2 ? i_pos_light_color : na, title='Prev 2 Candle') + +plotshape(series=i_scr_show_short and i_scr_choose == 'Prev 3 Swing Sweep' ? short_condition_3 : na, title='Prev 3 Bearish Sweep', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) +plotshape(series=i_scr_show_long and i_scr_choose == 'Prev 3 Swing Sweep' ? long_condition_3 : na, title='Prev 3 Bullish Sweep', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) +barcolor(color=i_scr_show_short and i_scr_choose == 'Prev 3 Swing Sweep' and short_condition_3 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Prev 3 Swing Sweep' and long_condition_3 ? i_pos_light_color : na, title='Prev 3 Candle') + +// +var line_array = array.new_line() +// 1 +if i_scr_show_short and i_scr_choose == 'Prev 1 Swing Sweep' and short_condition_1 + ph_line = line.new(x1=int(bi_3), y1=zz_3, x2=bar_index, y2=zz_3, color=i_neg_color, style=i_zz_ln_style) + array.push(line_array, ph_line) + +if i_scr_show_long and i_scr_choose == 'Prev 1 Swing Sweep' and long_condition_1 + pl_line = line.new(x1=int(bi_3), y1=zz_3, x2=bar_index, y2=zz_3, color=i_pos_color, style=i_zz_ln_style) + array.push(line_array, pl_line) + +// 2 +if i_scr_show_short and i_scr_choose == 'Prev 2 Swing Sweep' and short_condition_2 + ph_line = line.new(x1=int(bi_5), y1=zz_5, x2=bar_index, y2=zz_5, color=i_neg_color, style=i_zz_ln_style) + array.push(line_array, ph_line) + +if i_scr_show_long and i_scr_choose == 'Prev 2 Swing Sweep' and long_condition_2 + pl_line = line.new(x1=int(bi_5), y1=zz_5, x2=bar_index, y2=zz_5, color=i_pos_color, style=i_zz_ln_style) + array.push(line_array, pl_line) + +// 3 +if i_scr_show_short and i_scr_choose == 'Prev 3 Swing Sweep' and short_condition_3 + ph_line = line.new(x1=int(bi_7), y1=zz_7, x2=bar_index, y2=zz_7, color=i_neg_color, style=i_zz_ln_style) + array.push(line_array, ph_line) + +if i_scr_show_long and i_scr_choose == 'Prev 3 Swing Sweep' and long_condition_3 + pl_line = line.new(x1=int(bi_7), y1=zz_7, x2=bar_index, y2=zz_7, color=i_pos_color, style=i_zz_ln_style) + array.push(line_array, pl_line) + +//_____________________________ Signals End + +//_____________________________ Data Table Start + +// To String +day_pchg_str = str.tostring(cum_pchg,"#.##") + ' %' +volume_pchg_str = str.tostring(cum_vol_pchg,"#.##") + ' %' +day_volume_str = str.tostring(current_cum_vol/100000,"#.##") + ' L' +prev_day_volume_str = str.tostring(prev_cum_vol/100000,"#.##") + ' L' + +// Color +bgcolor_1 = i_neu_dark_color +bgcolor_2 = i_neu_mid_color + +pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color +vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color +prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color + +// Plot Table +var table tbl_data = table.new(position=i_tbl_data_pos, columns=2, rows=4, border_width=1, force_overlay=true) + +if barstate.islast and i_tbl_data_show + table.cell(table_id=tbl_data, column=0, row=0, text="%Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=0, text=day_pchg_str, text_color=pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=1, text="Vol %Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=1, text=volume_pchg_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=2, text="Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=2, text=day_volume_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=3, text="PD Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=3, text=prev_day_volume_str, text_color=prev_vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + +//_____________________________ Data Table End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_01, out_01] = feed(effective_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), +[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), +[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), +[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), +[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), +[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), +[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), +[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), +[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), +[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) + +//_____________________________ Get Symbols for Screener End + +//_____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Choose Screening Method +short_cond = + i_scr_choose == 'Prev 1 Swing Sweep' ? short_condition_1 : + i_scr_choose == 'Prev 2 Swing Sweep' ? short_condition_2 : short_condition_3 + +long_cond = + i_scr_choose == 'Prev 1 Swing Sweep' ? long_condition_1 : + i_scr_choose == 'Prev 2 Swing Sweep' ? long_condition_2 : long_condition_3 + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + _cum_pchg = float(na) + _cum_vol_pchg = float(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Short Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_long and long_cond + signal := 1 + + // Check for Long Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_short and short_cond + signal := -1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + _cum_pchg := cum_pchg + _cum_vol_pchg := cum_vol_pchg + + [_time, price, _cum_pchg, _cum_vol_pchg, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 6, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) + +// Screener function to collect data +screener(s) => + [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + str_cum_pchg = str.tostring(_cum_pchg, '#.##') + str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) + +// Call Screener function for multiple symbols +screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), +screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), +screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), +screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), +screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), +screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_tbl_disp_rows + while matrix.rows(matrix) > i_scr_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table scr_tbl = table.new(position=i_scr_tbl_position, columns=5, rows=102, border_width=1) + +// Function to populate cells in the table +scr_cell_title(col, row, txt) => + table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor=i_neu_dark_color, text_size=i_scr_tbl_text_size) + +scr_cell(col, row, txt, _text_color, _bgcolor) => + table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign=text.align_left, bgcolor=_bgcolor, text_size=i_scr_tbl_text_size) + +// Check if it's the last bar +if barstate.islast and i_scr_show_table + // Clear existing data in the table + table.clear(scr_tbl, 0, 0, 2, 101) + + scr_cell_title(0, 0, i_scr_choose) + table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=4, end_row=0) + scr_cell_title(0, 1, "Symbol") + scr_cell_title(1, 1, "Time") + scr_cell_title(2, 1, "Price") + scr_cell_title(3, 1, "%Chg") + scr_cell_title(4, 1, "V %Chg") + + j = 4 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + + _textcolor = + matrix.get(matrix, i, 5) == "1" ? i_pos_color : + matrix.get(matrix, i, 5) == "-1" ? i_neg_color : i_neu_color + + _bg_color = + matrix.get(matrix, i, 5) == "1" ? i_pos_dark_color : + matrix.get(matrix, i, 5) == "-1" ? i_neg_dark_color : i_neu_color + + // Populate cells in the table + scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) + scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) + scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) + scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) + scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) + + j += 1 + +//_____________________________ Screener End + +//_____________________________ Code End + +// Readme First: + +// ICT Liquidity Sweep Pattern Scanner + +// Logic +// - This generally identifies bullish or bearish liquidity sweeps of previous 1st, 2nd, or 3rd swings. + +// Notes +// - Use higher timeframes for stock selection and trade in lower timeframes. +// - The scanner may also generate incorrect signals. + diff --git a/ICT Liquidity Void Fill/[Scanner] ICT Liquidity Void Fill Scanner.txt b/ICT Liquidity Void Fill/[Scanner] ICT Liquidity Void Fill Scanner.txt index d5780d8..f44494c 100644 --- a/ICT Liquidity Void Fill/[Scanner] ICT Liquidity Void Fill Scanner.txt +++ b/ICT Liquidity Void Fill/[Scanner] ICT Liquidity Void Fill Scanner.txt @@ -1,474 +1,698 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=6 -indicator(title = 'ICT Liquidity Void Fill Scanner', shorttitle = 'ICT LV Fill Scan', overlay = true, max_lines_count = 500) - -//_____________________________ Menu Start - -string g_scrtb = '█████████████████ Scanner █████████████████' - -string tt_is = - "• Reads only up to first 40 symbols." + - "\n• Total characters cannot exceed 4096." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:BPCL,NSE:CANBK,NSE:CESC,NSE:CUB,NSE:FEDERALBNK,NSE:GAIL,NSE:GMRAIRPORT,NSE:HFCL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IDFCFIRSTB,NSE:IEX,NSE:IGL,NSE:IOC,NSE:IRFC,NSE:JIOFIN,NSE:LTF,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NMDC,NSE:NYKAA,NSE:ONGC,NSE:PNB,NSE:SAIL,NSE:SJVN,NSE:TATASTEEL,NSE:UNIONBANK,NSE:RBLBANK", - title="Paste Symbols", tooltip=tt_is, group=g_scrtb) - -bool i_scr_show_table = input.bool(defval = true, title = 'Display Table', group = g_scrtb) -bool i_scr_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scrtb) -bool i_scr_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scrtb) - -int i_scr_tbl_disp_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scrtb) -string i_scr_tbl_position = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scrtb) -string i_scr_tbl_text_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scrtb) - -string g_lv = '███████████████ Liquidity Void ███████████████' - -string tt_lv_fib = - "• '0' → Bottom of a bullish candle, top of a bearish candle." + - "\n• '1' → Top of a bullish candle, bottom of a bearish candle." + - "\n• '0.5' → 50% level of the candle." + - "\n• Other Fibonacci/OTE values like 0.62, 0.705, 0.79, etc., are usable." + - "\n• Range: Min = 0, Max = 1." - -float i_fib_val = input.float(defval = 0.5, title = 'Fib Value', minval = 0, maxval = 1, step = 0.1, tooltip = tt_lv_fib, group = g_lv) -string i_fvg_ln_style = input.string(defval = line.style_solid, title = 'Line Style', options = [line.style_solid, line.style_dashed, line.style_dotted], group = g_lv) - -string g_af = '██████████████ Additional Fiters ██████████████' - -string tt_atr = - "• Applicable only to 1st displacement, 80%, or momentum candles." + - "\n• ATR filters out longer or more volatile candles."+ - "\n• Higher multiplier value filters longer/volatile 1st candle." -string tt_bf = - "• Applicable only to 1st displacement, 80%, or momentum candles." + - "\n• If the input is '80', the candle's body covers over 80% of its total length." -string tt_bs = - "• Applicable only to 1st displacement, 80%, or momentum candles." + - "\n• If the input is '2', the candle is twice the size of the previous candle." -string tt_tf = - "• Applicable only to the retracement candle." + - "\n• Filter out a signals between the given Time." -string tt_df = - "• Applicable only to the retracement candle." + - "\n• Filter out a signals on the given Date." + - "\n• Turn this on and enter yesterday's date to generate signals for yesterday." - -bool i_atr_filter = input.bool(defval = true, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) -int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) -float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) - -bool i_body_filter = input.bool(defval = true, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) -float i_body_percent = input.float(defval = 80, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 - -bool i_body_size_filter = input.bool(defval = false, title = 'Apply Body Size Filter', tooltip = tt_bs, group = g_af) -int i_body_size_multiplier = input.int(defval = 2, title = 'Body Size Multiplier (x)', minval = 0, group = g_af) - -bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) -int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) -int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) -int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) -int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) - -bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) -int i_day = input.int(defval = 13, minval = 1, maxval = 31, title = 'Day', group = g_af) -int i_month = input.int(defval = 03, minval = 1, maxval = 12, title = 'Month', group = g_af) -int i_year = input.int(defval = 2025, minval = 0, title = 'Year', group = g_af) - -string g_dtb = '████████████████ Data Table ████████████████' - -bool i_tbl_data_show = input.bool(defval = true, title = 'Display Table', group = g_dtb) -string i_tbl_data_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_dtb) -string i_tbl_data_txt_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_dtb) - -string g_ch = '███████████████ Chart Settings ███████████████' - -color i_pos_color = input.color(defval = #089981, title = 'Positive Mid', group = g_ch) -color i_pos_light_color = input.color(defval = #ACE5DC, title = 'Positive Light', group = g_ch) -color i_neg_light_color = input.color(defval = #FCCBCD, title = 'Negative Light', group = g_ch) -color i_neg_color = input.color(defval = #F23645, title = 'Negative Mid', group = g_ch) -color i_neu_color = input.color(defval = #9C9C9C, title = 'Neutral Light', group = g_ch) -color i_neu_dark_color = input.color(defval = #0F0F0F, title = 'Neutral Dark', group = g_ch) - -//_____________________________ Menu End - -//_____________________________ Cumulative Percentage Change Start - -// Function to calculate Daily Cumulative Percentage Change of Close Price -cum_pchg() => - var float _cum_pct_change = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 - _cum_pct_change := bool(_is_new_day) ? _daily_pct_change : na(_cum_pct_change) ? _daily_pct_change : _cum_pct_change + _daily_pct_change - _cum_pct_change - -// Calculate current cumulative percentage change -cum_pchg = cum_pchg() - -//_____________________________ Cumulative Percentage Change End - -//_____________________________ Cumulative Volume Percentage Change Start - -// Function to calculate Daily Cumulative Volume -cum_vol() => - var float _cum_vol = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _cum_vol := bool(_is_new_day) ? volume : na(_cum_vol) ? volume : _cum_vol + volume - _cum_vol - -// Calculate current and previous day cumulative volumes -var float curr_cum_vol = na -var float prev_cum_vol = na - -if ta.change(time('D')) != 0 - prev_cum_vol := curr_cum_vol - curr_cum_vol := volume - curr_cum_vol -else - curr_cum_vol := curr_cum_vol + volume - curr_cum_vol - -// Calculate Cumulative Volume Percentage Change -cum_vol_pchg = (curr_cum_vol - nz(prev_cum_vol, curr_cum_vol)) / nz(prev_cum_vol, curr_cum_vol) * 100 - -//_____________________________ Cumulative Volume Percentage Change End - -//_____________________________ Additional Filters Start - -// ATR Filter -bool atr_filter = true -if i_atr_filter - atr_filter := high - low > ta.atr(i_atr_length) * i_atr_multi - -// Body Percent Filter -bool body_filter = true -if i_body_filter - body_filter := math.abs(close - open) / (high - low) >= i_body_percent - -// Body Size Filter -bool body_size_filter = true -if i_body_size_filter - body_size_filter := math.abs(close - open) / (high - low) >= i_body_percent and high - low >= (high[1] - low[1]) * i_body_size_multiplier - -// Time Filter -bool time_filter = true -if i_time_filter - time_filter := (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) - -// Date Filter -bool date_filter = true -if i_date_filter - date_filter := year == i_year and month == i_month and dayofmonth == i_day - -//_____________________________ Additional Filters End - -//_____________________________ Fibonacci Start - -// Fibonacci Function -fibonacci(bool calc_from_high, float high_value, float low_value, float fib_value) => - if calc_from_high - low_value + (high_value - low_value) * fib_value - else - high_value - (high_value - low_value) * fib_value - -//_____________________________ Fibonacci End - -//_____________________________ Signals Start - -// Short Condition 1 -short_cont_1 = - open > close and - atr_filter and - body_filter and - body_size_filter - -var short_cont_1_high = float(na) -var short_cont_1_low = float(na) -var short_cont_1_bi = int(na) -if short_cont_1 - short_cont_1_high := high - short_cont_1_low := low - short_cont_1_bi := bar_index - -float bear_fib_val = fibonacci(false, short_cont_1_high, short_cont_1_low, i_fib_val) - -// Short Condition 2 -short_cont_2 = - ta.crossover(high, bear_fib_val) and - time_filter and - date_filter and - barstate.isconfirmed - -// Short Retracement Signal -var short_curr_state = 0 -short_prev_state = nz(short_curr_state[1]) -short_curr_state := short_prev_state == 2 ? 0 : short_prev_state -if short_cont_1 and short_curr_state == 0 - short_curr_state := 1 -if not short_cont_1 and short_cont_2 and short_curr_state == 1 - short_curr_state := 2 - -short_ret_signal = short_curr_state == 2 ? true : false - -// Long Condition 1 -long_cont_1 = - open < close and - atr_filter and - body_filter and - body_size_filter - -var long_cont_1_high = float(na) -var long_cont_1_low = float(na) -var long_cont_1_bi = int(na) -if long_cont_1 - long_cont_1_high := high - long_cont_1_low := low - long_cont_1_bi := bar_index - -float bull_fib_val = fibonacci(true, long_cont_1_high, long_cont_1_low, i_fib_val) - -// Long Condition 2 -long_cont_2 = - ta.crossunder(low, bull_fib_val) and - time_filter and - date_filter and - barstate.isconfirmed - -// Long Retracement -var long_curr_state = 0 -long_prev_state = nz(long_curr_state[1]) -long_curr_state := long_prev_state == 2 ? 0 : long_prev_state -if long_cont_1 and long_curr_state == 0 - long_curr_state := 1 -if not long_cont_1 and long_cont_2 and long_curr_state == 1 - long_curr_state := 2 - -long_ret_signal = long_curr_state == 2 ? true : false - -//_____________________________ Signals End - -//_____________________________ Plot Start - -// Plot -plotshape(series = i_scr_show_short and short_ret_signal ? 3 : na, title = 'Short Signal', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) -plotshape(series = i_scr_show_long and long_ret_signal ? 3 : na, title = 'Long Signal', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) -barcolor(color = i_scr_show_short and short_cont_1 ? i_neg_light_color : i_scr_show_long and long_cont_1 ? i_pos_light_color : na, title = '80% Candle') - -// Line -var line_array = array.new_line() - -if i_scr_show_short and short_ret_signal - array.push(line_array, line.new(x1 = short_cont_1_bi, y1 = bear_fib_val, x2 = bar_index, y2 = bear_fib_val, color = i_neg_color, style = i_fvg_ln_style)) - -if i_scr_show_long and long_ret_signal - array.push(line_array, line.new(x1 = long_cont_1_bi, y1 = bull_fib_val, x2 = bar_index, y2 = bull_fib_val, color = i_pos_color, style = i_fvg_ln_style)) - -//_____________________________ Plot End - -//_____________________________ Data Table Start - -// To String -day_pchg_str = str.tostring(cum_pchg, '#.##') + ' %' -volume_pchg_str = str.tostring(cum_vol_pchg, '#.##') + ' %' -day_volume_str = str.tostring(curr_cum_vol / 100000, '#.##') + ' L' -prev_day_volume_str = str.tostring(prev_cum_vol / 100000, '#.##') + ' L' - -// Color -bgcolor_1 = i_neu_dark_color -bgcolor_2 = i_neu_dark_color - -pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color -vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color -prev_vol_pchg_col = prev_cum_vol < curr_cum_vol ? i_neg_color : i_pos_color - -// Plot Table -var table tbl_data = table.new(position = i_tbl_data_pos, columns = 2, rows = 4, border_width = 1, force_overlay = true) - -if barstate.islast and i_tbl_data_show - table.cell(table_id = tbl_data, column = 0, row = 0, text = '%Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 0, text = day_pchg_str, text_color = pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - - table.cell(table_id = tbl_data, column = 0, row = 1, text = 'Vol %Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 1, text = volume_pchg_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - - table.cell(table_id = tbl_data, column = 0, row = 2, text = 'Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 2, text = day_volume_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) - - table.cell(table_id = tbl_data, column = 0, row = 3, text = 'PD Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - table.cell(table_id = tbl_data, column = 1, row = 3, text = prev_day_volume_str, text_color = prev_vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) - -//_____________________________ Data Table End - -//_____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[t_01, o_01] = feed(i_symbols), [t_02, o_02] = feed(o_01), [t_03, o_03] = feed(o_02), [t_04, o_04] = feed(o_03), [t_05, o_05] = feed(o_04), -[t_06, o_06] = feed(o_05), [t_07, o_07] = feed(o_06), [t_08, o_08] = feed(o_07), [t_09, o_09] = feed(o_08), [t_10, o_10] = feed(o_09), -[t_11, o_11] = feed(o_10), [t_12, o_12] = feed(o_11), [t_13, o_13] = feed(o_12), [t_14, o_14] = feed(o_13), [t_15, o_15] = feed(o_14), -[t_16, o_16] = feed(o_15), [t_17, o_17] = feed(o_16), [t_18, o_18] = feed(o_17), [t_19, o_19] = feed(o_18), [t_20, o_20] = feed(o_19), -[t_21, o_21] = feed(o_20), [t_22, o_22] = feed(o_21), [t_23, o_23] = feed(o_22), [t_24, o_24] = feed(o_23), [t_25, o_25] = feed(o_24), -[t_26, o_26] = feed(o_25), [t_27, o_27] = feed(o_26), [t_28, o_28] = feed(o_27), [t_29, o_29] = feed(o_28), [t_30, o_30] = feed(o_29), -[t_31, o_31] = feed(o_30), [t_32, o_32] = feed(o_31), [t_33, o_33] = feed(o_32), [t_34, o_34] = feed(o_33), [t_35, o_35] = feed(o_34), -[t_36, o_36] = feed(o_35), [t_37, o_37] = feed(o_36), [t_38, o_38] = feed(o_37), [t_39, o_39] = feed(o_38), [t_40, o_40] = feed(o_39) - -//_____________________________ Get Symbols for Screener End - -//_____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Scanner Conditions -short_cond = short_ret_signal -long_cond = long_ret_signal - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - _cum_pchg = float(na) - _cum_vol_pchg = float(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Short Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_long and long_cond - signal := 1 - - // Check for Long Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_short and short_cond - signal := -1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - _cum_pchg := cum_pchg - _cum_vol_pchg := cum_vol_pchg - - [_time, price, _cum_pchg, _cum_vol_pchg, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, 'HH:mm dd-MM-yyyy', timezone) : str.format_time(x, 'dd-MM-yyyy', timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ':'), 1) - -// Matrix setup -var matrix = matrix.new(0, 6, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) - -// Screener function to collect data -scan(s) => - sym = ticker.modify(s, syminfo.session) - [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - str_cum_pchg = str.tostring(_cum_pchg, '#.##') - str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) - -// Call Screener function for multiple symbols -scan(t_01), scan(t_02), scan(t_03), scan(t_04), scan(t_05), scan(t_06), scan(t_07), scan(t_08), scan(t_09), scan(t_10), scan(t_11), scan(t_12), -scan(t_13), scan(t_14), scan(t_15), scan(t_16), scan(t_17), scan(t_18), scan(t_19), scan(t_20), scan(t_21), scan(t_22), scan(t_23), scan(t_24), -scan(t_25), scan(t_26), scan(t_27), scan(t_28), scan(t_29), scan(t_30), scan(t_31), scan(t_32), scan(t_33), scan(t_34), scan(t_35), scan(t_36), -scan(t_37), scan(t_38), scan(t_39), scan(t_40) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_tbl_disp_rows - while matrix.rows(matrix) > i_scr_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix) - 1) - -// Plot Table -// Create table with specified properties -var table scr_tbl = table.new(position = i_scr_tbl_position, columns = 5, rows = 102, border_width = 1, force_overlay = true) - -// Function to populate cells in the table -scr_cell_title(col, row, txt) => - table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scr_tbl_text_size) - -scr_cell(col, row, txt, _text_color, _bgcolor) => - table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = _bgcolor, text_size = i_scr_tbl_text_size) - -// Check if it's the last bar -if barstate.islast and i_scr_show_table - // Clear existing data in the table - table.clear(scr_tbl, 0, 0, 2, 101) - - scr_cell_title(0, 0, 'Fill to ' + str.tostring(i_fib_val) + '%') - table.merge_cells(table_id = scr_tbl, start_column = 0, start_row = 0, end_column = 4, end_row = 0) - scr_cell_title(0, 1, 'Symbol') - scr_cell_title(1, 1, 'Time') - scr_cell_title(2, 1, 'Price') - scr_cell_title(3, 1, '%Chg') - scr_cell_title(4, 1, 'V %Chg') - - j = 4 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 by 1 - // Determine color based on the signal - - _textcolor = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : i_neu_color - - _bg_color = matrix.get(matrix, i, 5) == '1' ? i_neu_dark_color : matrix.get(matrix, i, 5) == '-1' ? i_neu_dark_color : i_neu_color - - // Populate cells in the table - scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) - scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) - scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) - scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) - scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) - - j := j + 1 - -//_____________________________ Screener End - -//_____________________________ Code End - -// Readme First: - -// ICT Liquidity Void Fill Scanner - -// Logic -// - This identifies a momentum candle, an 80% body candle with high volatility, or a displacement. -// - A signal is generated when the price retraces to the candle body, void, or FVG, based on the Fibonacci value. - -// Notes -// - Use a higher timeframe, like 4 hour or 1 hour, for stock selection. -// - The Scanner will generate wrong signals also. +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=6 +indicator(title = 'ICT Liquidity Void Fill Scanner', shorttitle = 'ICT LV Fill Scan', overlay = true, max_lines_count = 500) + +//_____________________________ Menu Start + +string g_scrtb = '█████████████████ Scanner █████████████████' + +string tt_is = + "• Reads only up to first 40 symbols." + + "\n• Total characters cannot exceed 4096." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:BPCL,NSE:CANBK,NSE:CESC,NSE:CUB,NSE:FEDERALBNK,NSE:GAIL,NSE:GMRAIRPORT,NSE:HFCL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IDFCFIRSTB,NSE:IEX,NSE:IGL,NSE:IOC,NSE:IRFC,NSE:JIOFIN,NSE:LTF,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NMDC,NSE:NYKAA,NSE:ONGC,NSE:PNB,NSE:SAIL,NSE:SJVN,NSE:TATASTEEL,NSE:UNIONBANK,NSE:RBLBANK", + title="Paste Symbols", tooltip=tt_is, group=g_scrtb) + +bool i_scr_show_table = input.bool(defval = true, title = 'Display Table', group = g_scrtb) +bool i_scr_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scrtb) +bool i_scr_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scrtb) + +int i_scr_tbl_disp_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scrtb) +string i_scr_tbl_position = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scrtb) +string i_scr_tbl_text_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scrtb) + +string g_lv = '███████████████ Liquidity Void ███████████████' + +string tt_lv_fib = + "• '0' → Bottom of a bullish candle, top of a bearish candle." + + "\n• '1' → Top of a bullish candle, bottom of a bearish candle." + + "\n• '0.5' → 50% level of the candle." + + "\n• Other Fibonacci/OTE values like 0.62, 0.705, 0.79, etc., are usable." + + "\n• Range: Min = 0, Max = 1." + +float i_fib_val = input.float(defval = 0.5, title = 'Fib Value', minval = 0, maxval = 1, step = 0.1, tooltip = tt_lv_fib, group = g_lv) +string i_fvg_ln_style = input.string(defval = line.style_solid, title = 'Line Style', options = [line.style_solid, line.style_dashed, line.style_dotted], group = g_lv) + +string g_af = '██████████████ Additional Fiters ██████████████' + +string tt_atr = + "• Applicable only to 1st displacement, 80%, or momentum candles." + + "\n• ATR filters out longer or more volatile candles."+ + "\n• Higher multiplier value filters longer/volatile 1st candle." +string tt_bf = + "• Applicable only to 1st displacement, 80%, or momentum candles." + + "\n• If the input is '80', the candle's body covers over 80% of its total length." +string tt_bs = + "• Applicable only to 1st displacement, 80%, or momentum candles." + + "\n• If the input is '2', the candle is twice the size of the previous candle." +string tt_tf = + "• Applicable only to the retracement candle." + + "\n• Filter out a signals between the given Time." +string tt_df = + "• Applicable only to the retracement candle." + + "\n• Filter out a signals on the given Date." + + "\n• Turn this on and enter yesterday's date to generate signals for yesterday." + +bool i_atr_filter = input.bool(defval = true, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) +int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) +float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) + +bool i_body_filter = input.bool(defval = true, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) +float i_body_percent = input.float(defval = 80, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 + +bool i_body_size_filter = input.bool(defval = false, title = 'Apply Body Size Filter', tooltip = tt_bs, group = g_af) +int i_body_size_multiplier = input.int(defval = 2, title = 'Body Size Multiplier (x)', minval = 0, group = g_af) + +bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) +int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) +int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) +int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) +int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) + +bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) +int i_day = input.int(defval = 13, minval = 1, maxval = 31, title = 'Day', group = g_af) +int i_month = input.int(defval = 03, minval = 1, maxval = 12, title = 'Month', group = g_af) +int i_year = input.int(defval = 2025, minval = 0, title = 'Year', group = g_af) + +string g_dtb = '████████████████ Data Table ████████████████' + +bool i_tbl_data_show = input.bool(defval = true, title = 'Display Table', group = g_dtb) +string i_tbl_data_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_dtb) +string i_tbl_data_txt_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_dtb) + +string g_ch = '███████████████ Chart Settings ███████████████' + +color i_pos_color = input.color(defval = #089981, title = 'Positive Mid', group = g_ch) +color i_pos_light_color = input.color(defval = #ACE5DC, title = 'Positive Light', group = g_ch) +color i_neg_light_color = input.color(defval = #FCCBCD, title = 'Negative Light', group = g_ch) +color i_neg_color = input.color(defval = #F23645, title = 'Negative Mid', group = g_ch) +color i_neu_color = input.color(defval = #9C9C9C, title = 'Neutral Light', group = g_ch) +color i_neu_dark_color = input.color(defval = #0F0F0F, title = 'Neutral Dark', group = g_ch) + +//_____________________________ Menu End + +//_____________________________ Cumulative Percentage Change Start + +// Function to calculate Daily Cumulative Percentage Change of Close Price +cum_pchg() => + var float _cum_pct_change = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 + _cum_pct_change := bool(_is_new_day) ? _daily_pct_change : na(_cum_pct_change) ? _daily_pct_change : _cum_pct_change + _daily_pct_change + _cum_pct_change + +// Calculate current cumulative percentage change +cum_pchg = cum_pchg() + +//_____________________________ Cumulative Percentage Change End + +//_____________________________ Cumulative Volume Percentage Change Start + +// Function to calculate Daily Cumulative Volume +cum_vol() => + var float _cum_vol = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _cum_vol := bool(_is_new_day) ? volume : na(_cum_vol) ? volume : _cum_vol + volume + _cum_vol + +// Calculate current and previous day cumulative volumes +var float curr_cum_vol = na +var float prev_cum_vol = na + +if ta.change(time('D')) != 0 + prev_cum_vol := curr_cum_vol + curr_cum_vol := volume + curr_cum_vol +else + curr_cum_vol := curr_cum_vol + volume + curr_cum_vol + +// Calculate Cumulative Volume Percentage Change +cum_vol_pchg = (curr_cum_vol - nz(prev_cum_vol, curr_cum_vol)) / nz(prev_cum_vol, curr_cum_vol) * 100 + +//_____________________________ Cumulative Volume Percentage Change End + +//_____________________________ Additional Filters Start + +// ATR Filter +bool atr_filter = true +if i_atr_filter + atr_filter := high - low > ta.atr(i_atr_length) * i_atr_multi + +// Body Percent Filter +bool body_filter = true +if i_body_filter + body_filter := math.abs(close - open) / (high - low) >= i_body_percent + +// Body Size Filter +bool body_size_filter = true +if i_body_size_filter + body_size_filter := math.abs(close - open) / (high - low) >= i_body_percent and high - low >= (high[1] - low[1]) * i_body_size_multiplier + +// Time Filter +bool time_filter = true +if i_time_filter + time_filter := (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) + +// Date Filter +bool date_filter = true +if i_date_filter + date_filter := year == i_year and month == i_month and dayofmonth == i_day + +//_____________________________ Additional Filters End + +//_____________________________ Fibonacci Start + +// Fibonacci Function +fibonacci(bool calc_from_high, float high_value, float low_value, float fib_value) => + if calc_from_high + low_value + (high_value - low_value) * fib_value + else + high_value - (high_value - low_value) * fib_value + +//_____________________________ Fibonacci End + +//_____________________________ Signals Start + +// Short Condition 1 +short_cont_1 = + open > close and + atr_filter and + body_filter and + body_size_filter + +var short_cont_1_high = float(na) +var short_cont_1_low = float(na) +var short_cont_1_bi = int(na) +if short_cont_1 + short_cont_1_high := high + short_cont_1_low := low + short_cont_1_bi := bar_index + +float bear_fib_val = fibonacci(false, short_cont_1_high, short_cont_1_low, i_fib_val) + +// Short Condition 2 +short_cont_2 = + ta.crossover(high, bear_fib_val) and + time_filter and + date_filter and + barstate.isconfirmed + +// Short Retracement Signal +var short_curr_state = 0 +short_prev_state = nz(short_curr_state[1]) +short_curr_state := short_prev_state == 2 ? 0 : short_prev_state +if short_cont_1 and short_curr_state == 0 + short_curr_state := 1 +if not short_cont_1 and short_cont_2 and short_curr_state == 1 + short_curr_state := 2 + +short_ret_signal = short_curr_state == 2 ? true : false + +// Long Condition 1 +long_cont_1 = + open < close and + atr_filter and + body_filter and + body_size_filter + +var long_cont_1_high = float(na) +var long_cont_1_low = float(na) +var long_cont_1_bi = int(na) +if long_cont_1 + long_cont_1_high := high + long_cont_1_low := low + long_cont_1_bi := bar_index + +float bull_fib_val = fibonacci(true, long_cont_1_high, long_cont_1_low, i_fib_val) + +// Long Condition 2 +long_cont_2 = + ta.crossunder(low, bull_fib_val) and + time_filter and + date_filter and + barstate.isconfirmed + +// Long Retracement +var long_curr_state = 0 +long_prev_state = nz(long_curr_state[1]) +long_curr_state := long_prev_state == 2 ? 0 : long_prev_state +if long_cont_1 and long_curr_state == 0 + long_curr_state := 1 +if not long_cont_1 and long_cont_2 and long_curr_state == 1 + long_curr_state := 2 + +long_ret_signal = long_curr_state == 2 ? true : false + +//_____________________________ Signals End + +//_____________________________ Plot Start + +// Plot +plotshape(series = i_scr_show_short and short_ret_signal ? 3 : na, title = 'Short Signal', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, size = size.tiny, force_overlay = true) +plotshape(series = i_scr_show_long and long_ret_signal ? 3 : na, title = 'Long Signal', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, size = size.tiny, force_overlay = true) +barcolor(color = i_scr_show_short and short_cont_1 ? i_neg_light_color : i_scr_show_long and long_cont_1 ? i_pos_light_color : na, title = '80% Candle') + +// Line +var line_array = array.new_line() + +if i_scr_show_short and short_ret_signal + array.push(line_array, line.new(x1 = short_cont_1_bi, y1 = bear_fib_val, x2 = bar_index, y2 = bear_fib_val, color = i_neg_color, style = i_fvg_ln_style)) + +if i_scr_show_long and long_ret_signal + array.push(line_array, line.new(x1 = long_cont_1_bi, y1 = bull_fib_val, x2 = bar_index, y2 = bull_fib_val, color = i_pos_color, style = i_fvg_ln_style)) + +//_____________________________ Plot End + +//_____________________________ Data Table Start + +// To String +day_pchg_str = str.tostring(cum_pchg, '#.##') + ' %' +volume_pchg_str = str.tostring(cum_vol_pchg, '#.##') + ' %' +day_volume_str = str.tostring(curr_cum_vol / 100000, '#.##') + ' L' +prev_day_volume_str = str.tostring(prev_cum_vol / 100000, '#.##') + ' L' + +// Color +bgcolor_1 = i_neu_dark_color +bgcolor_2 = i_neu_dark_color + +pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color +vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color +prev_vol_pchg_col = prev_cum_vol < curr_cum_vol ? i_neg_color : i_pos_color + +// Plot Table +var table tbl_data = table.new(position = i_tbl_data_pos, columns = 2, rows = 4, border_width = 1, force_overlay = true) + +if barstate.islast and i_tbl_data_show + table.cell(table_id = tbl_data, column = 0, row = 0, text = '%Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 0, text = day_pchg_str, text_color = pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + + table.cell(table_id = tbl_data, column = 0, row = 1, text = 'Vol %Chg', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 1, text = volume_pchg_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + + table.cell(table_id = tbl_data, column = 0, row = 2, text = 'Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 2, text = day_volume_str, text_color = vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_1, text_size = i_tbl_data_txt_size) + + table.cell(table_id = tbl_data, column = 0, row = 3, text = 'PD Vol', text_color = i_neu_color, text_halign = text.align_left, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + table.cell(table_id = tbl_data, column = 1, row = 3, text = prev_day_volume_str, text_color = prev_vol_pchg_col, text_halign = text.align_right, bgcolor = bgcolor_2, text_size = i_tbl_data_txt_size) + +//_____________________________ Data Table End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[t_01, o_01] = feed(effective_symbols), [t_02, o_02] = feed(o_01), [t_03, o_03] = feed(o_02), [t_04, o_04] = feed(o_03), [t_05, o_05] = feed(o_04), +[t_06, o_06] = feed(o_05), [t_07, o_07] = feed(o_06), [t_08, o_08] = feed(o_07), [t_09, o_09] = feed(o_08), [t_10, o_10] = feed(o_09), +[t_11, o_11] = feed(o_10), [t_12, o_12] = feed(o_11), [t_13, o_13] = feed(o_12), [t_14, o_14] = feed(o_13), [t_15, o_15] = feed(o_14), +[t_16, o_16] = feed(o_15), [t_17, o_17] = feed(o_16), [t_18, o_18] = feed(o_17), [t_19, o_19] = feed(o_18), [t_20, o_20] = feed(o_19), +[t_21, o_21] = feed(o_20), [t_22, o_22] = feed(o_21), [t_23, o_23] = feed(o_22), [t_24, o_24] = feed(o_23), [t_25, o_25] = feed(o_24), +[t_26, o_26] = feed(o_25), [t_27, o_27] = feed(o_26), [t_28, o_28] = feed(o_27), [t_29, o_29] = feed(o_28), [t_30, o_30] = feed(o_29), +[t_31, o_31] = feed(o_30), [t_32, o_32] = feed(o_31), [t_33, o_33] = feed(o_32), [t_34, o_34] = feed(o_33), [t_35, o_35] = feed(o_34), +[t_36, o_36] = feed(o_35), [t_37, o_37] = feed(o_36), [t_38, o_38] = feed(o_37), [t_39, o_39] = feed(o_38), [t_40, o_40] = feed(o_39) + +//_____________________________ Get Symbols for Screener End + +//_____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Scanner Conditions +short_cond = short_ret_signal +long_cond = long_ret_signal + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + _cum_pchg = float(na) + _cum_vol_pchg = float(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Short Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_long and long_cond + signal := 1 + + // Check for Long Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_short and short_cond + signal := -1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + _cum_pchg := cum_pchg + _cum_vol_pchg := cum_vol_pchg + + [_time, price, _cum_pchg, _cum_vol_pchg, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, 'HH:mm dd-MM-yyyy', timezone) : str.format_time(x, 'dd-MM-yyyy', timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ':'), 1) + +// Matrix setup +var matrix = matrix.new(0, 6, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) + +// Screener function to collect data +scan(s) => + [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + str_cum_pchg = str.tostring(_cum_pchg, '#.##') + str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) + +// Call Screener function for multiple symbols +scan(t_01), scan(t_02), scan(t_03), scan(t_04), scan(t_05), scan(t_06), scan(t_07), scan(t_08), scan(t_09), scan(t_10), scan(t_11), scan(t_12), +scan(t_13), scan(t_14), scan(t_15), scan(t_16), scan(t_17), scan(t_18), scan(t_19), scan(t_20), scan(t_21), scan(t_22), scan(t_23), scan(t_24), +scan(t_25), scan(t_26), scan(t_27), scan(t_28), scan(t_29), scan(t_30), scan(t_31), scan(t_32), scan(t_33), scan(t_34), scan(t_35), scan(t_36), +scan(t_37), scan(t_38), scan(t_39), scan(t_40) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_tbl_disp_rows + while matrix.rows(matrix) > i_scr_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix) - 1) + +// Plot Table +// Create table with specified properties +var table scr_tbl = table.new(position = i_scr_tbl_position, columns = 5, rows = 102, border_width = 1, force_overlay = true) + +// Function to populate cells in the table +scr_cell_title(col, row, txt) => + table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scr_tbl_text_size) + +scr_cell(col, row, txt, _text_color, _bgcolor) => + table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = _bgcolor, text_size = i_scr_tbl_text_size) + +// Check if it's the last bar +if barstate.islast and i_scr_show_table + // Clear existing data in the table + table.clear(scr_tbl, 0, 0, 2, 101) + + scr_cell_title(0, 0, 'Fill to ' + str.tostring(i_fib_val) + '%') + table.merge_cells(table_id = scr_tbl, start_column = 0, start_row = 0, end_column = 4, end_row = 0) + scr_cell_title(0, 1, 'Symbol') + scr_cell_title(1, 1, 'Time') + scr_cell_title(2, 1, 'Price') + scr_cell_title(3, 1, '%Chg') + scr_cell_title(4, 1, 'V %Chg') + + j = 4 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 by 1 + // Determine color based on the signal + + _textcolor = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : i_neu_color + + _bg_color = matrix.get(matrix, i, 5) == '1' ? i_neu_dark_color : matrix.get(matrix, i, 5) == '-1' ? i_neu_dark_color : i_neu_color + + // Populate cells in the table + scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) + scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) + scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) + scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) + scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) + + j := j + 1 + +//_____________________________ Screener End + +//_____________________________ Code End + +// Readme First: + +// ICT Liquidity Void Fill Scanner + +// Logic +// - This identifies a momentum candle, an 80% body candle with high volatility, or a displacement. +// - A signal is generated when the price retraces to the candle body, void, or FVG, based on the Fibonacci value. + +// Notes +// - Use a higher timeframe, like 4 hour or 1 hour, for stock selection. +// - The Scanner will generate wrong signals also. + diff --git a/ICT Liquidity Void/ICT Liquidity Void Screener.txt b/ICT Liquidity Void/ICT Liquidity Void Screener.txt index b7b8ede..258555c 100644 --- a/ICT Liquidity Void/ICT Liquidity Void Screener.txt +++ b/ICT Liquidity Void/ICT Liquidity Void Screener.txt @@ -1,363 +1,587 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -indicator(title="ICT Liquidity Void Screener", shorttitle="ICT LV Scr", overlay=true) - -//_____________________________ Menu Screener Start - -g_tb = '█████████████████ Screener █████████████████' - -tt_is = "• Input exactly 40 symbols, nothing more or less." + - "\n• Total characters cannot exceed 4096." + - "\n• Use comma as delimiter without any space." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" -string i_symbols = input.text_area( - defval="NSE:AEGISCHEM,NSE:BANKINDIA,NSE:BHEL,NSE:BLS,NSE:CASTROLIND,NSE:CESC,NSE:CGPOWER,NSE:CHAMBLFERT,NSE:DELTACORP,NSE:DEVYANI,NSE:EQUITASBNK,NSE:GAEL,NSE:GPPL,NSE:GSFC,NSE:HUDCO,NSE:IBULHSGFIN,NSE:INDIACEM,NSE:INDUSTOWER,NSE:IRCON,NSE:JKPAPER,NSE:JMFINANCIL,NSE:JYOTHYLAB,NSE:KARURVYSYA,NSE:NAM_INDIA,NSE:NATIONALUM,NSE:NCC,NSE:NETWORK18,NSE:NYKAA,NSE:PNB,NSE:RAIN,NSE:RALLIS,NSE:RBA,NSE:RBLBANK,NSE:RCF,NSE:REDINGTON,NSE:TRITURBINE,NSE:UNIONBANK,NSE:VAIBHAVGBL,NSE:WELSPUNLIV,NSE:ZEEL", - title="Paste Symbols", tooltip=tt_is, group=g_tb) - -string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) -bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) -bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) - -int i_scr_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) -string i_scr_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) -string i_scr_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) - -color i_scr_neg_col = input.color(defval=#F7525F, title='-', inline='c', group=g_tb) -color i_scr_pos_col = input.color(defval=#22AB94, title='+', inline='c', group=g_tb) -color i_scr_neu_col = input.color(defval=#B2B5BE, title='0', inline='c', group=g_tb) - -//_____________________________ Menu Screener End - -//_____________________________ Menu Liquidity Void Start - -g_lv = '███████████████ Liquidity Void ███████████████' - -int i_lv_show_last = input.int(defval=2, title='Show Last', minval=0, group=g_lv) -string i_lv_line = input.string(defval='High/Low', title='Source', options=['High/Low', 'OTE 0.79%', '50%'], group=g_lv) -bool i_lv_bear_show = input.bool(defval=true, title='Bearish', group=g_lv) -bool i_lv_bull_show = input.bool(defval=true, title='Bullish', group=g_lv) -bool i_lv_hide_crossed = input.bool(defval=false, title='Hide Crossed', group=g_lv) - -g_lv_f = "Void Height Filter" -tt_lv_f = "• Filters remove narrow liquidity voids." + - "\n• ATR filtering adjusts automatically when the timeframe changes." + - "\n• Percentage filter will be constant across all timeframes." + - "\n• If you don't want any filtering, choose 'Percentage' and then change Percentage to 0." -string i_lv_additional = input.string(defval='ATR', title='Filter Using', options=['ATR', 'Percentage'], tooltip=tt_lv_f, group=g_lv_f) -tt_lv_atr = "Applicable only if 'Filter Using' is 'ATR'" -int i_lv_atr_length = input.int(defval=14, minval=1, title='ATR Period', tooltip=tt_lv_atr, group=g_lv_f) -tt_lv_atr_m = "Higher the number, filters higher void height." -float i_lv_atr_multi = input.float(defval=4, minval=1, title='ATR Multiplier', tooltip=tt_lv_atr_m, group=g_lv_f) -tt_lv_p = "Filters liquidity void above the given percentage." -float i_lv_percentage = input.float(defval=2.5, minval=0, step=0.1, title='Percentage Above', tooltip=tt_lv_p, group=g_lv_f) - -g_lv_ds = "Display Settings" -color i_lv_bear_color = input.color(defval=#F7525F, title='Bearish Color', group=g_lv_ds) -color i_lv_bull_color = input.color(defval=#22AB94, title='Bullish Color', group=g_lv_ds) -string i_lv_ln_style = input.string(defval=line.style_solid, title="Line Style", options=[line.style_solid, line.style_dashed, line.style_dotted], group=g_lv_ds) -int i_lv_ln_width = input.int(defval=2, title='Width', group=g_lv_ds) -int i_lv_box_trans = input.int(defval=75, title='Box Transparency', group=g_lv_ds) - -//_____________________________ Menu Liquidity Void End - -//_____________________________ Functions Start - -// Function to calculate filter based on ATR or percentage -filter(prev_value, other_value, _atr_htf, _atr_multi, _percentage, _additional) => - filter_atr = math.abs(prev_value - other_value) > _atr_htf * _atr_multi - filter_percent = math.abs((prev_value - other_value) / prev_value * 100) > _percentage - _additional == 'ATR' ? filter_atr : filter_percent - -// Function to determine line type -price_source(float prev_value, float other_value, string price_source) => - price_source == 'High/Low' ? prev_value : - price_source == 'OTE 0.79%' ? other_value + ((prev_value - other_value) * 0.79) : - price_source == 'OTE 0.79%' ? other_value - ((prev_value - other_value) * 0.79) : - math.avg(prev_value, other_value) - -draw_line(int x1_time, float y1_price, color _color)=> - line.new(x1=x1_time, y1=y1_price, x2=time, y2=y1_price, xloc=xloc.bar_time, color=_color, style=i_lv_ln_style, width=i_lv_ln_width) - -draw_box(int left_time, float top_price, float bottom_price, color _color)=> - box.new(left=left_time, top=top_price, right=time, bottom=bottom_price, xloc=xloc.bar_time, border_color=color.new(_color, i_lv_box_trans), bgcolor=color.new(_color, i_lv_box_trans)) - -// Function to handle array operations and cleanup -clean_arrays(_all_lines, _keep_lines, _all_boxes, _keep_boxes, _lv_line, _lv_box) => - - array.push(_all_lines, _lv_line) - array.push(_all_boxes, _lv_box) - - if array.size(_all_lines) > i_lv_show_last - removed_line = array.shift(_all_lines) - if array.includes(_keep_lines, removed_line) - index_of_removed_line = array.indexof(_keep_lines, removed_line) - array.remove(_keep_lines, index_of_removed_line) - line.delete(removed_line) - - if array.size(_all_boxes) > i_lv_show_last - removed_box = array.shift(_all_boxes) - if array.includes(_keep_boxes, removed_box) - index_of_removed_box = array.indexof(_keep_boxes, removed_box) - array.remove(_keep_boxes, index_of_removed_box) - box.delete(removed_box) - -break_object(float price) => - high >= price and low <= price - -update_lines(lines, keep_lines, int _time) => - for current_line in lines - if not array.includes(keep_lines, current_line) - line.set_x2(current_line, _time) - line_price = line.get_y1(current_line) - if break_object(line_price) - array.push(keep_lines, current_line) - -update_boxes(boxes, keep_boxes, int _time) => - for current_box in boxes - if not array.includes(keep_boxes, current_box) - box.set_right(current_box, _time) - box_price = box.get_top(current_box) - if break_object(box_price) - array.push(keep_boxes, current_box) - -clean_lines(keep_lines, all_lines) => - for keep_line in keep_lines - line_price = line.get_y1(keep_line) - if i_lv_hide_crossed and break_object(line_price) - line.delete(keep_line) - index = array.indexof(all_lines, keep_line) - if not na(index) - array.remove(all_lines, index) - -clean_boxes(keep_boxes, all_boxes) => - for keep_box in keep_boxes - box_price = box.get_bottom(keep_box) - if i_lv_hide_crossed and break_object(box_price) - box.delete(keep_box) - index = array.indexof(all_boxes, keep_box) - if not na(index) - array.remove(all_boxes, index) - -//_____________________________ Functions End - -//_____________________________ Liquidity Void Bearish Start - -var float bear_prev_low = na, var int bear_prev_low_time = na -var float bear_price_source_val = na, var float bear_high_val = na -var bear_keep_lines = array.new_line(), var bear_all_lines = array.new_line() -var bear_keep_boxes = array.new_box(), var bear_all_boxes = array.new_box() - -if i_lv_bear_show and barstate.isconfirmed and (close > open) - bear_filter = filter(bear_prev_low, high, ta.atr(i_lv_atr_length), i_lv_atr_multi, i_lv_percentage, i_lv_additional) - bear_price_source = price_source(bear_prev_low, high, i_lv_line) - - if (na(bear_prev_low) or high <= bear_prev_low) and bear_filter - lv_bear_line = draw_line(bear_prev_low_time, bear_price_source, i_lv_bear_color) - lv_bear_box = draw_box(bear_prev_low_time, high, bear_prev_low, i_lv_bear_color) - clean_arrays(bear_all_lines, bear_keep_lines, bear_all_boxes, bear_keep_boxes, lv_bear_line, lv_bear_box) - - bear_high_val := high - bear_price_source_val := bear_price_source - - bear_prev_low := low - bear_prev_low_time := time - -// Update -update_lines(bear_all_lines, bear_keep_lines, time) -update_boxes(bear_all_boxes, bear_keep_boxes, time) - -// Clean -clean_lines(bear_keep_lines, bear_all_lines) -clean_boxes(bear_keep_boxes, bear_all_boxes) - -//_____________________________ Liquidity Void Bearish End - -//_____________________________ Liquidity Void Bullish Start - -var float bull_prev_high = na, var int bull_prev_high_time = na -var float bull_price_source_val = na, var float bull_low_val = na -var bull_keep_lines = array.new_line(), var bull_all_lines = array.new_line() -var bull_keep_boxes = array.new_box(), var bull_all_boxes = array.new_box() - -if i_lv_bull_show and barstate.isconfirmed and (close < open) - bull_filter = filter(bull_prev_high, low, ta.atr(i_lv_atr_length), i_lv_atr_multi, i_lv_percentage, i_lv_additional) - bull_price_source = price_source(bull_prev_high, low, i_lv_line) - - if (na(bull_prev_high) or low >= bull_prev_high) and bull_filter - lv_bull_line = draw_line(bull_prev_high_time, bull_price_source, i_lv_bull_color) - lv_bull_box = draw_box(bull_prev_high_time, low, bull_prev_high, i_lv_bull_color) - clean_arrays(bull_all_lines, bull_keep_lines, bull_all_boxes, bull_keep_boxes, lv_bull_line, lv_bull_box) - - bull_low_val := high - bull_price_source_val := bull_price_source - - bull_prev_high := high - bull_prev_high_time := time - -// Update -update_lines(bull_all_lines, bull_keep_lines, time) -update_boxes(bull_all_boxes, bull_keep_boxes, time) - -// Clean -clean_lines(bull_keep_lines, bull_all_lines) -clean_boxes(bull_keep_boxes, bull_all_boxes) - -//_____________________________ Liquidity Void Bullish End - -//____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_01, out_01] = feed(i_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), -[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), -[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), -[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), -[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), -[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), -[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), -[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), -[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), -[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) - -//____________________________ Get Symbols for Screener End - -// _____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Screener Conditions -bearish_cond = ta.crossunder(low, bull_price_source_val) and barstate.isconfirmed -bullish_cond = ta.crossover(high, bear_price_source_val) and barstate.isconfirmed - -// Define Bull and Bear Conditions -bull = not(i_scr_direction == "Bearish") -bear = not(i_scr_direction == "Bullish") - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - indicator = "" - signal = int(na) - - if barstate.isconfirmed - // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_bull and bearish_cond and bear - indicator := "L" - signal := -1 - - // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_bear and bullish_cond and bull - indicator := "H" - signal := 1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - - [_time, indicator, price, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 5, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, indicator, price, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, indicator, price, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, indicator, price, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, indicator, strPrice, strSignal) - -// Call Screener function for multiple symbols -screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), -screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), -screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), -screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), -screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), -screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_disp_rows - while matrix.rows(matrix) > i_scr_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table tbl = table.new(position=i_scr_position, columns=4, rows=102, border_width=1) - -// Function to populate cells in the table -cell(col, row, txt, color) => - table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_scr_text_size) - -// Check if it's the last bar -if barstate.islast - // Clear existing data in the table - table.clear(tbl, 0, 0, 3, 101) - - // Set headers for the table - cell(0, 0, "Symbol", i_scr_neu_col) - cell(1, 0, "Time", i_scr_neu_col) - cell(2, 0, "Dir" , i_scr_neu_col) - cell(3, 0, "Price", i_scr_neu_col) - - j = 1 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - col = matrix.get(matrix, i, 4) == "1" ? i_scr_neg_col : - matrix.get(matrix, i, 4) == "-1" ? i_scr_pos_col : i_scr_neu_col - - // Populate cells in the table - cell(0, j, matrix.get(matrix, i, 0), col) - cell(1, j, matrix.get(matrix, i, 1), col) - cell(2, j, matrix.get(matrix, i, 2), col) - cell(3, j, matrix.get(matrix, i, 3), col) - - j += 1 - -// _____________________________ Screener End - -// _____________________________ Code End +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +indicator(title="ICT Liquidity Void Screener", shorttitle="ICT LV Scr", overlay=true) + +//_____________________________ Menu Screener Start + +g_tb = '█████████████████ Screener █████████████████' + +tt_is = "• Input exactly 40 symbols, nothing more or less." + + "\n• Total characters cannot exceed 4096." + + "\n• Use comma as delimiter without any space." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" +string i_symbols = input.text_area( + defval="NSE:AEGISLOG,NSE:BANKINDIA,NSE:BHEL,NSE:BLS,NSE:CASTROLIND,NSE:CESC,NSE:CGPOWER,NSE:CHAMBLFERT,NSE:DELTACORP,NSE:DEVYANI,NSE:EQUITASBNK,NSE:GAEL,NSE:GPPL,NSE:GSFC,NSE:HUDCO,NSE:SAMMAANCAP,NSE:INDIACEM,NSE:INDUSTOWER,NSE:IRCON,NSE:JKPAPER,NSE:JMFINANCIL,NSE:JYOTHYLAB,NSE:KARURVYSYA,NSE:NAM_INDIA,NSE:NATIONALUM,NSE:NCC,NSE:NETWORK18,NSE:NYKAA,NSE:PNB,NSE:RAIN,NSE:RALLIS,NSE:RBA,NSE:RBLBANK,NSE:RCF,NSE:REDINGTON,NSE:TRITURBINE,NSE:UNIONBANK,NSE:VAIBHAVGBL,NSE:WELSPUNLIV,NSE:ZEEL", + title="Paste Symbols", tooltip=tt_is, group=g_tb) + +string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) +bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) +bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) + +int i_scr_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) +string i_scr_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) +string i_scr_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) + +color i_scr_neg_col = input.color(defval=#F7525F, title='-', inline='c', group=g_tb) +color i_scr_pos_col = input.color(defval=#22AB94, title='+', inline='c', group=g_tb) +color i_scr_neu_col = input.color(defval=#B2B5BE, title='0', inline='c', group=g_tb) + +//_____________________________ Menu Screener End + +//_____________________________ Menu Liquidity Void Start + +g_lv = '███████████████ Liquidity Void ███████████████' + +int i_lv_show_last = input.int(defval=2, title='Show Last', minval=0, group=g_lv) +string i_lv_line = input.string(defval='High/Low', title='Source', options=['High/Low', 'OTE 0.79%', '50%'], group=g_lv) +bool i_lv_bear_show = input.bool(defval=true, title='Bearish', group=g_lv) +bool i_lv_bull_show = input.bool(defval=true, title='Bullish', group=g_lv) +bool i_lv_hide_crossed = input.bool(defval=false, title='Hide Crossed', group=g_lv) + +g_lv_f = "Void Height Filter" +tt_lv_f = "• Filters remove narrow liquidity voids." + + "\n• ATR filtering adjusts automatically when the timeframe changes." + + "\n• Percentage filter will be constant across all timeframes." + + "\n• If you don't want any filtering, choose 'Percentage' and then change Percentage to 0." +string i_lv_additional = input.string(defval='ATR', title='Filter Using', options=['ATR', 'Percentage'], tooltip=tt_lv_f, group=g_lv_f) +tt_lv_atr = "Applicable only if 'Filter Using' is 'ATR'" +int i_lv_atr_length = input.int(defval=14, minval=1, title='ATR Period', tooltip=tt_lv_atr, group=g_lv_f) +tt_lv_atr_m = "Higher the number, filters higher void height." +float i_lv_atr_multi = input.float(defval=4, minval=1, title='ATR Multiplier', tooltip=tt_lv_atr_m, group=g_lv_f) +tt_lv_p = "Filters liquidity void above the given percentage." +float i_lv_percentage = input.float(defval=2.5, minval=0, step=0.1, title='Percentage Above', tooltip=tt_lv_p, group=g_lv_f) + +g_lv_ds = "Display Settings" +color i_lv_bear_color = input.color(defval=#F7525F, title='Bearish Color', group=g_lv_ds) +color i_lv_bull_color = input.color(defval=#22AB94, title='Bullish Color', group=g_lv_ds) +string i_lv_ln_style = input.string(defval=line.style_solid, title="Line Style", options=[line.style_solid, line.style_dashed, line.style_dotted], group=g_lv_ds) +int i_lv_ln_width = input.int(defval=2, title='Width', group=g_lv_ds) +int i_lv_box_trans = input.int(defval=75, title='Box Transparency', group=g_lv_ds) + +//_____________________________ Menu Liquidity Void End + +//_____________________________ Functions Start + +// Function to calculate filter based on ATR or percentage +filter(prev_value, other_value, _atr_htf, _atr_multi, _percentage, _additional) => + filter_atr = math.abs(prev_value - other_value) > _atr_htf * _atr_multi + filter_percent = math.abs((prev_value - other_value) / prev_value * 100) > _percentage + _additional == 'ATR' ? filter_atr : filter_percent + +// Function to determine line type +price_source(float prev_value, float other_value, string price_source) => + price_source == 'High/Low' ? prev_value : + price_source == 'OTE 0.79%' ? other_value + ((prev_value - other_value) * 0.79) : + price_source == 'OTE 0.79%' ? other_value - ((prev_value - other_value) * 0.79) : + math.avg(prev_value, other_value) + +draw_line(int x1_time, float y1_price, color _color)=> + line.new(x1=x1_time, y1=y1_price, x2=time, y2=y1_price, xloc=xloc.bar_time, color=_color, style=i_lv_ln_style, width=i_lv_ln_width) + +draw_box(int left_time, float top_price, float bottom_price, color _color)=> + box.new(left=left_time, top=top_price, right=time, bottom=bottom_price, xloc=xloc.bar_time, border_color=color.new(_color, i_lv_box_trans), bgcolor=color.new(_color, i_lv_box_trans)) + +// Function to handle array operations and cleanup +clean_arrays(_all_lines, _keep_lines, _all_boxes, _keep_boxes, _lv_line, _lv_box) => + + array.push(_all_lines, _lv_line) + array.push(_all_boxes, _lv_box) + + if array.size(_all_lines) > i_lv_show_last + removed_line = array.shift(_all_lines) + if array.includes(_keep_lines, removed_line) + index_of_removed_line = array.indexof(_keep_lines, removed_line) + array.remove(_keep_lines, index_of_removed_line) + line.delete(removed_line) + + if array.size(_all_boxes) > i_lv_show_last + removed_box = array.shift(_all_boxes) + if array.includes(_keep_boxes, removed_box) + index_of_removed_box = array.indexof(_keep_boxes, removed_box) + array.remove(_keep_boxes, index_of_removed_box) + box.delete(removed_box) + +break_object(float price) => + high >= price and low <= price + +update_lines(lines, keep_lines, int _time) => + for current_line in lines + if not array.includes(keep_lines, current_line) + line.set_x2(current_line, _time) + line_price = line.get_y1(current_line) + if break_object(line_price) + array.push(keep_lines, current_line) + +update_boxes(boxes, keep_boxes, int _time) => + for current_box in boxes + if not array.includes(keep_boxes, current_box) + box.set_right(current_box, _time) + box_price = box.get_top(current_box) + if break_object(box_price) + array.push(keep_boxes, current_box) + +clean_lines(keep_lines, all_lines) => + for keep_line in keep_lines + line_price = line.get_y1(keep_line) + if i_lv_hide_crossed and break_object(line_price) + line.delete(keep_line) + index = array.indexof(all_lines, keep_line) + if not na(index) + array.remove(all_lines, index) + +clean_boxes(keep_boxes, all_boxes) => + for keep_box in keep_boxes + box_price = box.get_bottom(keep_box) + if i_lv_hide_crossed and break_object(box_price) + box.delete(keep_box) + index = array.indexof(all_boxes, keep_box) + if not na(index) + array.remove(all_boxes, index) + +//_____________________________ Functions End + +//_____________________________ Liquidity Void Bearish Start + +var float bear_prev_low = na, var int bear_prev_low_time = na +var float bear_price_source_val = na, var float bear_high_val = na +var bear_keep_lines = array.new_line(), var bear_all_lines = array.new_line() +var bear_keep_boxes = array.new_box(), var bear_all_boxes = array.new_box() + +if i_lv_bear_show and barstate.isconfirmed and (close > open) + bear_filter = filter(bear_prev_low, high, ta.atr(i_lv_atr_length), i_lv_atr_multi, i_lv_percentage, i_lv_additional) + bear_price_source = price_source(bear_prev_low, high, i_lv_line) + + if (na(bear_prev_low) or high <= bear_prev_low) and bear_filter + lv_bear_line = draw_line(bear_prev_low_time, bear_price_source, i_lv_bear_color) + lv_bear_box = draw_box(bear_prev_low_time, high, bear_prev_low, i_lv_bear_color) + clean_arrays(bear_all_lines, bear_keep_lines, bear_all_boxes, bear_keep_boxes, lv_bear_line, lv_bear_box) + + bear_high_val := high + bear_price_source_val := bear_price_source + + bear_prev_low := low + bear_prev_low_time := time + +// Update +update_lines(bear_all_lines, bear_keep_lines, time) +update_boxes(bear_all_boxes, bear_keep_boxes, time) + +// Clean +clean_lines(bear_keep_lines, bear_all_lines) +clean_boxes(bear_keep_boxes, bear_all_boxes) + +//_____________________________ Liquidity Void Bearish End + +//_____________________________ Liquidity Void Bullish Start + +var float bull_prev_high = na, var int bull_prev_high_time = na +var float bull_price_source_val = na, var float bull_low_val = na +var bull_keep_lines = array.new_line(), var bull_all_lines = array.new_line() +var bull_keep_boxes = array.new_box(), var bull_all_boxes = array.new_box() + +if i_lv_bull_show and barstate.isconfirmed and (close < open) + bull_filter = filter(bull_prev_high, low, ta.atr(i_lv_atr_length), i_lv_atr_multi, i_lv_percentage, i_lv_additional) + bull_price_source = price_source(bull_prev_high, low, i_lv_line) + + if (na(bull_prev_high) or low >= bull_prev_high) and bull_filter + lv_bull_line = draw_line(bull_prev_high_time, bull_price_source, i_lv_bull_color) + lv_bull_box = draw_box(bull_prev_high_time, low, bull_prev_high, i_lv_bull_color) + clean_arrays(bull_all_lines, bull_keep_lines, bull_all_boxes, bull_keep_boxes, lv_bull_line, lv_bull_box) + + bull_low_val := high + bull_price_source_val := bull_price_source + + bull_prev_high := high + bull_prev_high_time := time + +// Update +update_lines(bull_all_lines, bull_keep_lines, time) +update_boxes(bull_all_boxes, bull_keep_boxes, time) + +// Clean +clean_lines(bull_keep_lines, bull_all_lines) +clean_boxes(bull_keep_boxes, bull_all_boxes) + +//_____________________________ Liquidity Void Bullish End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_01, out_01] = feed(effective_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), +[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), +[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), +[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), +[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), +[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), +[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), +[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), +[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), +[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) + +//____________________________ Get Symbols for Screener End + +// _____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Screener Conditions +bearish_cond = ta.crossunder(low, bull_price_source_val) and barstate.isconfirmed +bullish_cond = ta.crossover(high, bear_price_source_val) and barstate.isconfirmed + +// Define Bull and Bear Conditions +bull = not(i_scr_direction == "Bearish") +bear = not(i_scr_direction == "Bullish") + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + indicator = "" + signal = int(na) + + if barstate.isconfirmed + // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_bull and bearish_cond and bear + indicator := "L" + signal := -1 + + // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_bear and bullish_cond and bull + indicator := "H" + signal := 1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + + [_time, indicator, price, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 5, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, indicator, price, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, indicator, price, signal)) + +// Screener function to collect data +screener(s) => + [_time, indicator, price, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, indicator, strPrice, strSignal) + +// Call Screener function for multiple symbols +screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), +screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), +screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), +screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), +screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), +screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_disp_rows + while matrix.rows(matrix) > i_scr_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table tbl = table.new(position=i_scr_position, columns=4, rows=102, border_width=1) + +// Function to populate cells in the table +cell(col, row, txt, color) => + table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_scr_text_size) + +// Check if it's the last bar +if barstate.islast + // Clear existing data in the table + table.clear(tbl, 0, 0, 3, 101) + + // Set headers for the table + cell(0, 0, "Symbol", i_scr_neu_col) + cell(1, 0, "Time", i_scr_neu_col) + cell(2, 0, "Dir" , i_scr_neu_col) + cell(3, 0, "Price", i_scr_neu_col) + + j = 1 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + col = matrix.get(matrix, i, 4) == "1" ? i_scr_neg_col : + matrix.get(matrix, i, 4) == "-1" ? i_scr_pos_col : i_scr_neu_col + + // Populate cells in the table + cell(0, j, matrix.get(matrix, i, 0), col) + cell(1, j, matrix.get(matrix, i, 1), col) + cell(2, j, matrix.get(matrix, i, 2), col) + cell(3, j, matrix.get(matrix, i, 3), col) + + j += 1 + +// _____________________________ Screener End + +// _____________________________ Code End + diff --git a/ICT Market Structure Shift (MSS)/ICT Market Structure Shift (MSS) Screener.txt b/ICT Market Structure Shift (MSS)/ICT Market Structure Shift (MSS) Screener.txt index aa78a6f..8ce8366 100644 --- a/ICT Market Structure Shift (MSS)/ICT Market Structure Shift (MSS) Screener.txt +++ b/ICT Market Structure Shift (MSS)/ICT Market Structure Shift (MSS) Screener.txt @@ -1,452 +1,676 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -i_max_bars_back = 300 -indicator(title="ICT Market Structure Shift (MSS) Screener", shorttitle="ICT MSS Scr", overlay=true, max_bars_back=i_max_bars_back, max_lines_count=500, max_boxes_count=500) - -//_____________________________ Menu Screener Start - -g_tb = '█████████████████ Screener █████████████████' - -string i_scr_choose = input.string(defval='Market Structure Shift', title='Screening Method', options=['Market Structure Shift', 'Retracement to OTE / OB'], group=g_tb) - -tt_is = "• Input exactly 40 symbols, nothing more or less." + - "\n• Total characters cannot exceed 4096." + - "\n• Use comma as delimiter without any space." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BEL,NSE:BHEL,NSE:BIOCON,NSE:CHAMBLFERT,NSE:COALINDIA,NSE:CUB,NSE:DELTACORP,NSE:EXIDEIND,NSE:GAIL,NSE:HINDCOPPER,NSE:IEX,NSE:IGL,NSE:INDIACEM,NSE:INDUSTOWER,NSE:IOC,NSE:JUBLFOOD,NSE:L_TFH,NSE:M_MFIN,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NMDC,NSE:NTPC,NSE:ONGC,NSE:PETRONET,NSE:PFC,NSE:PNB,NSE:POWERGRID,NSE:RBLBANK,NSE:RECLTD,NSE:SAIL,NSE:TATAPOWER,NSE:UPL,NSE:VEDL,NSE:ZEEL", - title="Paste Symbols", tooltip=tt_is, group=g_tb) - -string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) -bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) -bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) - -int i_tbl_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) -color i_neu_color = input.color(defval=#B2B5BE, title='Text Color', group=g_tb) -string i_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) -string i_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) - -//_____________________________ Menu Screener End - -//_____________________________ Menu Zig Zag Start - -g_zz = '██████████████████ Zig Zag ██████████████████' - -bool i_zz_bear_show = input.bool(defval=true, title='Bearish', inline='be', group=g_zz) -bool i_zz_bear_shift_show = input.bool(defval=true, title='Shift', inline='be', group=g_zz) -bool i_zz_bear_ret_show = input.bool(defval=true, title='Retracement', inline='be', group=g_zz) - -bool i_zz_bull_show = input.bool(defval=true, title='Bullish ', inline='bu', group=g_zz) -bool i_zz_bull_shift_show = input.bool(defval=true, title='Shift', inline='bu', group=g_zz) -bool i_zz_bull_ret_show = input.bool(defval=true, title='Retracement', inline='bu', group=g_zz) - -int i_zz_period = input.int(defval=4, title='Zig Zag Length', minval=2, group=g_zz) -string i_zz_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close'], group=g_zz) -tt_zz = "• Distance between swings." + - "\n• Lower values mean highs and lows are closer." -float i_zz_percent = input.float(defval=0, minval=0, step=0.1, title='% Difference >', tooltip=tt_zz, group=g_zz) -bool i_zz_show = input.bool(defval=false, title='', inline='zz', group=g_zz) -color i_zz_bull_color = input.color(defval=#1E53E5, title='Zig Zag Colors: +', inline='zz', group=g_zz) -color i_zz_bear_color = input.color(defval=#1E53E5, title='-', inline='zz', group=g_zz) -color i_pos_color = input.color(defval=#22AB94, title='Colors:             +', inline='c_1', group=g_zz) -color i_neg_color = input.color(defval=#F7525F, title='-', inline='c_1', group=g_zz) -color i_zz_bull_signal_color = input.color(defval=#70CCBD, title='Signal Colors:       +', inline='c_2', group=g_zz) -color i_zz_bear_signal_color = input.color(defval=#FAA1A4, title='-', inline='c_2', group=g_zz) -int i_zz_bx_transp = input.int(defval=75, title='Box Transparency   ', minval=0, maxval=100, group=g_zz) - -g_zz_f = "Additional Filters" -tt_zz_f = "• Filters remove narrow swing displacements." + - "\n• Swing displacement means the distance between old swing high/low and new swing high/low." + - "\n• Multiplier filtering adjusts automatically when the chart timeframe changes." + - "\n• Percentage filter will be constant across all timeframes." + - "\n• If you don't want any filtering, choose 'Percentage' and then change Percentage to 0." -string i_zz_filter_choice = input.string(defval='Percentage', title='Filter Using', options=['Multiplier', 'Percentage'], tooltip=tt_zz_f, group=g_zz_f) -tt_zz_m = "• Higher the number, filters higher swing displacement." + - "\n• Eg: If 'Multiplier' is 2, swing displacement is 2 times than the previous swing." -float i_zz_multiplier = input.float(defval=2, minval=1, step=0.1, title='Multiplier', tooltip=tt_zz_m, group=g_zz_f) -tt_zz_p = "Filters liquidity displacement above the given percentage." -float i_zz_percentage = input.float(defval=0.7, minval=0, step=0.1, title='Percentage Above', tooltip=tt_zz_p, group=g_zz_f) - -//_____________________________ Menu Zig Zag End - -//_____________________________ Zig Zag Start - -// Acknowledgement & Reference -// Trader: 'RozaniGhani-RG' -// Indicator Title: 'Zig Zag Ratio Simplified' -// Indicator Link: 'https://www.tradingview.com/script/CIk186OY-Zig-Zag-Ratio-Simplified/' - -//_____________________________ Get Source - -float _high = i_zz_source == 'Open/Close' ? math.max(open, close) : high -float _low = i_zz_source == 'Open/Close' ? math.min(open, close) : low - -//============================== 1. Variables - -//_____________________________ 1.1 Highest / Lowest -float ph = ta.highestbars(_high, i_zz_period) == 0 ? _high : na -float pl = ta.lowestbars(_low, i_zz_period) == 0 ? _low : na - -//_____________________________ 1.2 Dir -var int dir = 0, dir := pl and na(ph) ? -1 : ph and na(pl) ? 1 : dir - -//_____________________________ 1.4 Array -var max_array_size = 10, var zigzag = array.new_float(0), oldzigzag = array.copy(zigzag) - -//_____________________________ 1.5 Others -var line line_zz = na - -//============================== 3. Custom Functions - -add_to_zigzag(float[] pointer, float value, int bindex) => - array.unshift(pointer, bindex) - array.unshift(pointer, value) - if array.size(pointer) > max_array_size - array.pop(pointer) - array.pop(pointer) - -update_zigzag(float[] pointer, float value, int bindex, int dir) => - if array.size(pointer) == 0 - add_to_zigzag(pointer, value, bindex) - else - if dir == 1 and value > array.get(pointer, 0) or dir == -1 and value < array.get(pointer, 0) - array.set(pointer, 0, value) - array.set(pointer, 1, bindex) - 0. - -//============================== 4. Calculations - -dirchanged = ta.change(dir) - -if ph or pl - if dirchanged - add_to_zigzag(zigzag, dir == 1 ? ph : pl, bar_index) - else - update_zigzag(zigzag, dir == 1 ? ph : pl, bar_index, dir) - -//============================== 5. Constructs - -if array.size(zigzag) >= 6 - if array.get(zigzag, 0) != array.get(oldzigzag, 0) or array.get(zigzag, 1) != array.get(oldzigzag, 1) - if array.get(zigzag, 2) == array.get(oldzigzag, 2) and array.get(zigzag, 3) == array.get(oldzigzag, 3) - line.delete(line_zz) - if i_zz_show - line_zz := line.new(x1 = math.round(array.get(zigzag, 1)), y1 = array.get(zigzag, 0), x2 = math.round(array.get(zigzag, 3)), y2 = array.get(zigzag, 2), color = dir == 1 ? i_zz_bull_color : i_zz_bear_color, width=2) - -//_____________________________ Get Swing Price & Bar Index - -zz_1 = array.size(zigzag) > 7 ? array.get(zigzag, array.size(zigzag) - 8) : na -bi_1 = array.size(zigzag) > 6 ? array.get(zigzag, array.size(zigzag) - 7) : na -zz_2 = array.size(zigzag) > 5 ? array.get(zigzag, array.size(zigzag) - 6) : na -bi_2 = array.size(zigzag) > 4 ? array.get(zigzag, array.size(zigzag) - 5) : na -zz_3 = array.size(zigzag) > 3 ? array.get(zigzag, array.size(zigzag) - 4) : na -bi_3 = array.size(zigzag) > 2 ? array.get(zigzag, array.size(zigzag) - 3) : na - -// Create a single label for the last five zigzag values and their corresponding bar index -//label_text = str.tostring(zz_0) + "\n" + str.tostring(bi_0) + "\n" + str.tostring(zz_1) + "\n" + str.tostring(bi_1) + "\n" + str.tostring(zz_2) + -// "\n" + str.tostring(bi_2) + "\n" + str.tostring(zz_3) + "\n" + str.tostring(bi_3) + "\n" + str.tostring(zz_4) + "\n" + str.tostring(bi_4) -//if barstate.islast -// label.new(x = bar_index, y = high, text = label_text, color=color.white) - -// Function to calculate filter based on ATR or percentage -filter(float swing_3, float swing_2, float swing_1, float multiplier, float percentage, string choice) => - filter_x_times = math.abs(swing_1 - swing_2) > math.abs(swing_3 - swing_2) * multiplier - filter_percent = math.abs((swing_3 - swing_1) / swing_3 * 100) > percentage - choice == 'Multiplier' ? filter_x_times : filter_percent - -bearish_filter = filter(zz_3, zz_2, zz_1, i_zz_multiplier, i_zz_percentage, i_zz_filter_choice) -bullish_filter = filter(zz_3, zz_2, zz_1, i_zz_multiplier, i_zz_percentage, i_zz_filter_choice) - -//_____________________________ MSS Conditions - -// Bearish Condition -bearish_condition = - zz_1 > zz_2 and - zz_1 > zz_3 and - zz_2 < zz_1 and - zz_2 < zz_3 and - zz_3 < zz_1 and - zz_3 > zz_2 and - close < zz_1 and - close < zz_2 and - close < zz_3 and - ta.crossunder(close, zz_2) and - bearish_filter and - barstate.isconfirmed - -// Bullish Condition -bullish_condition = - zz_1 < zz_2 and - zz_1 < zz_3 and - zz_2 > zz_1 and - zz_2 > zz_3 and - zz_3 > zz_1 and - zz_3 < zz_2 and - close > zz_1 and - close > zz_2 and - close > zz_3 and - ta.crossover(close, zz_2) and - bullish_filter and - barstate.isconfirmed - -//___________________________ Bearish Retracement - -// Retracement Levels -float bearish_retracement_level = zz_1 - ((zz_1-zz_2)/3) -float bullish_retracement_level = zz_1 + ((zz_2-zz_1)/3) - -// Get Bearish Retracement Price in Bearish Condition -var bearish_retracement_price = float(na) -var bearish_retracement_bi = float(na) -if bearish_condition - bearish_retracement_price := bearish_retracement_level - bearish_retracement_bi := bi_1 - -// Bearish Retracement Condition -bool bearish_retracement_condition = - ta.crossover(high, bearish_retracement_price) and - barstate.isconfirmed - -// Bearish Retracement in Sequential Order -var bear_current_state = 0 -bear_previous_state = nz(bear_current_state[1]) -bear_current_state := bear_previous_state == 2 ? 0 : bear_previous_state -if bearish_condition and bear_current_state == 0 - bear_current_state := 1 -if bearish_retracement_condition and bear_current_state == 1 - bear_current_state := 2 - -bool bearish_retracement_trigger = bear_current_state == 2 ? true : false - -//___________________________ Bullish Retracement - -// Get Bullish Retracement Price in Bullish Condition -var bullish_retracement_price = float(na) -var bullish_retracement_bi = float(na) -if bullish_condition - bullish_retracement_price := bullish_retracement_level - bullish_retracement_bi := bi_1 - -// Bullish Retracement Condition -bool bullish_retracement_condition = - ta.crossunder(low, bullish_retracement_price) and - barstate.isconfirmed - -// Bullish Retracement in Sequential Order -var bull_current_state = 0 -bull_previous_state = nz(bull_current_state[1]) -bull_current_state := bull_previous_state == 2 ? 0 : bull_previous_state -if bullish_condition and bull_current_state == 0 - bull_current_state := 1 -if bullish_retracement_condition and bull_current_state == 1 - bull_current_state := 2 - -bool bullish_retracement_trigger = bull_current_state == 2 ? true : false - -//_____________________________ Plot - -// Plot Break Signal -plotshape(series=i_zz_bear_show and i_zz_bear_shift_show ? bearish_condition : na, title='Bearish Shift', style=shape.triangledown, location=location.abovebar, color=i_zz_bear_signal_color, textcolor=i_zz_bear_signal_color, size=size.tiny) -plotshape(series=i_zz_bull_show and i_zz_bull_shift_show ? bullish_condition : na, title='Bullish Shift', style=shape.triangleup, location=location.belowbar, color=i_zz_bull_signal_color, textcolor=i_zz_bull_signal_color, size=size.tiny) -barcolor(color=i_zz_bear_show and i_zz_bear_shift_show and bearish_condition ? i_zz_bear_signal_color : i_zz_bull_show and i_zz_bull_shift_show and bullish_condition ? i_zz_bull_signal_color : na, title='Shift Candle') - -//var box_array = array.new_box() -var line_array = array.new_line() - -if i_zz_bear_show and bearish_condition - ph_box = box.new(left=int(bi_3), top=zz_3, right=int(bi_1), bottom=zz_1, border_color=#00000000, bgcolor=color.new(i_neg_color, i_zz_bx_transp)) - if i_zz_bear_shift_show - ph_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_neg_color, style=line.style_dashed) - //array.push(box_array, ph_box) - array.push(line_array, ph_line) - -if i_zz_bull_show and bullish_condition - pl_box = box.new(left=int(bi_3), top=zz_3, right=int(bi_1), bottom=zz_1, border_color=#00000000, bgcolor=color.new(i_pos_color, i_zz_bx_transp)) - if i_zz_bull_shift_show - pl_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_pos_color, style=line.style_dashed) - //array.push(box_array, pl_box) - array.push(line_array, pl_line) - -// Plot Retracement Signal -plotchar(series=i_zz_bear_show and i_zz_bear_ret_show and bearish_retracement_trigger ? 3 : na, title='Bear Retracement', char="↷", location=location.abovebar, color=i_zz_bear_signal_color, size=size.tiny) -plotchar(series=i_zz_bull_show and i_zz_bull_ret_show and bullish_retracement_trigger ? 3 : na, title='Bull Retracement', char="⤻", location=location.belowbar, color=i_zz_bull_signal_color, size=size.tiny) -barcolor(color=i_zz_bear_show and i_zz_bear_ret_show and bearish_retracement_trigger ? i_zz_bear_signal_color : i_zz_bull_show and i_zz_bull_ret_show and bullish_retracement_trigger ? i_zz_bull_signal_color : na, title='Retracement Candle') - -//var line_array = array.new_line() - -if i_zz_bear_show and i_zz_bear_ret_show and bearish_retracement_trigger - bull_ret_ln = line.new(x1=int(bearish_retracement_bi), y1=bearish_retracement_price, x2=bar_index, y2=bearish_retracement_price, color=i_neg_color, style=line.style_dotted) - array.push(line_array, bull_ret_ln) - -if i_zz_bull_show and i_zz_bull_ret_show and bullish_retracement_trigger - bear_ret_ln = line.new(x1=int(bullish_retracement_bi), y1=bullish_retracement_price, x2=bar_index, y2=bullish_retracement_price, color=i_pos_color, style=line.style_dotted) - array.push(line_array, bear_ret_ln) - -//_____________________________ Zig Zag End - -//_____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_001, out_001] = feed(i_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), -[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), -[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), -[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), -[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), -[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), -[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), -[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), -[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), -[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) - -//_____________________________ Get Symbols for Screener End - -//_____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Choose Screening Method -bear_method = - i_scr_choose == 'Market Structure Shift' ? bearish_condition : - bearish_retracement_trigger and bearish_retracement_condition - -bull_method = - i_scr_choose == 'Market Structure Shift' ? bullish_condition : - bullish_retracement_trigger and bullish_retracement_condition - -// Screener Conditions -bearish_cond = bear_method -bullish_cond = bull_method - -// Define Bull and Bear Conditions -bull = not(i_scr_direction == "Bearish") -bear = not(i_scr_direction == "Bullish") - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_bull and bearish_cond and bear - signal := -1 - - // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_bear and bullish_cond and bull - signal := 1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - - [_time, price, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 4, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, price, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, price, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, strPrice, strSignal) - -// Call Screener function for multiple symbols -screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), -screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), -screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), -screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), -screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), -screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_tbl_disp_rows - while matrix.rows(matrix) > i_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table tbl = table.new(position=i_tbl_position, columns=3, rows=102, border_width=1) - -// Function to populate cells in the table -cell_title(col, row, txt) => - table.cell(tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor = color.new(i_neu_color, 90), text_size=i_tbl_text_size) - -cell(col, row, txt, color) => - table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) - -// Check if it's the last bar -if barstate.islast - // Clear existing data in the table - table.clear(tbl, 0, 0, 2, 101) - - cell_title(0, 0, i_scr_choose) - table.merge_cells(table_id=tbl, start_column=0, start_row=0, end_column=2, end_row=0) - cell_title(0, 1, "Symbol") - cell_title(1, 1, "Time") - cell_title(2, 1, "Price") - - j = 2 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - col = matrix.get(matrix, i, 3) == "1" ? i_pos_color : - matrix.get(matrix, i, 3) == "-1" ? i_neg_color : i_neu_color - - // Populate cells in the table - cell(0, j, matrix.get(matrix, i, 0), col) - cell(1, j, matrix.get(matrix, i, 1), col) - cell(2, j, matrix.get(matrix, i, 2), col) - - j += 1 - -//_____________________________ Screener End - -//_____________________________ Code End +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +i_max_bars_back = 300 +indicator(title="ICT Market Structure Shift (MSS) Screener", shorttitle="ICT MSS Scr", overlay=true, max_bars_back=i_max_bars_back, max_lines_count=500, max_boxes_count=500) + +//_____________________________ Menu Screener Start + +g_tb = '█████████████████ Screener █████████████████' + +string i_scr_choose = input.string(defval='Market Structure Shift', title='Screening Method', options=['Market Structure Shift', 'Retracement to OTE / OB'], group=g_tb) + +tt_is = "• Input exactly 40 symbols, nothing more or less." + + "\n• Total characters cannot exceed 4096." + + "\n• Use comma as delimiter without any space." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BEL,NSE:BHEL,NSE:BIOCON,NSE:CHAMBLFERT,NSE:COALINDIA,NSE:CUB,NSE:DELTACORP,NSE:EXIDEIND,NSE:GAIL,NSE:HINDCOPPER,NSE:IEX,NSE:IGL,NSE:INDIACEM,NSE:INDUSTOWER,NSE:IOC,NSE:JUBLFOOD,NSE:L_TFH,NSE:M_MFIN,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NMDC,NSE:NTPC,NSE:ONGC,NSE:PETRONET,NSE:PFC,NSE:PNB,NSE:POWERGRID,NSE:RBLBANK,NSE:RECLTD,NSE:SAIL,NSE:TATAPOWER,NSE:UPL,NSE:VEDL,NSE:ZEEL", + title="Paste Symbols", tooltip=tt_is, group=g_tb) + +string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) +bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) +bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) + +int i_tbl_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) +color i_neu_color = input.color(defval=#B2B5BE, title='Text Color', group=g_tb) +string i_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) +string i_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) + +//_____________________________ Menu Screener End + +//_____________________________ Menu Zig Zag Start + +g_zz = '██████████████████ Zig Zag ██████████████████' + +bool i_zz_bear_show = input.bool(defval=true, title='Bearish', inline='be', group=g_zz) +bool i_zz_bear_shift_show = input.bool(defval=true, title='Shift', inline='be', group=g_zz) +bool i_zz_bear_ret_show = input.bool(defval=true, title='Retracement', inline='be', group=g_zz) + +bool i_zz_bull_show = input.bool(defval=true, title='Bullish ', inline='bu', group=g_zz) +bool i_zz_bull_shift_show = input.bool(defval=true, title='Shift', inline='bu', group=g_zz) +bool i_zz_bull_ret_show = input.bool(defval=true, title='Retracement', inline='bu', group=g_zz) + +int i_zz_period = input.int(defval=4, title='Zig Zag Length', minval=2, group=g_zz) +string i_zz_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close'], group=g_zz) +tt_zz = "• Distance between swings." + + "\n• Lower values mean highs and lows are closer." +float i_zz_percent = input.float(defval=0, minval=0, step=0.1, title='% Difference >', tooltip=tt_zz, group=g_zz) +bool i_zz_show = input.bool(defval=false, title='', inline='zz', group=g_zz) +color i_zz_bull_color = input.color(defval=#1E53E5, title='Zig Zag Colors: +', inline='zz', group=g_zz) +color i_zz_bear_color = input.color(defval=#1E53E5, title='-', inline='zz', group=g_zz) +color i_pos_color = input.color(defval=#22AB94, title='Colors:             +', inline='c_1', group=g_zz) +color i_neg_color = input.color(defval=#F7525F, title='-', inline='c_1', group=g_zz) +color i_zz_bull_signal_color = input.color(defval=#70CCBD, title='Signal Colors:       +', inline='c_2', group=g_zz) +color i_zz_bear_signal_color = input.color(defval=#FAA1A4, title='-', inline='c_2', group=g_zz) +int i_zz_bx_transp = input.int(defval=75, title='Box Transparency   ', minval=0, maxval=100, group=g_zz) + +g_zz_f = "Additional Filters" +tt_zz_f = "• Filters remove narrow swing displacements." + + "\n• Swing displacement means the distance between old swing high/low and new swing high/low." + + "\n• Multiplier filtering adjusts automatically when the chart timeframe changes." + + "\n• Percentage filter will be constant across all timeframes." + + "\n• If you don't want any filtering, choose 'Percentage' and then change Percentage to 0." +string i_zz_filter_choice = input.string(defval='Percentage', title='Filter Using', options=['Multiplier', 'Percentage'], tooltip=tt_zz_f, group=g_zz_f) +tt_zz_m = "• Higher the number, filters higher swing displacement." + + "\n• Eg: If 'Multiplier' is 2, swing displacement is 2 times than the previous swing." +float i_zz_multiplier = input.float(defval=2, minval=1, step=0.1, title='Multiplier', tooltip=tt_zz_m, group=g_zz_f) +tt_zz_p = "Filters liquidity displacement above the given percentage." +float i_zz_percentage = input.float(defval=0.7, minval=0, step=0.1, title='Percentage Above', tooltip=tt_zz_p, group=g_zz_f) + +//_____________________________ Menu Zig Zag End + +//_____________________________ Zig Zag Start + +// Acknowledgement & Reference +// Trader: 'RozaniGhani-RG' +// Indicator Title: 'Zig Zag Ratio Simplified' +// Indicator Link: 'https://www.tradingview.com/script/CIk186OY-Zig-Zag-Ratio-Simplified/' + +//_____________________________ Get Source + +float _high = i_zz_source == 'Open/Close' ? math.max(open, close) : high +float _low = i_zz_source == 'Open/Close' ? math.min(open, close) : low + +//============================== 1. Variables + +//_____________________________ 1.1 Highest / Lowest +float ph = ta.highestbars(_high, i_zz_period) == 0 ? _high : na +float pl = ta.lowestbars(_low, i_zz_period) == 0 ? _low : na + +//_____________________________ 1.2 Dir +var int dir = 0, dir := pl and na(ph) ? -1 : ph and na(pl) ? 1 : dir + +//_____________________________ 1.4 Array +var max_array_size = 10, var zigzag = array.new_float(0), oldzigzag = array.copy(zigzag) + +//_____________________________ 1.5 Others +var line line_zz = na + +//============================== 3. Custom Functions + +add_to_zigzag(float[] pointer, float value, int bindex) => + array.unshift(pointer, bindex) + array.unshift(pointer, value) + if array.size(pointer) > max_array_size + array.pop(pointer) + array.pop(pointer) + +update_zigzag(float[] pointer, float value, int bindex, int dir) => + if array.size(pointer) == 0 + add_to_zigzag(pointer, value, bindex) + else + if dir == 1 and value > array.get(pointer, 0) or dir == -1 and value < array.get(pointer, 0) + array.set(pointer, 0, value) + array.set(pointer, 1, bindex) + 0. + +//============================== 4. Calculations + +dirchanged = ta.change(dir) + +if ph or pl + if dirchanged + add_to_zigzag(zigzag, dir == 1 ? ph : pl, bar_index) + else + update_zigzag(zigzag, dir == 1 ? ph : pl, bar_index, dir) + +//============================== 5. Constructs + +if array.size(zigzag) >= 6 + if array.get(zigzag, 0) != array.get(oldzigzag, 0) or array.get(zigzag, 1) != array.get(oldzigzag, 1) + if array.get(zigzag, 2) == array.get(oldzigzag, 2) and array.get(zigzag, 3) == array.get(oldzigzag, 3) + line.delete(line_zz) + if i_zz_show + line_zz := line.new(x1 = math.round(array.get(zigzag, 1)), y1 = array.get(zigzag, 0), x2 = math.round(array.get(zigzag, 3)), y2 = array.get(zigzag, 2), color = dir == 1 ? i_zz_bull_color : i_zz_bear_color, width=2) + +//_____________________________ Get Swing Price & Bar Index + +zz_1 = array.size(zigzag) > 7 ? array.get(zigzag, array.size(zigzag) - 8) : na +bi_1 = array.size(zigzag) > 6 ? array.get(zigzag, array.size(zigzag) - 7) : na +zz_2 = array.size(zigzag) > 5 ? array.get(zigzag, array.size(zigzag) - 6) : na +bi_2 = array.size(zigzag) > 4 ? array.get(zigzag, array.size(zigzag) - 5) : na +zz_3 = array.size(zigzag) > 3 ? array.get(zigzag, array.size(zigzag) - 4) : na +bi_3 = array.size(zigzag) > 2 ? array.get(zigzag, array.size(zigzag) - 3) : na + +// Create a single label for the last five zigzag values and their corresponding bar index +//label_text = str.tostring(zz_0) + "\n" + str.tostring(bi_0) + "\n" + str.tostring(zz_1) + "\n" + str.tostring(bi_1) + "\n" + str.tostring(zz_2) + +// "\n" + str.tostring(bi_2) + "\n" + str.tostring(zz_3) + "\n" + str.tostring(bi_3) + "\n" + str.tostring(zz_4) + "\n" + str.tostring(bi_4) +//if barstate.islast +// label.new(x = bar_index, y = high, text = label_text, color=color.white) + +// Function to calculate filter based on ATR or percentage +filter(float swing_3, float swing_2, float swing_1, float multiplier, float percentage, string choice) => + filter_x_times = math.abs(swing_1 - swing_2) > math.abs(swing_3 - swing_2) * multiplier + filter_percent = math.abs((swing_3 - swing_1) / swing_3 * 100) > percentage + choice == 'Multiplier' ? filter_x_times : filter_percent + +bearish_filter = filter(zz_3, zz_2, zz_1, i_zz_multiplier, i_zz_percentage, i_zz_filter_choice) +bullish_filter = filter(zz_3, zz_2, zz_1, i_zz_multiplier, i_zz_percentage, i_zz_filter_choice) + +//_____________________________ MSS Conditions + +// Bearish Condition +bearish_condition = + zz_1 > zz_2 and + zz_1 > zz_3 and + zz_2 < zz_1 and + zz_2 < zz_3 and + zz_3 < zz_1 and + zz_3 > zz_2 and + close < zz_1 and + close < zz_2 and + close < zz_3 and + ta.crossunder(close, zz_2) and + bearish_filter and + barstate.isconfirmed + +// Bullish Condition +bullish_condition = + zz_1 < zz_2 and + zz_1 < zz_3 and + zz_2 > zz_1 and + zz_2 > zz_3 and + zz_3 > zz_1 and + zz_3 < zz_2 and + close > zz_1 and + close > zz_2 and + close > zz_3 and + ta.crossover(close, zz_2) and + bullish_filter and + barstate.isconfirmed + +//___________________________ Bearish Retracement + +// Retracement Levels +float bearish_retracement_level = zz_1 - ((zz_1-zz_2)/3) +float bullish_retracement_level = zz_1 + ((zz_2-zz_1)/3) + +// Get Bearish Retracement Price in Bearish Condition +var bearish_retracement_price = float(na) +var bearish_retracement_bi = float(na) +if bearish_condition + bearish_retracement_price := bearish_retracement_level + bearish_retracement_bi := bi_1 + +// Bearish Retracement Condition +bool bearish_retracement_condition = + ta.crossover(high, bearish_retracement_price) and + barstate.isconfirmed + +// Bearish Retracement in Sequential Order +var bear_current_state = 0 +bear_previous_state = nz(bear_current_state[1]) +bear_current_state := bear_previous_state == 2 ? 0 : bear_previous_state +if bearish_condition and bear_current_state == 0 + bear_current_state := 1 +if bearish_retracement_condition and bear_current_state == 1 + bear_current_state := 2 + +bool bearish_retracement_trigger = bear_current_state == 2 ? true : false + +//___________________________ Bullish Retracement + +// Get Bullish Retracement Price in Bullish Condition +var bullish_retracement_price = float(na) +var bullish_retracement_bi = float(na) +if bullish_condition + bullish_retracement_price := bullish_retracement_level + bullish_retracement_bi := bi_1 + +// Bullish Retracement Condition +bool bullish_retracement_condition = + ta.crossunder(low, bullish_retracement_price) and + barstate.isconfirmed + +// Bullish Retracement in Sequential Order +var bull_current_state = 0 +bull_previous_state = nz(bull_current_state[1]) +bull_current_state := bull_previous_state == 2 ? 0 : bull_previous_state +if bullish_condition and bull_current_state == 0 + bull_current_state := 1 +if bullish_retracement_condition and bull_current_state == 1 + bull_current_state := 2 + +bool bullish_retracement_trigger = bull_current_state == 2 ? true : false + +//_____________________________ Plot + +// Plot Break Signal +plotshape(series=i_zz_bear_show and i_zz_bear_shift_show ? bearish_condition : na, title='Bearish Shift', style=shape.triangledown, location=location.abovebar, color=i_zz_bear_signal_color, textcolor=i_zz_bear_signal_color, size=size.tiny) +plotshape(series=i_zz_bull_show and i_zz_bull_shift_show ? bullish_condition : na, title='Bullish Shift', style=shape.triangleup, location=location.belowbar, color=i_zz_bull_signal_color, textcolor=i_zz_bull_signal_color, size=size.tiny) +barcolor(color=i_zz_bear_show and i_zz_bear_shift_show and bearish_condition ? i_zz_bear_signal_color : i_zz_bull_show and i_zz_bull_shift_show and bullish_condition ? i_zz_bull_signal_color : na, title='Shift Candle') + +//var box_array = array.new_box() +var line_array = array.new_line() + +if i_zz_bear_show and bearish_condition + ph_box = box.new(left=int(bi_3), top=zz_3, right=int(bi_1), bottom=zz_1, border_color=#00000000, bgcolor=color.new(i_neg_color, i_zz_bx_transp)) + if i_zz_bear_shift_show + ph_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_neg_color, style=line.style_dashed) + //array.push(box_array, ph_box) + array.push(line_array, ph_line) + +if i_zz_bull_show and bullish_condition + pl_box = box.new(left=int(bi_3), top=zz_3, right=int(bi_1), bottom=zz_1, border_color=#00000000, bgcolor=color.new(i_pos_color, i_zz_bx_transp)) + if i_zz_bull_shift_show + pl_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_pos_color, style=line.style_dashed) + //array.push(box_array, pl_box) + array.push(line_array, pl_line) + +// Plot Retracement Signal +plotchar(series=i_zz_bear_show and i_zz_bear_ret_show and bearish_retracement_trigger ? 3 : na, title='Bear Retracement', char="↷", location=location.abovebar, color=i_zz_bear_signal_color, size=size.tiny) +plotchar(series=i_zz_bull_show and i_zz_bull_ret_show and bullish_retracement_trigger ? 3 : na, title='Bull Retracement', char="⤻", location=location.belowbar, color=i_zz_bull_signal_color, size=size.tiny) +barcolor(color=i_zz_bear_show and i_zz_bear_ret_show and bearish_retracement_trigger ? i_zz_bear_signal_color : i_zz_bull_show and i_zz_bull_ret_show and bullish_retracement_trigger ? i_zz_bull_signal_color : na, title='Retracement Candle') + +//var line_array = array.new_line() + +if i_zz_bear_show and i_zz_bear_ret_show and bearish_retracement_trigger + bull_ret_ln = line.new(x1=int(bearish_retracement_bi), y1=bearish_retracement_price, x2=bar_index, y2=bearish_retracement_price, color=i_neg_color, style=line.style_dotted) + array.push(line_array, bull_ret_ln) + +if i_zz_bull_show and i_zz_bull_ret_show and bullish_retracement_trigger + bear_ret_ln = line.new(x1=int(bullish_retracement_bi), y1=bullish_retracement_price, x2=bar_index, y2=bullish_retracement_price, color=i_pos_color, style=line.style_dotted) + array.push(line_array, bear_ret_ln) + +//_____________________________ Zig Zag End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_001, out_001] = feed(effective_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), +[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), +[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), +[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), +[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), +[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), +[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), +[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), +[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), +[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) + +//_____________________________ Get Symbols for Screener End + +//_____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Choose Screening Method +bear_method = + i_scr_choose == 'Market Structure Shift' ? bearish_condition : + bearish_retracement_trigger and bearish_retracement_condition + +bull_method = + i_scr_choose == 'Market Structure Shift' ? bullish_condition : + bullish_retracement_trigger and bullish_retracement_condition + +// Screener Conditions +bearish_cond = bear_method +bullish_cond = bull_method + +// Define Bull and Bear Conditions +bull = not(i_scr_direction == "Bearish") +bear = not(i_scr_direction == "Bullish") + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_bull and bearish_cond and bear + signal := -1 + + // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_bear and bullish_cond and bull + signal := 1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + + [_time, price, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 4, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, price, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, signal)) + +// Screener function to collect data +screener(s) => + [_time, price, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, strPrice, strSignal) + +// Call Screener function for multiple symbols +screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), +screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), +screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), +screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), +screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), +screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_tbl_disp_rows + while matrix.rows(matrix) > i_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table tbl = table.new(position=i_tbl_position, columns=3, rows=102, border_width=1) + +// Function to populate cells in the table +cell_title(col, row, txt) => + table.cell(tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor = color.new(i_neu_color, 90), text_size=i_tbl_text_size) + +cell(col, row, txt, color) => + table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) + +// Check if it's the last bar +if barstate.islast + // Clear existing data in the table + table.clear(tbl, 0, 0, 2, 101) + + cell_title(0, 0, i_scr_choose) + table.merge_cells(table_id=tbl, start_column=0, start_row=0, end_column=2, end_row=0) + cell_title(0, 1, "Symbol") + cell_title(1, 1, "Time") + cell_title(2, 1, "Price") + + j = 2 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + col = matrix.get(matrix, i, 3) == "1" ? i_pos_color : + matrix.get(matrix, i, 3) == "-1" ? i_neg_color : i_neu_color + + // Populate cells in the table + cell(0, j, matrix.get(matrix, i, 0), col) + cell(1, j, matrix.get(matrix, i, 1), col) + cell(2, j, matrix.get(matrix, i, 2), col) + + j += 1 + +//_____________________________ Screener End + +//_____________________________ Code End + diff --git a/ICT Mitigation Block Scanner/[Scanner] ICT Mitigation Block Scanner.txt b/ICT Mitigation Block Scanner/[Scanner] ICT Mitigation Block Scanner.txt index 51c1fa3..bb5f371 100644 --- a/ICT Mitigation Block Scanner/[Scanner] ICT Mitigation Block Scanner.txt +++ b/ICT Mitigation Block Scanner/[Scanner] ICT Mitigation Block Scanner.txt @@ -1,764 +1,988 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -indicator(title='ICT Mitigation Block Scanner', shorttitle='ICT MB Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) - -//_____________________________ Menu Screener Start - -g_scrtb = '█████████████████ Scanner █████████████████' - -string i_scr_choose = input.string(defval='Mitigation Block', title='Screening Method', options=['Mitigation Block', 'Retracement'], group=g_scrtb) - -tt_is = "• Reads only up to first 40 symbols." + - "\n• Total characters cannot exceed 4096." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ASHOKA,NSE:BEPL,NSE:BIOCON,NSE:BLS,NSE:CAMPUS,NSE:CASTROLIND,NSE:CESC,NSE:EDELWEISS,NSE:EMBDL,NSE:ENGINERSIN,NSE:EPL,NSE:FSL,NSE:GAEL,NSE:GREAVESCOT,NSE:GSPL,NSE:HFCL,NSE:HONASA,NSE:HUDCO,NSE:INDUSTOWER,NSE:INOXWIND,NSE:IOLCP,NSE:JAMNAAUTO,NSE:JMFINANCIL,NSE:JTLIND,NSE:KALAMANDIR,NSE:LTFOODS,NSE:LXCHEM,NSE:MARKSANS,NSE:NFL,NSE:NLCINDIA,NSE:ORIENTCEM,NSE:PPLPHARMA,NSE:RAIN,NSE:RELIGARE,NSE:SAMMAANCAP,NSE:SEQUENT,NSE:TI,NSE:TRIVENI,NSE:TVSSCS,NSE:ZOMATO", - title="Paste Symbols", tooltip=tt_is, group=g_scrtb) - -bool i_scr_show_table = input.bool(defval=true, title='Display Table', group=g_scrtb) -bool i_scr_show_long = input.bool(defval=true, title='Long Signals', inline='tb_2', group=g_scrtb) -bool i_scr_show_short = input.bool(defval=true, title='Short Signals', inline='tb_2', group=g_scrtb) - -int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) -string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) -string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) - -//_____________________________ Menu Screener End - -//_____________________________ Menu Zig Zag Start - -g_zz = '██████████████████ Zig Zag ██████████████████' - -bool i_zz_display = input.bool(defval=true, title='Display Zig Zag', group=g_zz) -int i_zz_period = input.int(defval=3, title='Zig Zag Length', minval=2, group=g_zz) -string i_zz_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close', 'Close'], group=g_zz) -color i_zz_bull_color = input.color(defval=#26A69A, title='Color Up', group=g_zz) -color i_zz_bear_color = input.color(defval=#FF5252, title='Color Down', group=g_zz) -int i_zz_bx_transp = input.int(defval=85, title='Box Transparency', minval=0, maxval=100, group=g_zz) - -//_____________________________ Menu Zig Zag End - -//_____________________________ Menu Additional Fiters Start - -g_af = '███████████████ Additional Fiters ███████████████' -tt_pchg = - "• If '% Change Above/Below +/-' is 4, it means relative volume is considered when the price change is above 4%." + - "\n• A value of 4% is positive for bullish scenarios and negative for bearish scenarios." + - "\n• The percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." -tt_vpchg = - "• If 'Volume % Change Above' is 0, it means Relative Volume is considered when today's volume is greater than the previous day's volume." + - "\n• For 'Screening Method' choice 'Retracement to EMA,' the 'Apply Volume % Change Filter' can be unchecked." + - "\n• A 'Volume % Change Above' 300% or more often indicates a major breakout, which may happen today or the next day." + - "\n• The volume percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." -tt_atr = - "• ATR helps filter out longer or more volatile signal candles." -tt_atr_mul = - "• Higher multiplier value filters a longer or more volatile signal candle." -tt_bf = - "• If the input is '80', it means the body covers over 80% of the candle." -tt_bs = - "• 2 means the candle is 2 times larger than the previous candle." -tt_vol = - "• Filter out a candle when its volume is greater than the SMA of the volume." -tt_rv = - "• Filter out a candle when its volume is greater than the Relative Volume." -tt_tf = - "• Filter out a signals between the given Time." -tt_df = - "• Filter out a signals on the given Date." + - "\n• This Time Filter is applicable only for 'Displacement Candles'." - -bool i_pchg_filter = input.bool(defval=false, title='Apply % Change Filter', tooltip=tt_pchg, group=g_af) -float i_pchg_above_below = input.float(defval=2, title='% Change Above/Below +/-', minval=0, group=g_af) - -bool i_vol_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vpchg, group=g_af) -int i_vol_above = input.int(defval=500000, title='Volume Above', minval=0, group=g_af) - -bool i_vol_pchg_filter = input.bool(defval=false, title='Apply Volume % Change Filter', tooltip=tt_vpchg, group=g_af) -float i_vol_pchg_above = input.float(defval=0, title='Volume % Change Above', minval=0, group=g_af) - -bool i_atr_filter = input.bool(defval=false, title='Apply ATR Filter', tooltip=tt_atr, group=g_af) -int i_atr_length = input.int(defval=14, minval=1, title='ATR Length', group=g_af) -float i_atr_multi = input.float(defval=1, title='ATR Multiplier', minval=1, group=g_af) - -bool i_body_filter = input.bool(defval=false, title='Apply Body % Filter', tooltip=tt_bf, group=g_af) -float i_body_percent = input.float(defval=60, title='Body % Above', minval=0, maxval=100, group=g_af) / 100 - -bool i_body_size_filter = input.bool(defval=false, title='Apply Body Size Filter', tooltip=tt_bs, group=g_af) -int i_body_size_multiplier = input.int(defval=2, title='Body Size Multiplier (x)', minval=0, group=g_af) - -bool i_volume_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vol, group=g_af) -int i_vol_sma_length = input.int(defval=20, minval=1, title='Volume SMA Length', group=g_af) - -bool i_rel_vol_filter = input.bool(defval=false, title='Apply FVG Retracement Filter', tooltip=tt_rv, group=g_af) -int i_rel_vol_avg_vol_len = input.int(defval=90, title='FVG Retracement Length', minval=2, group=g_af) -float i_rel_vol_avg_vol_multi = input.float(defval=5, title='Rel Vol SMA Multiplier', minval=0, group=g_af) - -bool i_time_filter = input.bool(defval=false, title='Apply Time Filter', tooltip=tt_tf, group=g_af) -int i_hour_1 = input.int(defval=9, minval=0, title='Time From', inline='t_1', group=g_af) -int i_minute_1 = input.int(defval=15, minval=0, title=':', inline='t_1', group=g_af) -int i_hour_2 = input.int(defval=10, minval=0, title='Time To ', inline='t_2', group=g_af) -int i_minute_2 = input.int(defval=15, minval=0, title=':', inline='t_2', group=g_af) - -bool i_date_filter = input.bool(defval=false, title='Apply Date Filter', tooltip=tt_df, group=g_af) -int i_day = input.int(defval=25, minval=1, maxval=31, title='Day', group=g_af) -int i_month = input.int(defval=10, minval=1, maxval=12, title='Month', group=g_af) -int i_year = input.int(defval=2024, minval=0, title='Year', group=g_af) - -//_____________________________ Menu Additional Fiters End - -//_____________________________ Menu Table Start - -g_dtb = '█████████████████ Data Table █████████████████' -bool i_tbl_data_show = input.bool(defval=true, title='Display Table', group=g_dtb) -string i_tbl_data_pos = input.string(defval=position.bottom_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_dtb) -string i_tbl_data_txt_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_dtb) - -//_____________________________ Menu Table End - -//_____________________________ Chart Settings Start - -g_ch = '███████████████ Chart Settings ███████████████' -color i_pos_dark_color = input.color(defval=#03110F, title='Positive Dark', group=g_ch) -color i_pos_color = input.color(defval=#26A69A, title='Positive Mid', group=g_ch) -color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) -color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) -color i_neg_color = input.color(defval=#FF5252, title='Negative Mid', group=g_ch) -color i_neg_dark_color = input.color(defval=#180809, title='Negative Dark', group=g_ch) -//color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) -//color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) -color i_neu_color = input.color(defval=#D1D4DC, title='Neutral Light', group=g_ch) -color i_neu_mid_color = input.color(defval=#2A2E39, title='Neutral Mid', group=g_ch) -color i_neu_dark_color = input.color(defval=#141516, title='Neutral Dark', group=g_ch) - -//_____________________________ Chart Settings End - -//_____________________________ Cumulative Percentage Change Start - -// Function to calculate Daily Cumulative Percentage Change of Close Price -cumulative_percentage_change() => - var float _cum_pct_change = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 - _cum_pct_change := _is_new_day ? _daily_pct_change : (na(_cum_pct_change) ? _daily_pct_change : (_cum_pct_change + _daily_pct_change)) - _cum_pct_change - -// Calculate current cumulative percentage change -cum_pchg = cumulative_percentage_change() - -//_____________________________ Cumulative Percentage Change End - -//_____________________________ Cumulative Volume Percentage Change Start - -// Function to calculate Daily Cumulative Volume -cumulative_volume() => - var float _cum_vol = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _cum_vol := _is_new_day ? volume : (na(_cum_vol) ? volume : (_cum_vol + volume)) - _cum_vol - -// Calculate current and previous day cumulative volumes -var float current_cum_vol = na -var float prev_cum_vol = na - -if ta.change(time('D')) != 0 - prev_cum_vol := current_cum_vol - current_cum_vol := volume -else - current_cum_vol += volume - -// Calculate Cumulative Volume Percentage Change -cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 - -//_____________________________ Cumulative Volume Percentage Change End - -//_____________________________ Additional Filters Start - -// % Change Filter -bool pchg_above_filter = true -bool pchg_below_filter = true -if i_pchg_filter - pchg_above_filter := cum_pchg > i_pchg_above_below - pchg_below_filter := cum_pchg < -i_pchg_above_below - -// Volume Filter -bool vol_filter = true -if i_vol_filter - vol_filter := current_cum_vol >= i_vol_above - -// Volume % Change Filter -bool vol_pchg_filter = true -if i_vol_pchg_filter - vol_pchg_filter := cum_vol_pchg >= i_vol_pchg_above - -// ATR Filter -bool atr_filter = true -if i_atr_filter - atr_filter := (high - low) > ta.atr(i_atr_length) * i_atr_multi - -// Body Percent Filter -bool body_filter = true -if i_body_filter - body_filter := (math.abs(close - open)) / (high - low) >= i_body_percent - -// Body Size Filter -bool body_size_filter = true -if i_body_size_filter - body_size_filter := (math.abs(close - open)) / (high - low) >= i_body_percent and (high - low) >= (high[1] - low[1]) * i_body_size_multiplier - -// Volume SMA Filter -bool volume_filter = true -if i_volume_filter - volume_filter := volume > ta.sma(volume, i_vol_sma_length) - -// FVG Retracement Filter -average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) -relative_volume = volume / average_volume[1] -rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi - -bool rel_vol_filter = true -if i_rel_vol_filter - rel_vol_filter := relative_volume > rel_vol_sma_multiplier - -// Time Filter -bool time_filter = true -if i_time_filter - time_filter := (hour > i_hour_1 or (hour == i_hour_1 and minute >= i_minute_1)) and (hour < i_hour_2 or (hour == i_hour_2 and minute < i_minute_2)) - -// Date Filter -bool date_filter = true -if i_date_filter - date_filter := (year == i_year and month == i_month and dayofmonth == i_day) - -//_____________________________ Additional Filters End - -//_____________________________ Zig Zag Start - -// Acknowledgement & Reference -// Trader: 'RozaniGhani-RG' -// Indicator Title: 'Zig Zag Ratio Simplified' -// Indicator Link: 'https://www.tradingview.com/script/CIk186OY-Zig-Zag-Ratio-Simplified/' - -//_____________________________ Get Source - -float _high = - i_zz_source == 'Open/Close' ? math.max(open, close) : - i_zz_source == 'Close' ? close : - high - -float _low = - i_zz_source == 'Open/Close' ? math.max(open, close) : - i_zz_source == 'Close' ? close : - low - -//============================== 1. Variables - -//_____________________________ 1.1 Highest / Lowest -float ph = ta.highestbars(_high, i_zz_period) == 0 ? _high : na -float pl = ta.lowestbars(_low, i_zz_period) == 0 ? _low : na - -//_____________________________ 1.2 Dir -var int dir = 0, dir := pl and na(ph) ? -1 : ph and na(pl) ? 1 : dir - -//_____________________________ 1.4 Array -var max_array_size = 18, var zigzag = array.new_float(0), oldzigzag = array.copy(zigzag) - -//_____________________________ 1.5 Others -var line line_zz = na - -//============================== 3. Custom Functions - -add_to_zigzag(float[] pointer, float value, int bindex) => - array.unshift(pointer, bindex) - array.unshift(pointer, value) - if array.size(pointer) > max_array_size - array.pop(pointer) - array.pop(pointer) - -update_zigzag(float[] pointer, float value, int bindex, int dir) => - if array.size(pointer) == 0 - add_to_zigzag(pointer, value, bindex) - else - if dir == 1 and value > array.get(pointer, 0) or dir == -1 and value < array.get(pointer, 0) - array.set(pointer, 0, value) - array.set(pointer, 1, bindex) - 0. - -//============================== 4. Calculations - -dirchanged = ta.change(dir) - -if ph or pl - if dirchanged - add_to_zigzag(zigzag, dir == 1 ? ph : pl, bar_index) - else - update_zigzag(zigzag, dir == 1 ? ph : pl, bar_index, dir) - -//============================== 5. Constructs - -if array.size(zigzag) >= 9 - if array.get(zigzag, 0) != array.get(oldzigzag, 0) or array.get(zigzag, 1) != array.get(oldzigzag, 1) - if array.get(zigzag, 2) == array.get(oldzigzag, 2) and array.get(zigzag, 3) == array.get(oldzigzag, 3) - line.delete(line_zz) - if i_zz_display - line_zz := line.new(x1 = math.round(array.get(zigzag, 1)), y1 = array.get(zigzag, 0), x2 = math.round(array.get(zigzag, 3)), y2 = array.get(zigzag, 2), color = dir == 1 ? i_zz_bull_color : i_zz_bear_color, width=1) - -//_____________________________ Get Swing Price & Bar Index - -zz_0 = array.size(zigzag) > 17 ? array.get(zigzag, array.size(zigzag) - 18) : na -bi_0 = array.size(zigzag) > 16 ? array.get(zigzag, array.size(zigzag) - 17) : na -zz_1 = array.size(zigzag) > 15 ? array.get(zigzag, array.size(zigzag) - 16) : na -bi_1 = array.size(zigzag) > 14 ? array.get(zigzag, array.size(zigzag) - 15) : na -zz_2 = array.size(zigzag) > 13 ? array.get(zigzag, array.size(zigzag) - 14) : na -bi_2 = array.size(zigzag) > 12 ? array.get(zigzag, array.size(zigzag) - 13) : na -zz_3 = array.size(zigzag) > 11 ? array.get(zigzag, array.size(zigzag) - 12) : na -//bi_3 = array.size(zigzag) > 10 ? array.get(zigzag, array.size(zigzag) - 11) : na -zz_4 = array.size(zigzag) > 9 ? array.get(zigzag, array.size(zigzag) - 10) : na -//bi_4 = array.size(zigzag) > 8 ? array.get(zigzag, array.size(zigzag) - 9) : na -zz_5 = array.size(zigzag) > 7 ? array.get(zigzag, array.size(zigzag) - 8) : na -//bi_5 = array.size(zigzag) > 6 ? array.get(zigzag, array.size(zigzag) - 7) : na -zz_6 = array.size(zigzag) > 5 ? array.get(zigzag, array.size(zigzag) - 6) : na -//bi_6 = array.size(zigzag) > 4 ? array.get(zigzag, array.size(zigzag) - 5) : na -zz_7 = array.size(zigzag) > 3 ? array.get(zigzag, array.size(zigzag) - 4) : na -//bi_7 = array.size(zigzag) > 2 ? array.get(zigzag, array.size(zigzag) - 3) : na -zz_8 = array.size(zigzag) > 1 ? array.get(zigzag, array.size(zigzag) - 2) : na -bi_8 = array.size(zigzag) > 0 ? array.get(zigzag, array.size(zigzag) - 1) : na - -// Create a single label for the last five zigzag values and their corresponding bar index -//label_text = str.tostring(zz_0) + "\n" + str.tostring(bi_0) + "\n" + str.tostring(zz_1) + "\n" + str.tostring(bi_1) + "\n" + str.tostring(zz_2) + -// "\n" + str.tostring(bi_2) + "\n" + str.tostring(zz_3) + "\n" + str.tostring(bi_3) + "\n" + str.tostring(zz_4) + "\n" + str.tostring(bi_4) -//if barstate.islast -// label.new(x = bar_index, y = high, text = label_text, color=color.white) - -//_____________________________ Retracement Signals Start - -// Short Retracement Start - -// Short Condition 1 -short_ret_cont_1 = - zz_1 > zz_2 and - zz_1 < zz_3 and - - zz_2 < zz_1 and - zz_2 < zz_3 and - - zz_3 > zz_2 and - zz_3 > zz_1 and - zz_3 > zz_4 and - zz_3 < zz_5 and - - zz_4 < zz_3 and - zz_4 > zz_2 and - zz_4 < zz_5 and - //zz_4 > zz_6 and - - zz_5 > zz_3 and - zz_5 > zz_4 and - zz_5 > zz_6 and - zz_5 > zz_7 and - - zz_6 < zz_5 and - //zz_6 < zz_4 and - zz_6 < zz_7 and - //zz_6 > zz_8 and - - zz_7 > zz_6 and - zz_7 < zz_5 and - zz_7 > zz_8 and - - //zz_8 < zz_7 and - //zz_8 < zz_6 and - - ta.crossunder(close, zz_2) and - - pchg_above_filter and - pchg_below_filter and - vol_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - date_filter and - barstate.isconfirmed - -// Get Short Retracement Price -var short_break_price = float(na) -var short_break_bi = float(na) -if short_ret_cont_1 - short_break_price := zz_2 - short_break_bi := bi_2 - -// Short Condition 2 -bool short_ret_cont_2 = - ta.crossover(high, short_break_price) and - high[1] < short_break_price and - - pchg_above_filter and - pchg_below_filter and - vol_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - date_filter and - barstate.isconfirmed - -// Short Retracement Trigger -var short_break_current_state = 0 -short_break_previous_state = nz(short_break_current_state[1]) -short_break_current_state := short_break_previous_state == 2 ? 0 : short_break_previous_state -if short_ret_cont_1 and short_break_current_state == 0 - short_break_current_state := 1 -if short_ret_cont_2 and short_break_current_state == 1 - short_break_current_state := 2 - -bool short_ret_trigger = short_break_current_state == 2 ? true : false - -//___________________________ Short Retracement End - -//___________________________ Long Retracement Start - -// Long Retracement Start - -// Long Condition 1 -long_ret_cont_1 = - zz_1 < zz_2 and - zz_1 > zz_3 and - - zz_2 > zz_1 and - zz_2 > zz_3 and - - zz_3 < zz_2 and - zz_3 < zz_1 and - zz_3 < zz_4 and - zz_3 > zz_5 and - - zz_4 > zz_3 and - zz_4 < zz_2 and - zz_4 > zz_5 and - //zz_4 < zz_6 and - - zz_5 < zz_3 and - zz_5 < zz_4 and - zz_5 < zz_6 and - zz_5 < zz_7 and - - zz_6 > zz_5 and - //zz_6 > zz_4 and - zz_6 > zz_7 and - //zz_6 < zz_8 and - - zz_7 < zz_6 and - zz_7 > zz_5 and - zz_7 < zz_8 and - - //zz_8 > zz_7 and - //zz_8 > zz_6 and - - ta.crossover(close, zz_2) and - - pchg_above_filter and - pchg_below_filter and - vol_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - date_filter and - barstate.isconfirmed - -// Get Long Retracement Price in Long Condition -var long_break_price = float(na) -var long_break_bi = float(na) -if long_ret_cont_1 - long_break_price := zz_2 - long_break_bi := bi_2 - -// Long Condition 2 -bool long_ret_cont_2 = - ta.crossunder(low, long_break_price) and - low[1] > long_break_price and - pchg_above_filter and - pchg_below_filter and - vol_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - date_filter and - barstate.isconfirmed - -// Long Retracement Trigger -var long_break_current_state = 0 -long_break_previous_state = nz(long_break_current_state[1]) -long_break_current_state := long_break_previous_state == 2 ? 0 : long_break_previous_state -if long_ret_cont_1 and long_break_current_state == 0 - long_break_current_state := 1 -if long_ret_cont_2 and long_break_current_state == 1 - long_break_current_state := 2 - -long_ret_trigger = long_break_current_state == 2 ? true : false - -//___________________________ Long Retracement - -//_____________________________ Plot - -// Plot Break Signal -plotshape(series=i_scr_show_short and i_scr_choose == 'Mitigation Block' ? short_ret_cont_1 : na, title='Short Shift', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, textcolor=i_neg_light_color, size=size.tiny) -plotshape(series=i_scr_show_long and i_scr_choose == 'Mitigation Block' ? long_ret_cont_1 : na, title='Long Shift', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, textcolor=i_pos_light_color, size=size.tiny) -barcolor(color=i_scr_show_short and i_scr_choose == 'Mitigation Block' and short_ret_cont_1 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Mitigation Block' and long_ret_cont_1 ? i_pos_light_color : na, title='Shift Candle') - -//var box_array = array.new_box() -var line_array = array.new_line() - -if i_scr_show_short and short_ret_cont_1// and not short_ret_cont_0[1] - ph_box = box.new(left=int(bi_8), top=math.min(zz_8, zz_6, zz_4, zz_2), right=int(bi_0), bottom=zz_5, border_color=color.new(i_neg_color, i_zz_bx_transp), bgcolor=color.new(i_neg_color, i_zz_bx_transp)) - if i_scr_choose == 'Mitigation Block' - ph_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_neg_color, style=line.style_dashed) - //array.push(box_array, ph_box) - array.push(line_array, ph_line) - -if i_scr_show_long and long_ret_cont_1// and not long_ret_cont_0[1] - pl_box = box.new(left=int(bi_8), top=math.max(zz_8, zz_6, zz_4, zz_2), right=int(bi_0), bottom=zz_5, border_color=color.new(i_pos_color, i_zz_bx_transp), bgcolor=color.new(i_pos_color, i_zz_bx_transp)) - if i_scr_choose == 'Mitigation Block' - pl_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_pos_color, style=line.style_dashed) - //array.push(box_array, pl_box) - array.push(line_array, pl_line) - -// Plot Retracement Signal -plotchar(series=i_scr_show_short and i_scr_choose == 'Retracement' and short_ret_trigger ? 3 : na, title='Bear Retracement', char="↷", location=location.abovebar, color=i_neg_light_color, size=size.tiny) -plotchar(series=i_scr_show_long and i_scr_choose == 'Retracement' and long_ret_trigger ? 3 : na, title='Bull Retracement', char="⤻", location=location.belowbar, color=i_pos_light_color, size=size.tiny) -barcolor(color=i_scr_show_short and i_scr_choose == 'Retracement' and short_ret_trigger ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Retracement' and long_ret_trigger ? i_pos_light_color : na, title='Retracement Candle') - -//var line_array = array.new_line() - -if i_scr_show_short and i_scr_choose == 'Retracement' and short_ret_trigger// and not short_ret_trigger[1] - bull_ret_ln = line.new(x1=int(short_break_bi), y1=short_break_price, x2=bar_index, y2=short_break_price, color=i_neg_color, style=line.style_dotted) - array.push(line_array, bull_ret_ln) - -if i_scr_show_long and i_scr_choose == 'Retracement' and long_ret_trigger// and not long_ret_trigger[1] - bear_ret_ln = line.new(x1=int(long_break_bi), y1=long_break_price, x2=bar_index, y2=long_break_price, color=i_pos_color, style=line.style_dotted) - array.push(line_array, bear_ret_ln) - -//_____________________________ Zig Zag End - -//_____________________________ Data Table Start - -// To String -day_pchg_str = str.tostring(cum_pchg,"#.##") + ' %' -volume_pchg_str = str.tostring(cum_vol_pchg,"#.##") + ' %' -day_volume_str = str.tostring(current_cum_vol/100000,"#.##") + ' L' -prev_day_volume_str = str.tostring(prev_cum_vol/100000,"#.##") + ' L' - -// Color -bgcolor_1 = i_neu_dark_color -bgcolor_2 = i_neu_mid_color - -pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color -vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color -prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color - -// Plot Table -var table tbl_data = table.new(position=i_tbl_data_pos, columns=2, rows=4, border_width=1, force_overlay=true) - -if barstate.islast and i_tbl_data_show - table.cell(table_id=tbl_data, column=0, row=0, text="%Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=0, text=day_pchg_str, text_color=pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=1, text="Vol %Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=1, text=volume_pchg_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=2, text="Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=2, text=day_volume_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=3, text="PD Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=3, text=prev_day_volume_str, text_color=prev_vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - -//_____________________________ Data Table End - -//_____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_01, out_01] = feed(i_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), -[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), -[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), -[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), -[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), -[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), -[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), -[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), -[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), -[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) - -//_____________________________ Get Symbols for Screener End - -//_____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Choose Screening Method -short_cond = - i_scr_choose == 'Mitigation Block' ? short_ret_cont_1 : - short_ret_trigger - -long_cond = - i_scr_choose == 'Mitigation Block' ? long_ret_cont_1 : - long_ret_trigger - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - _cum_pchg = float(na) - _cum_vol_pchg = float(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Short Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_long and long_cond - signal := 1 - - // Check for Long Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_short and short_cond - signal := -1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - _cum_pchg := cum_pchg - _cum_vol_pchg := cum_vol_pchg - - [_time, price, _cum_pchg, _cum_vol_pchg, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 6, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - str_cum_pchg = str.tostring(_cum_pchg, '#.##') - str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) - -// Call Screener function for multiple symbols -screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), -screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), -screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), -screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), -screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), -screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_tbl_disp_rows - while matrix.rows(matrix) > i_scr_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table scr_tbl = table.new(position=i_scr_tbl_position, columns=5, rows=102, border_width=1, force_overlay=true) - -// Function to populate cells in the table -scr_cell_title(col, row, txt) => - table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor=i_neu_dark_color, text_size=i_scr_tbl_text_size) - -scr_cell(col, row, txt, _text_color, _bgcolor) => - table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign=text.align_left, bgcolor=_bgcolor, text_size=i_scr_tbl_text_size) - -// Check if it's the last bar -if barstate.islast and i_scr_show_table - // Clear existing data in the table - table.clear(scr_tbl, 0, 0, 2, 101) - - scr_cell_title(0, 0, i_scr_choose) - table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=4, end_row=0) - scr_cell_title(0, 1, "Symbol") - scr_cell_title(1, 1, "Time") - scr_cell_title(2, 1, "Price") - scr_cell_title(3, 1, "%Chg") - scr_cell_title(4, 1, "V %Chg") - - j = 4 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - - _textcolor = - matrix.get(matrix, i, 5) == "1" ? i_pos_color : - matrix.get(matrix, i, 5) == "-1" ? i_neg_color : i_neu_color - - _bg_color = - matrix.get(matrix, i, 5) == "1" ? i_pos_dark_color : - matrix.get(matrix, i, 5) == "-1" ? i_neg_dark_color : i_neu_color - - // Populate cells in the table - scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) - scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) - scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) - scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) - scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) - - j += 1 - -//_____________________________ Screener End - -//_____________________________ Code End \ No newline at end of file +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +indicator(title='ICT Mitigation Block Scanner', shorttitle='ICT MB Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) + +//_____________________________ Menu Screener Start + +g_scrtb = '█████████████████ Scanner █████████████████' + +string i_scr_choose = input.string(defval='Mitigation Block', title='Screening Method', options=['Mitigation Block', 'Retracement'], group=g_scrtb) + +tt_is = "• Reads only up to first 40 symbols." + + "\n• Total characters cannot exceed 4096." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ASHOKA,NSE:BEPL,NSE:BIOCON,NSE:BLS,NSE:CAMPUS,NSE:CASTROLIND,NSE:CESC,NSE:EDELWEISS,NSE:EMBDL,NSE:ENGINERSIN,NSE:EPL,NSE:FSL,NSE:GAEL,NSE:GREAVESCOT,BSE:GSPL,NSE:HFCL,NSE:HONASA,NSE:HUDCO,NSE:INDUSTOWER,NSE:INOXWIND,NSE:IOLCP,NSE:JAMNAAUTO,NSE:JMFINANCIL,NSE:JTLIND,NSE:KALAMANDIR,NSE:LTFOODS,NSE:LXCHEM,NSE:MARKSANS,NSE:NFL,NSE:NLCINDIA,NSE:ORIENTCEM,NSE:PPLPHARMA,NSE:RAIN,NSE:RELIGARE,NSE:SAMMAANCAP,NSE:SEQUENT,NSE:TI,NSE:TRIVENI,NSE:TVSSCS,NSE:ETERNAL", + title="Paste Symbols", tooltip=tt_is, group=g_scrtb) + +bool i_scr_show_table = input.bool(defval=true, title='Display Table', group=g_scrtb) +bool i_scr_show_long = input.bool(defval=true, title='Long Signals', inline='tb_2', group=g_scrtb) +bool i_scr_show_short = input.bool(defval=true, title='Short Signals', inline='tb_2', group=g_scrtb) + +int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) +string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) +string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) + +//_____________________________ Menu Screener End + +//_____________________________ Menu Zig Zag Start + +g_zz = '██████████████████ Zig Zag ██████████████████' + +bool i_zz_display = input.bool(defval=true, title='Display Zig Zag', group=g_zz) +int i_zz_period = input.int(defval=3, title='Zig Zag Length', minval=2, group=g_zz) +string i_zz_source = input.string(defval='High/Low', title='Source', options=['High/Low', 'Open/Close', 'Close'], group=g_zz) +color i_zz_bull_color = input.color(defval=#26A69A, title='Color Up', group=g_zz) +color i_zz_bear_color = input.color(defval=#FF5252, title='Color Down', group=g_zz) +int i_zz_bx_transp = input.int(defval=85, title='Box Transparency', minval=0, maxval=100, group=g_zz) + +//_____________________________ Menu Zig Zag End + +//_____________________________ Menu Additional Fiters Start + +g_af = '███████████████ Additional Fiters ███████████████' +tt_pchg = + "• If '% Change Above/Below +/-' is 4, it means relative volume is considered when the price change is above 4%." + + "\n• A value of 4% is positive for bullish scenarios and negative for bearish scenarios." + + "\n• The percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." +tt_vpchg = + "• If 'Volume % Change Above' is 0, it means Relative Volume is considered when today's volume is greater than the previous day's volume." + + "\n• For 'Screening Method' choice 'Retracement to EMA,' the 'Apply Volume % Change Filter' can be unchecked." + + "\n• A 'Volume % Change Above' 300% or more often indicates a major breakout, which may happen today or the next day." + + "\n• The volume percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." +tt_atr = + "• ATR helps filter out longer or more volatile signal candles." +tt_atr_mul = + "• Higher multiplier value filters a longer or more volatile signal candle." +tt_bf = + "• If the input is '80', it means the body covers over 80% of the candle." +tt_bs = + "• 2 means the candle is 2 times larger than the previous candle." +tt_vol = + "• Filter out a candle when its volume is greater than the SMA of the volume." +tt_rv = + "• Filter out a candle when its volume is greater than the Relative Volume." +tt_tf = + "• Filter out a signals between the given Time." +tt_df = + "• Filter out a signals on the given Date." + + "\n• This Time Filter is applicable only for 'Displacement Candles'." + +bool i_pchg_filter = input.bool(defval=false, title='Apply % Change Filter', tooltip=tt_pchg, group=g_af) +float i_pchg_above_below = input.float(defval=2, title='% Change Above/Below +/-', minval=0, group=g_af) + +bool i_vol_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vpchg, group=g_af) +int i_vol_above = input.int(defval=500000, title='Volume Above', minval=0, group=g_af) + +bool i_vol_pchg_filter = input.bool(defval=false, title='Apply Volume % Change Filter', tooltip=tt_vpchg, group=g_af) +float i_vol_pchg_above = input.float(defval=0, title='Volume % Change Above', minval=0, group=g_af) + +bool i_atr_filter = input.bool(defval=false, title='Apply ATR Filter', tooltip=tt_atr, group=g_af) +int i_atr_length = input.int(defval=14, minval=1, title='ATR Length', group=g_af) +float i_atr_multi = input.float(defval=1, title='ATR Multiplier', minval=1, group=g_af) + +bool i_body_filter = input.bool(defval=false, title='Apply Body % Filter', tooltip=tt_bf, group=g_af) +float i_body_percent = input.float(defval=60, title='Body % Above', minval=0, maxval=100, group=g_af) / 100 + +bool i_body_size_filter = input.bool(defval=false, title='Apply Body Size Filter', tooltip=tt_bs, group=g_af) +int i_body_size_multiplier = input.int(defval=2, title='Body Size Multiplier (x)', minval=0, group=g_af) + +bool i_volume_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vol, group=g_af) +int i_vol_sma_length = input.int(defval=20, minval=1, title='Volume SMA Length', group=g_af) + +bool i_rel_vol_filter = input.bool(defval=false, title='Apply FVG Retracement Filter', tooltip=tt_rv, group=g_af) +int i_rel_vol_avg_vol_len = input.int(defval=90, title='FVG Retracement Length', minval=2, group=g_af) +float i_rel_vol_avg_vol_multi = input.float(defval=5, title='Rel Vol SMA Multiplier', minval=0, group=g_af) + +bool i_time_filter = input.bool(defval=false, title='Apply Time Filter', tooltip=tt_tf, group=g_af) +int i_hour_1 = input.int(defval=9, minval=0, title='Time From', inline='t_1', group=g_af) +int i_minute_1 = input.int(defval=15, minval=0, title=':', inline='t_1', group=g_af) +int i_hour_2 = input.int(defval=10, minval=0, title='Time To ', inline='t_2', group=g_af) +int i_minute_2 = input.int(defval=15, minval=0, title=':', inline='t_2', group=g_af) + +bool i_date_filter = input.bool(defval=false, title='Apply Date Filter', tooltip=tt_df, group=g_af) +int i_day = input.int(defval=25, minval=1, maxval=31, title='Day', group=g_af) +int i_month = input.int(defval=10, minval=1, maxval=12, title='Month', group=g_af) +int i_year = input.int(defval=2024, minval=0, title='Year', group=g_af) + +//_____________________________ Menu Additional Fiters End + +//_____________________________ Menu Table Start + +g_dtb = '█████████████████ Data Table █████████████████' +bool i_tbl_data_show = input.bool(defval=true, title='Display Table', group=g_dtb) +string i_tbl_data_pos = input.string(defval=position.bottom_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_dtb) +string i_tbl_data_txt_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_dtb) + +//_____________________________ Menu Table End + +//_____________________________ Chart Settings Start + +g_ch = '███████████████ Chart Settings ███████████████' +color i_pos_dark_color = input.color(defval=#03110F, title='Positive Dark', group=g_ch) +color i_pos_color = input.color(defval=#26A69A, title='Positive Mid', group=g_ch) +color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) +color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) +color i_neg_color = input.color(defval=#FF5252, title='Negative Mid', group=g_ch) +color i_neg_dark_color = input.color(defval=#180809, title='Negative Dark', group=g_ch) +//color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) +//color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) +color i_neu_color = input.color(defval=#D1D4DC, title='Neutral Light', group=g_ch) +color i_neu_mid_color = input.color(defval=#2A2E39, title='Neutral Mid', group=g_ch) +color i_neu_dark_color = input.color(defval=#141516, title='Neutral Dark', group=g_ch) + +//_____________________________ Chart Settings End + +//_____________________________ Cumulative Percentage Change Start + +// Function to calculate Daily Cumulative Percentage Change of Close Price +cumulative_percentage_change() => + var float _cum_pct_change = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 + _cum_pct_change := _is_new_day ? _daily_pct_change : (na(_cum_pct_change) ? _daily_pct_change : (_cum_pct_change + _daily_pct_change)) + _cum_pct_change + +// Calculate current cumulative percentage change +cum_pchg = cumulative_percentage_change() + +//_____________________________ Cumulative Percentage Change End + +//_____________________________ Cumulative Volume Percentage Change Start + +// Function to calculate Daily Cumulative Volume +cumulative_volume() => + var float _cum_vol = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _cum_vol := _is_new_day ? volume : (na(_cum_vol) ? volume : (_cum_vol + volume)) + _cum_vol + +// Calculate current and previous day cumulative volumes +var float current_cum_vol = na +var float prev_cum_vol = na + +if ta.change(time('D')) != 0 + prev_cum_vol := current_cum_vol + current_cum_vol := volume +else + current_cum_vol += volume + +// Calculate Cumulative Volume Percentage Change +cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 + +//_____________________________ Cumulative Volume Percentage Change End + +//_____________________________ Additional Filters Start + +// % Change Filter +bool pchg_above_filter = true +bool pchg_below_filter = true +if i_pchg_filter + pchg_above_filter := cum_pchg > i_pchg_above_below + pchg_below_filter := cum_pchg < -i_pchg_above_below + +// Volume Filter +bool vol_filter = true +if i_vol_filter + vol_filter := current_cum_vol >= i_vol_above + +// Volume % Change Filter +bool vol_pchg_filter = true +if i_vol_pchg_filter + vol_pchg_filter := cum_vol_pchg >= i_vol_pchg_above + +// ATR Filter +bool atr_filter = true +if i_atr_filter + atr_filter := (high - low) > ta.atr(i_atr_length) * i_atr_multi + +// Body Percent Filter +bool body_filter = true +if i_body_filter + body_filter := (math.abs(close - open)) / (high - low) >= i_body_percent + +// Body Size Filter +bool body_size_filter = true +if i_body_size_filter + body_size_filter := (math.abs(close - open)) / (high - low) >= i_body_percent and (high - low) >= (high[1] - low[1]) * i_body_size_multiplier + +// Volume SMA Filter +bool volume_filter = true +if i_volume_filter + volume_filter := volume > ta.sma(volume, i_vol_sma_length) + +// FVG Retracement Filter +average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) +relative_volume = volume / average_volume[1] +rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi + +bool rel_vol_filter = true +if i_rel_vol_filter + rel_vol_filter := relative_volume > rel_vol_sma_multiplier + +// Time Filter +bool time_filter = true +if i_time_filter + time_filter := (hour > i_hour_1 or (hour == i_hour_1 and minute >= i_minute_1)) and (hour < i_hour_2 or (hour == i_hour_2 and minute < i_minute_2)) + +// Date Filter +bool date_filter = true +if i_date_filter + date_filter := (year == i_year and month == i_month and dayofmonth == i_day) + +//_____________________________ Additional Filters End + +//_____________________________ Zig Zag Start + +// Acknowledgement & Reference +// Trader: 'RozaniGhani-RG' +// Indicator Title: 'Zig Zag Ratio Simplified' +// Indicator Link: 'https://www.tradingview.com/script/CIk186OY-Zig-Zag-Ratio-Simplified/' + +//_____________________________ Get Source + +float _high = + i_zz_source == 'Open/Close' ? math.max(open, close) : + i_zz_source == 'Close' ? close : + high + +float _low = + i_zz_source == 'Open/Close' ? math.max(open, close) : + i_zz_source == 'Close' ? close : + low + +//============================== 1. Variables + +//_____________________________ 1.1 Highest / Lowest +float ph = ta.highestbars(_high, i_zz_period) == 0 ? _high : na +float pl = ta.lowestbars(_low, i_zz_period) == 0 ? _low : na + +//_____________________________ 1.2 Dir +var int dir = 0, dir := pl and na(ph) ? -1 : ph and na(pl) ? 1 : dir + +//_____________________________ 1.4 Array +var max_array_size = 18, var zigzag = array.new_float(0), oldzigzag = array.copy(zigzag) + +//_____________________________ 1.5 Others +var line line_zz = na + +//============================== 3. Custom Functions + +add_to_zigzag(float[] pointer, float value, int bindex) => + array.unshift(pointer, bindex) + array.unshift(pointer, value) + if array.size(pointer) > max_array_size + array.pop(pointer) + array.pop(pointer) + +update_zigzag(float[] pointer, float value, int bindex, int dir) => + if array.size(pointer) == 0 + add_to_zigzag(pointer, value, bindex) + else + if dir == 1 and value > array.get(pointer, 0) or dir == -1 and value < array.get(pointer, 0) + array.set(pointer, 0, value) + array.set(pointer, 1, bindex) + 0. + +//============================== 4. Calculations + +dirchanged = ta.change(dir) + +if ph or pl + if dirchanged + add_to_zigzag(zigzag, dir == 1 ? ph : pl, bar_index) + else + update_zigzag(zigzag, dir == 1 ? ph : pl, bar_index, dir) + +//============================== 5. Constructs + +if array.size(zigzag) >= 9 + if array.get(zigzag, 0) != array.get(oldzigzag, 0) or array.get(zigzag, 1) != array.get(oldzigzag, 1) + if array.get(zigzag, 2) == array.get(oldzigzag, 2) and array.get(zigzag, 3) == array.get(oldzigzag, 3) + line.delete(line_zz) + if i_zz_display + line_zz := line.new(x1 = math.round(array.get(zigzag, 1)), y1 = array.get(zigzag, 0), x2 = math.round(array.get(zigzag, 3)), y2 = array.get(zigzag, 2), color = dir == 1 ? i_zz_bull_color : i_zz_bear_color, width=1) + +//_____________________________ Get Swing Price & Bar Index + +zz_0 = array.size(zigzag) > 17 ? array.get(zigzag, array.size(zigzag) - 18) : na +bi_0 = array.size(zigzag) > 16 ? array.get(zigzag, array.size(zigzag) - 17) : na +zz_1 = array.size(zigzag) > 15 ? array.get(zigzag, array.size(zigzag) - 16) : na +bi_1 = array.size(zigzag) > 14 ? array.get(zigzag, array.size(zigzag) - 15) : na +zz_2 = array.size(zigzag) > 13 ? array.get(zigzag, array.size(zigzag) - 14) : na +bi_2 = array.size(zigzag) > 12 ? array.get(zigzag, array.size(zigzag) - 13) : na +zz_3 = array.size(zigzag) > 11 ? array.get(zigzag, array.size(zigzag) - 12) : na +//bi_3 = array.size(zigzag) > 10 ? array.get(zigzag, array.size(zigzag) - 11) : na +zz_4 = array.size(zigzag) > 9 ? array.get(zigzag, array.size(zigzag) - 10) : na +//bi_4 = array.size(zigzag) > 8 ? array.get(zigzag, array.size(zigzag) - 9) : na +zz_5 = array.size(zigzag) > 7 ? array.get(zigzag, array.size(zigzag) - 8) : na +//bi_5 = array.size(zigzag) > 6 ? array.get(zigzag, array.size(zigzag) - 7) : na +zz_6 = array.size(zigzag) > 5 ? array.get(zigzag, array.size(zigzag) - 6) : na +//bi_6 = array.size(zigzag) > 4 ? array.get(zigzag, array.size(zigzag) - 5) : na +zz_7 = array.size(zigzag) > 3 ? array.get(zigzag, array.size(zigzag) - 4) : na +//bi_7 = array.size(zigzag) > 2 ? array.get(zigzag, array.size(zigzag) - 3) : na +zz_8 = array.size(zigzag) > 1 ? array.get(zigzag, array.size(zigzag) - 2) : na +bi_8 = array.size(zigzag) > 0 ? array.get(zigzag, array.size(zigzag) - 1) : na + +// Create a single label for the last five zigzag values and their corresponding bar index +//label_text = str.tostring(zz_0) + "\n" + str.tostring(bi_0) + "\n" + str.tostring(zz_1) + "\n" + str.tostring(bi_1) + "\n" + str.tostring(zz_2) + +// "\n" + str.tostring(bi_2) + "\n" + str.tostring(zz_3) + "\n" + str.tostring(bi_3) + "\n" + str.tostring(zz_4) + "\n" + str.tostring(bi_4) +//if barstate.islast +// label.new(x = bar_index, y = high, text = label_text, color=color.white) + +//_____________________________ Retracement Signals Start + +// Short Retracement Start + +// Short Condition 1 +short_ret_cont_1 = + zz_1 > zz_2 and + zz_1 < zz_3 and + + zz_2 < zz_1 and + zz_2 < zz_3 and + + zz_3 > zz_2 and + zz_3 > zz_1 and + zz_3 > zz_4 and + zz_3 < zz_5 and + + zz_4 < zz_3 and + zz_4 > zz_2 and + zz_4 < zz_5 and + //zz_4 > zz_6 and + + zz_5 > zz_3 and + zz_5 > zz_4 and + zz_5 > zz_6 and + zz_5 > zz_7 and + + zz_6 < zz_5 and + //zz_6 < zz_4 and + zz_6 < zz_7 and + //zz_6 > zz_8 and + + zz_7 > zz_6 and + zz_7 < zz_5 and + zz_7 > zz_8 and + + //zz_8 < zz_7 and + //zz_8 < zz_6 and + + ta.crossunder(close, zz_2) and + + pchg_above_filter and + pchg_below_filter and + vol_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + date_filter and + barstate.isconfirmed + +// Get Short Retracement Price +var short_break_price = float(na) +var short_break_bi = float(na) +if short_ret_cont_1 + short_break_price := zz_2 + short_break_bi := bi_2 + +// Short Condition 2 +bool short_ret_cont_2 = + ta.crossover(high, short_break_price) and + high[1] < short_break_price and + + pchg_above_filter and + pchg_below_filter and + vol_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + date_filter and + barstate.isconfirmed + +// Short Retracement Trigger +var short_break_current_state = 0 +short_break_previous_state = nz(short_break_current_state[1]) +short_break_current_state := short_break_previous_state == 2 ? 0 : short_break_previous_state +if short_ret_cont_1 and short_break_current_state == 0 + short_break_current_state := 1 +if short_ret_cont_2 and short_break_current_state == 1 + short_break_current_state := 2 + +bool short_ret_trigger = short_break_current_state == 2 ? true : false + +//___________________________ Short Retracement End + +//___________________________ Long Retracement Start + +// Long Retracement Start + +// Long Condition 1 +long_ret_cont_1 = + zz_1 < zz_2 and + zz_1 > zz_3 and + + zz_2 > zz_1 and + zz_2 > zz_3 and + + zz_3 < zz_2 and + zz_3 < zz_1 and + zz_3 < zz_4 and + zz_3 > zz_5 and + + zz_4 > zz_3 and + zz_4 < zz_2 and + zz_4 > zz_5 and + //zz_4 < zz_6 and + + zz_5 < zz_3 and + zz_5 < zz_4 and + zz_5 < zz_6 and + zz_5 < zz_7 and + + zz_6 > zz_5 and + //zz_6 > zz_4 and + zz_6 > zz_7 and + //zz_6 < zz_8 and + + zz_7 < zz_6 and + zz_7 > zz_5 and + zz_7 < zz_8 and + + //zz_8 > zz_7 and + //zz_8 > zz_6 and + + ta.crossover(close, zz_2) and + + pchg_above_filter and + pchg_below_filter and + vol_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + date_filter and + barstate.isconfirmed + +// Get Long Retracement Price in Long Condition +var long_break_price = float(na) +var long_break_bi = float(na) +if long_ret_cont_1 + long_break_price := zz_2 + long_break_bi := bi_2 + +// Long Condition 2 +bool long_ret_cont_2 = + ta.crossunder(low, long_break_price) and + low[1] > long_break_price and + pchg_above_filter and + pchg_below_filter and + vol_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + date_filter and + barstate.isconfirmed + +// Long Retracement Trigger +var long_break_current_state = 0 +long_break_previous_state = nz(long_break_current_state[1]) +long_break_current_state := long_break_previous_state == 2 ? 0 : long_break_previous_state +if long_ret_cont_1 and long_break_current_state == 0 + long_break_current_state := 1 +if long_ret_cont_2 and long_break_current_state == 1 + long_break_current_state := 2 + +long_ret_trigger = long_break_current_state == 2 ? true : false + +//___________________________ Long Retracement + +//_____________________________ Plot + +// Plot Break Signal +plotshape(series=i_scr_show_short and i_scr_choose == 'Mitigation Block' ? short_ret_cont_1 : na, title='Short Shift', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, textcolor=i_neg_light_color, size=size.tiny) +plotshape(series=i_scr_show_long and i_scr_choose == 'Mitigation Block' ? long_ret_cont_1 : na, title='Long Shift', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, textcolor=i_pos_light_color, size=size.tiny) +barcolor(color=i_scr_show_short and i_scr_choose == 'Mitigation Block' and short_ret_cont_1 ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Mitigation Block' and long_ret_cont_1 ? i_pos_light_color : na, title='Shift Candle') + +//var box_array = array.new_box() +var line_array = array.new_line() + +if i_scr_show_short and short_ret_cont_1// and not short_ret_cont_0[1] + ph_box = box.new(left=int(bi_8), top=math.min(zz_8, zz_6, zz_4, zz_2), right=int(bi_0), bottom=zz_5, border_color=color.new(i_neg_color, i_zz_bx_transp), bgcolor=color.new(i_neg_color, i_zz_bx_transp)) + if i_scr_choose == 'Mitigation Block' + ph_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_neg_color, style=line.style_dashed) + //array.push(box_array, ph_box) + array.push(line_array, ph_line) + +if i_scr_show_long and long_ret_cont_1// and not long_ret_cont_0[1] + pl_box = box.new(left=int(bi_8), top=math.max(zz_8, zz_6, zz_4, zz_2), right=int(bi_0), bottom=zz_5, border_color=color.new(i_pos_color, i_zz_bx_transp), bgcolor=color.new(i_pos_color, i_zz_bx_transp)) + if i_scr_choose == 'Mitigation Block' + pl_line = line.new(x1=int(bi_2), y1=zz_2, x2=bar_index, y2=zz_2, color=i_pos_color, style=line.style_dashed) + //array.push(box_array, pl_box) + array.push(line_array, pl_line) + +// Plot Retracement Signal +plotchar(series=i_scr_show_short and i_scr_choose == 'Retracement' and short_ret_trigger ? 3 : na, title='Bear Retracement', char="↷", location=location.abovebar, color=i_neg_light_color, size=size.tiny) +plotchar(series=i_scr_show_long and i_scr_choose == 'Retracement' and long_ret_trigger ? 3 : na, title='Bull Retracement', char="⤻", location=location.belowbar, color=i_pos_light_color, size=size.tiny) +barcolor(color=i_scr_show_short and i_scr_choose == 'Retracement' and short_ret_trigger ? i_neg_light_color : i_scr_show_long and i_scr_choose == 'Retracement' and long_ret_trigger ? i_pos_light_color : na, title='Retracement Candle') + +//var line_array = array.new_line() + +if i_scr_show_short and i_scr_choose == 'Retracement' and short_ret_trigger// and not short_ret_trigger[1] + bull_ret_ln = line.new(x1=int(short_break_bi), y1=short_break_price, x2=bar_index, y2=short_break_price, color=i_neg_color, style=line.style_dotted) + array.push(line_array, bull_ret_ln) + +if i_scr_show_long and i_scr_choose == 'Retracement' and long_ret_trigger// and not long_ret_trigger[1] + bear_ret_ln = line.new(x1=int(long_break_bi), y1=long_break_price, x2=bar_index, y2=long_break_price, color=i_pos_color, style=line.style_dotted) + array.push(line_array, bear_ret_ln) + +//_____________________________ Zig Zag End + +//_____________________________ Data Table Start + +// To String +day_pchg_str = str.tostring(cum_pchg,"#.##") + ' %' +volume_pchg_str = str.tostring(cum_vol_pchg,"#.##") + ' %' +day_volume_str = str.tostring(current_cum_vol/100000,"#.##") + ' L' +prev_day_volume_str = str.tostring(prev_cum_vol/100000,"#.##") + ' L' + +// Color +bgcolor_1 = i_neu_dark_color +bgcolor_2 = i_neu_mid_color + +pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color +vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color +prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color + +// Plot Table +var table tbl_data = table.new(position=i_tbl_data_pos, columns=2, rows=4, border_width=1, force_overlay=true) + +if barstate.islast and i_tbl_data_show + table.cell(table_id=tbl_data, column=0, row=0, text="%Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=0, text=day_pchg_str, text_color=pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=1, text="Vol %Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=1, text=volume_pchg_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=2, text="Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=2, text=day_volume_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=3, text="PD Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=3, text=prev_day_volume_str, text_color=prev_vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + +//_____________________________ Data Table End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_01, out_01] = feed(effective_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), +[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), +[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), +[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), +[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), +[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), +[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), +[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), +[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), +[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) + +//_____________________________ Get Symbols for Screener End + +//_____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Choose Screening Method +short_cond = + i_scr_choose == 'Mitigation Block' ? short_ret_cont_1 : + short_ret_trigger + +long_cond = + i_scr_choose == 'Mitigation Block' ? long_ret_cont_1 : + long_ret_trigger + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + _cum_pchg = float(na) + _cum_vol_pchg = float(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Short Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_long and long_cond + signal := 1 + + // Check for Long Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_short and short_cond + signal := -1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + _cum_pchg := cum_pchg + _cum_vol_pchg := cum_vol_pchg + + [_time, price, _cum_pchg, _cum_vol_pchg, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 6, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) + +// Screener function to collect data +screener(s) => + [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + str_cum_pchg = str.tostring(_cum_pchg, '#.##') + str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) + +// Call Screener function for multiple symbols +screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), +screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), +screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), +screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), +screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), +screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_tbl_disp_rows + while matrix.rows(matrix) > i_scr_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table scr_tbl = table.new(position=i_scr_tbl_position, columns=5, rows=102, border_width=1, force_overlay=true) + +// Function to populate cells in the table +scr_cell_title(col, row, txt) => + table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor=i_neu_dark_color, text_size=i_scr_tbl_text_size) + +scr_cell(col, row, txt, _text_color, _bgcolor) => + table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign=text.align_left, bgcolor=_bgcolor, text_size=i_scr_tbl_text_size) + +// Check if it's the last bar +if barstate.islast and i_scr_show_table + // Clear existing data in the table + table.clear(scr_tbl, 0, 0, 2, 101) + + scr_cell_title(0, 0, i_scr_choose) + table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=4, end_row=0) + scr_cell_title(0, 1, "Symbol") + scr_cell_title(1, 1, "Time") + scr_cell_title(2, 1, "Price") + scr_cell_title(3, 1, "%Chg") + scr_cell_title(4, 1, "V %Chg") + + j = 4 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + + _textcolor = + matrix.get(matrix, i, 5) == "1" ? i_pos_color : + matrix.get(matrix, i, 5) == "-1" ? i_neg_color : i_neu_color + + _bg_color = + matrix.get(matrix, i, 5) == "1" ? i_pos_dark_color : + matrix.get(matrix, i, 5) == "-1" ? i_neg_dark_color : i_neu_color + + // Populate cells in the table + scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) + scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) + scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) + scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) + scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) + + j += 1 + +//_____________________________ Screener End + +//_____________________________ Code End + diff --git a/Momentum Setup - Ankush Bajaj Momentum Investing Setup/Momentum Setup - Ankush Bajaj Momentum Investing Setup with Scanner.txt b/Momentum Setup - Ankush Bajaj Momentum Investing Setup/Momentum Setup - Ankush Bajaj Momentum Investing Setup with Scanner.txt index 0378262..b310656 100644 --- a/Momentum Setup - Ankush Bajaj Momentum Investing Setup/Momentum Setup - Ankush Bajaj Momentum Investing Setup with Scanner.txt +++ b/Momentum Setup - Ankush Bajaj Momentum Investing Setup/Momentum Setup - Ankush Bajaj Momentum Investing Setup with Scanner.txt @@ -1,538 +1,762 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -indicator(title='Momentum Setup - Ankush Bajaj Momentum Investing Setup with Scanner', shorttitle='AB Mom Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) - -//_____________________________ Menu Screener Start - -g_scrtb = '██████████████████ Scanner ██████████████████' - -tt_is = - "• Reads only up to first 40 symbols." + - "\n• Total characters cannot exceed 4096." + - "\n• Use comma as delimiter without any space." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ABCAPITAL,NSE:ABFRL,NSE:AUROPHARMA,NSE:BANDHANBNK,NSE:BEL,NSE:BHEL,NSE:BPCL,NSE:BSOFT,NSE:COLPAL,NSE:CONCOR,NSE:CUB,NSE:DLF,NSE:EICHERMOT,NSE:GAIL,NSE:GNFC,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRANULES,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:IDEA,NSE:IGL,NSE:INDIACEM,NSE:INDUSTOWER,NSE:LAURUSLABS,NSE:MANAPPURAM,NSE:INDHOTEL,NSE:MUTHOOTFIN,NSE:NATIONALUM,NSE:NAUKRI,NSE:NMDC,NSE:OBEROIRLTY,NSE:PETRONET,NSE:PFC,NSE:RECLTD,NSE:SAIL,NSE:TATACHEM,NSE:VEDL,NSE:VOLTAS,NSE:ZEEL", - title="Paste Symbols", tooltip=tt_is, group=g_scrtb) - -string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_scrtb) -bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_scrtb) -bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_scrtb) - -int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) -string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) -string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) - -//_____________________________ Menu Screener End - -//_____________________________ Menu Indicators Start - -g_pchg = '██████████████ 250 Candle % Change ██████████████' -tt_pchg = - "• Calculate the % change between the past 250th candle and the current candle." + - "\n• For a bullish trend, the input value is considered positive; for a bearish trend, it's negative." + - "\n• The default value is 8 for daily timeframe. For intraday timeframes like 5 minutes, change it to 2 or 4 or adjust as needed for other timeframes." - -float i_pchg_250 = input.float(defval=8, title='Above/Below %', minval=0, tooltip=tt_pchg, group=g_pchg) - -g_rsi = '███████████ Relative Strength Index (RSI) ███████████' -bool i_rsi_display = input.bool(defval=true, title='Display', group=g_rsi) -int i_rsi_len = input.int(defval=14, title='RSI Length', minval=1, group=g_rsi) -int i_rsi_sma_len = input.int(defval=14, title='SMA Length', minval=1, group=g_rsi) -int i_rsi_ob = input.int(defval=60, title='Overbought', minval=0, maxval=100, group=g_rsi) -int i_rsi_os = input.int(defval=40, title='Oversold', minval=0, maxval=100, group=g_rsi) -float i_rsi_voffset = input.float(defval=1.3, title='Vertical Offset', step=0.1, group=g_rsi) -float i_rsi_height = input.float(defval=2, title='Height', step=0.1, group=g_rsi) - -g_mfi = '█████████████ Money Flow Index (MFI) █████████████' -bool i_mfi_display = input.bool(defval=true, title='Display', group=g_mfi) -int i_mfi_len = input.int(defval=14, title='MFI Length', minval=1, group=g_mfi) -int i_mfi_ob = input.int(defval=60, title='Overbought', minval=0, maxval=100, group=g_mfi) -int i_mfi_os = input.int(defval=40, title='Oversold', minval=0, maxval=100, group=g_mfi) -float i_mfi_voffset = input.float(defval=1.6, title='Vertical Offset', step=0.1, group=g_mfi)// 1.1 -float i_mfi_height = input.float(defval=1, title='Height', step=0.1, group=g_mfi)//1.0 - -g_cci = '██████████ Commodity Channel Index (CCI) ██████████' -bool i_cci_display = input.bool(defval=true, title='Display', group=g_cci) -int i_cci_len = input.int(defval=20, title='CCI Length', minval=1, group=g_cci) -int i_cci_sma_len = input.int(defval=5, title='SMA Length', minval=1, group=g_cci) -int i_cci_ob = input.int(defval=100, title='Overbought', minval=0, group=g_cci) -int i_cci_os = input.int(defval=-100, title='Oversold', maxval=0, group=g_cci) -float i_cci_voffset = input.float(defval=1.8, title='Vertical Offset', step=0.1, group=g_cci) -float i_cci_height = input.float(defval=0.2, title='Height', step=0.1, group=g_cci) - -g_vol = '██████████████████ Volume ██████████████████' -tt_vm = - "• The value shifts the volume moving average upward." + - "\n• The default value of 1 means no multiplier is applied, but a multiplier of 5 indicates higher volume according to the strategy." - -bool i_vol_display = input.bool(defval=true, title='Display', inline='VOL', group=g_vol) -string i_vol_type = input.string(defval='Regular Volume', title='Type', options=['Buying/Selling Volume', 'Regular Volume', 'None'], group=g_vol) -int i_vol_ma_len = input.int(defval=20, title='MA Length', minval=1, group=g_vol) -float i_vol_ma_multi = input.float(defval=5, title='MA Multiplier (x)', minval=1, tooltip=tt_vm, group=g_vol) -i_vol_hoffset = 0 -float i_vol_voffset = input.float(defval=0.3, title='Vertical Offset', step=0.1, group=g_vol) -float i_vol_height = input.float(defval=0.6, title='Height', step=0.1, group=g_vol) - -g_st = '█████████████████ Supertrend █████████████████' -bool i_st_display = input.bool(defval=true, title='Display', group=g_st) -int i_st_atr_period = input.int(defval=10, title="ATR Length", minval=1, group=g_st) -float i_st_factor = input.float(defval=3.0, title="Factor", minval=0.01, step=0.01, group=g_st) - -//_____________________________ Menu Indicators End - -//_____________________________ Menu Table Start - -g_tb = '███████████████████ Table ███████████████████' -string i_tbl_position = input.string(defval=position.top_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) -string i_tbl_text_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) - -//_____________________________ Menu Table End - -//_____________________________ Chart Settings Start - -g_ch = '████████████████ Chart Settings ████████████████' -int i_display_len = input.int(defval=50, title='Display Length', minval=1, group=g_ch) -color i_pos_col = input.color(defval=#26A69A, title='Positive', group=g_ch) -color i_pos_light_col = input.color(defval=#B2DFDB, title='Positive Light', group=g_ch) -color i_neg_light_col = input.color(defval=#FFCDD2, title='Negative Light', group=g_ch) -color i_neg_col = input.color(defval=#FF5250, title='Negative', group=g_ch) -color i_indicator_col = input.color(defval=#2962FF, title='Indicator', group=g_ch) -color i_signal_col = input.color(defval=#FF6D00, title='Signal', group=g_ch) -color i_neu_col = input.color(defval=#787B86, title='Neutral', group=g_ch) - -//_____________________________ Chart Settings End - -//_____________________________ 1. Percentage Change 250 Start - -float pchg = (ta.change(close, 250) / close) * 100 - -//_____________________________ 1. Percentage Change 250 end - -//_____________________________ 2. RSI Start - -float rsi = ta.rsi(close, i_rsi_len) -float rsi_sma = ta.sma(rsi, i_rsi_sma_len) - -//_____________________________ 2. RSI End - -//_____________________________ 3. MFI Start - -float mfi = ta.mfi(hlc3, i_mfi_len) - -//_____________________________ 3. MFI End - -//_____________________________ 4. CCI Start - -float cci = ta.cci(hlc3, i_cci_len) -float cci_sma = ta.sma(cci, i_cci_sma_len) - -//_____________________________ 4. CCI End - -//_____________________________ 5. Volume: 20 SMA Start - -vol_sma = ta.ema(volume, i_vol_ma_len) * i_vol_ma_multi - -//_____________________________ 5. Volume: 20 SMA End - -//_____________________________ 6. Supertrend Start - -[supertrend, direction] = ta.supertrend(i_st_factor, i_st_atr_period) - -supertrend := i_st_display and barstate.isfirst ? na : supertrend -upTrend = plot(series=i_st_display and direction < 0 ? supertrend : na, title="Supertrend Up", color=i_pos_col, style=plot.style_linebr) -downTrend = plot(series=i_st_display and direction < 0 ? na : supertrend, title="Supertrend Down", color=i_neg_col, style=plot.style_linebr) -bodyMiddle = plot(series=i_st_display and barstate.isfirst ? na : (open + close) / 2, title="Body Middle", display=display.none) - -//fill(plot1=bodyMiddle, plot2=upTrend, color=color.new(i_pos_col, 90), fillgaps=false) -//fill(plot1=bodyMiddle, plot2=downTrend, color=color.new(i_neg_col, 90), fillgaps=false) - -//_____________________________ 6. Supertrend End - -//_____________________________ Signals Start - -// Condition -short_cont = - //ta.crossunder(pchg, (-i_pchg_250)) and - pchg < (-i_pchg_250) and - rsi < i_rsi_os and - mfi < i_mfi_os and - cci < i_cci_os and - volume > vol_sma and - barstate.isconfirmed - -long_cont = - //ta.crossover(pchg, i_pchg_250) and - pchg > i_pchg_250 and - rsi > i_rsi_ob and - mfi > i_mfi_ob and - cci > i_cci_ob and - volume > vol_sma and - barstate.isconfirmed - -// Plot -plotshape(series=short_cont, title='Short Signal', style=shape.triangledown, location=location.abovebar, color=i_neg_light_col, size=size.tiny) -plotshape(series=long_cont, title='Long Signal', style=shape.triangleup, location=location.belowbar, color=i_pos_light_col, size=size.tiny) - -bgcolor(color=short_cont ? color.new(i_neg_light_col, 90) : long_cont ? color.new(i_pos_light_col, 90) : na, title='Signal Bgcolor', show_last=i_display_len) -barcolor(color=short_cont ? i_neg_light_col : long_cont ? i_pos_light_col : na, title='Signal Candle') - -//_____________________________ Signals End - -//_____________________________ Overlay Charts Start - -// Acknowledgement & Reference -// Trader: 'dgtrd' -// Indicator Title: 'Technical Analyst by DGT' -// Indicator Link: 'https://www.tradingview.com/script/r2kuEi0l-Technical-Analyst-by-DGT/' - -// Functions ----------------------------------------------------------------------------------- // - -f_drawLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) => - var id = label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) - label.set_text(id, _text) - label.set_tooltip(id, _tooltip) - label.set_xy(id, _x, _y) - label.set_textcolor(id, _textcolor) - -// -Calculations ================================================================================ // - -source = close -nzVolume = nz(volume) - -//------------------------------------------------------------------------------ -// Volume - -//vol_sma = ta.sma(nzVolume, i_vol_ma_len) - -B = nzVolume * (close - low) / (high - low) -S = nzVolume * (high - close) / (high - low) - -// Draw Charts -var a_lines = array.new_line() -var a_hist = array.new_box() - -//i_display_len = 50 -priceHighest = ta.highest(high, i_display_len) -priceLowest = ta.lowest (low , i_display_len) -priceChangeRate = (priceHighest - priceLowest) / priceHighest - -oscHighest = 100//ta.highest(osc, i_display_len) - -volumeMARate = nzVolume / vol_sma -volumeHighest = ta.highest(nzVolume, i_display_len) -bullCandle = close > open - -if barstate.islast - if array.size(a_lines) > 0 - for i = 1 to array.size(a_lines) - line.delete(array.shift(a_lines)) - - if array.size(a_hist) > 0 - for i = 1 to array.size(a_hist) - box.delete(array.shift(a_hist)) - - if i_mfi_display - mid_line = math.avg(100, 0) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_ob / oscHighest * priceChangeRate * i_mfi_height), - bar_index , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_ob / oscHighest * priceChangeRate * i_mfi_height), color.new(i_pos_col, 75), 1)) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_mfi_height), - bar_index , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_mfi_height), color.new(i_neu_col, 75), 1)) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_os / oscHighest * priceChangeRate * i_mfi_height), - bar_index , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_os / oscHighest * priceChangeRate * i_mfi_height), color.new(i_neg_col, 75), 1)) - f_drawLabelX( bar_index + 3 , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_mfi_height), 'MFI', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, str.tostring(mfi, '#.##')) - - if i_rsi_display - mid_line = math.avg(100, 0) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_ob / oscHighest * priceChangeRate * i_rsi_height), - bar_index , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_ob / oscHighest * priceChangeRate * i_rsi_height), color.new(i_pos_col, 75), 1)) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_rsi_height), - bar_index , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_rsi_height), color.new(i_neu_col, 75), 1)) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_os / oscHighest * priceChangeRate * i_rsi_height), - bar_index , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_os / oscHighest * priceChangeRate * i_rsi_height), color.new(i_neg_col, 75), 1)) - f_drawLabelX( bar_index + 3 , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_rsi_height), 'RSI', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, str.tostring(rsi, '#.##')) - - if i_cci_display - mid_line = math.avg(100, 0) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_ob / oscHighest * priceChangeRate * i_cci_height), - bar_index , priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_ob / oscHighest * priceChangeRate * i_cci_height), color.new(i_pos_col, 75), 1)) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_cci_voffset), - bar_index , priceLowest * (1 - priceChangeRate * i_cci_voffset), color.new(i_neu_col, 75), 1)) - array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_os / oscHighest * priceChangeRate * i_cci_height), - bar_index , priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_os / oscHighest * priceChangeRate * i_cci_height), color.new(i_neg_col, 75), 1)) - f_drawLabelX( bar_index + 3 , priceLowest * (1 - priceChangeRate * i_cci_voffset), 'CCI', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, str.tostring(cci, '#.##')) - - if i_vol_type != 'None' - f_drawLabelX( bar_index + 3 , priceHighest * (1 + priceChangeRate * i_vol_voffset), 'VOL', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, 'Buy Vol : ' + str.tostring(B / (B + S) * 100, '#.##') + '%\nSell Vol : ' + str.tostring(S / (B + S) * 100, '#.##') + '%\nLast Vol : ' + str.tostring(nzVolume, format.volume) + '\nAvg Vol : ' + str.tostring(vol_sma, format.volume)) - - for barIndex = 0 to i_display_len - 1 - if array.size(a_lines) < 500 - - if i_mfi_display - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mfi[barIndex] / oscHighest * priceChangeRate * i_mfi_height), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mfi[barIndex + 1] / oscHighest * priceChangeRate * i_mfi_height), xloc.bar_index, extend.none, i_indicator_col , line.style_solid, 1)) - - if i_rsi_display - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi[barIndex] / oscHighest * priceChangeRate * i_rsi_height), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi[barIndex + 1] / oscHighest * priceChangeRate * i_rsi_height), xloc.bar_index, extend.none, i_indicator_col , line.style_solid, 1)) - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi_sma[barIndex] / oscHighest * priceChangeRate * i_rsi_height), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi_sma[barIndex + 1] / oscHighest * priceChangeRate * i_rsi_height), xloc.bar_index, extend.none, i_signal_col , line.style_solid, 1)) - - if i_cci_display - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci[barIndex] / oscHighest * priceChangeRate * i_cci_height), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci[barIndex + 1] / oscHighest * priceChangeRate * i_cci_height), xloc.bar_index, extend.none, i_indicator_col , line.style_solid, 1)) - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci_sma[barIndex] / oscHighest * priceChangeRate * i_cci_height), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci_sma[barIndex + 1] / oscHighest * priceChangeRate * i_cci_height), xloc.bar_index, extend.none, i_signal_col , line.style_solid, 1)) - - if nzVolume - if i_vol_type != 'None' - array.push(a_hist, box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), - bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height), i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_col, 0) : bullCandle[barIndex] ? color.new(i_pos_col, 0) : color.new(i_neg_col, 0), 2, bgcolor = i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_col, 0) : bullCandle[barIndex] ? color.new(i_pos_col, 0) : color.new(i_neg_col, 0))) - if i_vol_type == 'Buying/Selling Volume' - array.push(a_hist, box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), - bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + S[barIndex] / volumeHighest * priceChangeRate * i_vol_height), color.new(i_neg_col, 0), 2, bgcolor = color.new(i_neg_col, 0))) - // Voumme MA - if i_vol_display - array.push(a_lines, line.new(bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex]), - bar_index[barIndex + 1] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex + 1] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex + 1]), xloc.bar_index, extend.none, i_neu_col, line.style_solid, 1)) - -//_____________________________ Overlay Charts End - -//_____________________________ Overlay Charts Table Start - -var table tbl = table.new(position=i_tbl_position, columns=2, rows=5, border_width=2) - -// Color -col_pchg = pchg > i_pchg_250 ? i_pos_col : pchg < (-i_pchg_250) ? i_neg_col : i_neu_col -col_rsi = rsi > i_rsi_ob ? i_pos_col : rsi < i_rsi_os ? i_neg_col : i_neu_col -col_mfi = mfi > i_mfi_ob ? i_pos_col : mfi < i_mfi_os ? i_neg_col : i_neu_col -col_cci = cci > i_cci_ob ? i_pos_col : cci < i_cci_os ? i_neg_col : i_neu_col -col_vol = volume > vol_sma ? i_pos_col : i_neu_col - -// Function to populate cells in the table -cell(int column, int row, string txt, color color) => - table.cell(tbl, column, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) - -// Check if it's the last bar -if barstate.islast - cell(0, 0, "%Chg", col_pchg) - cell(0, 1, "RSI", col_rsi) - cell(0, 2, "MFI", col_mfi) - cell(0, 3, "CCI", col_cci) - cell(0, 4, "Vol", col_vol) - - cell(1, 0, str.tostring(pchg, '#.##'), col_pchg) - cell(1, 1, str.tostring(rsi, '#.##'), col_rsi) - cell(1, 2, str.tostring(mfi, '#.##'), col_mfi) - cell(1, 3, str.tostring(cci, '#.##'), col_cci) - cell(1, 4, str.tostring((volume / 100000), '#.##') + ' L', col_vol) - -//_____________________________ Overlay Charts Table Start - -//_____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_001, out_001] = feed(i_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), -[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), -[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), -[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), -[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), -[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), -[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), -[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), -[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), -[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038)//, [tid_040, out_040] = feed(out_039) - -//_____________________________ Get Symbols for Screener End - -//_____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Screener Conditions -bearish_cond = short_cont -bullish_cond = long_cont - -// Define Bull and Bear Conditions -bull = not(i_scr_direction == "Bearish") -bear = not(i_scr_direction == "Bullish") - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_bull and bearish_cond and bear - signal := -1 - - // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_bear and bullish_cond and bull - signal := 1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - - [_time, price, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 4, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, price, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, price, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, strPrice, strSignal) - -// Call Screener function for multiple symbols -screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), -screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), -screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), -screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), -screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), -screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039)//, screener(tid_040) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_tbl_disp_rows - while matrix.rows(matrix) > i_scr_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table scr_tbl = table.new(position=i_scr_tbl_position, columns=3, rows=102, border_width=1) - -// Function to populate cells in the table -scr_cell_title(col, row, txt) => - table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_col, text_halign=text.align_center, bgcolor = color.new(i_neu_col, 90), text_size=i_scr_tbl_text_size) - -scr_cell(col, row, txt, color) => - table.cell(scr_tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_scr_tbl_text_size) - -// Check if it's the last bar -if barstate.islast - // Clear existing data in the table - table.clear(scr_tbl, 0, 0, 2, 101) - - scr_cell_title(0, 0, 'Momentum Investing') - table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=2, end_row=0) - scr_cell_title(0, 1, "Symbol") - scr_cell_title(1, 1, "Time") - scr_cell_title(2, 1, "Price") - - j = 2 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - col = matrix.get(matrix, i, 3) == "1" ? i_pos_col : - matrix.get(matrix, i, 3) == "-1" ? i_neg_col : i_neu_col - - // Populate cells in the table - scr_cell(0, j, matrix.get(matrix, i, 0), col) - scr_cell(1, j, matrix.get(matrix, i, 1), col) - scr_cell(2, j, matrix.get(matrix, i, 2), col) - - j += 1 - -//_____________________________ Screener End - -//_____________________________ Code End - -// Readme First: -// -// About: -// This is a Momentum Investing Strategy Setup shared by trader Ankush Bajaj. -// The original video is based on the daily timeframe for long-term investment. -// This strategy can also be adapted for lower timeframes. -// To adapted the strategy for lower timeframes like 5 minutes, change the 'Above/Below %' to 2 or 4 or adjust as needed according your timeframe. -// Example: For 5 min timeframe use 'Above/Below %' as 2. For 1hr timeframe use 'Above/Below %' as 4. -// Also adjust the 'MA Multiplier (x)' value. Default is 5x. This can be adjusted to 2 times, 3 times etc. -// -// Strategy Reference Video: -// Video Title: "Momentum Investing Strategies | Understand Different Types of Momentum Strategies | Ep 141" -// Video Link: https://www.youtube.com/watch?v=-uEEmnFtDIw -// Video Title: "Momentum Investing using Technical Indicators | Ep 142 | Samco Securities" -// Video Link: https://www.youtube.com/watch?v=zmpsx7BpzvU&t=1154s -// -// Strategy Type: Momentum -// Bias: Strongly Directional -// Trading Style: Investment -// Instrument: Any -// Original Symbol: Any -// Timeframe: Daily (default) -// -// Indicator Used and Settings: -// 1. % Change of last 250 candle -// 2. RSI 14 -// 3. MFI 14 -// 4. CCI 20 -// 5. Volume 20 EMA -// -// Long Entry Rules (As per the video): -// - Daily Timeframe -// - % Change of 250 Candle > 8 -// - RSI above 60 -// - MFI above 60 -// - CCI above 100 -// - Volume > EMA 20 of Volume * 5 -// - Market Cap > 1000 Crore -// - Price > Rs.50 -// -// Short Entry Rules (Not mentioned in the video): -// - Daily Timeframe -// - % Change of 250 Candle < -8 -// - RSI below 40 -// - MFI below 40 -// - CCI below -100 -// - Volume > EMA 20 of Volume * 5 -// - Market Cap > 1000 Crore -// - Price > Rs.50 \ No newline at end of file +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +indicator(title='Momentum Setup - Ankush Bajaj Momentum Investing Setup with Scanner', shorttitle='AB Mom Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) + +//_____________________________ Menu Screener Start + +g_scrtb = '██████████████████ Scanner ██████████████████' + +tt_is = + "• Reads only up to first 40 symbols." + + "\n• Total characters cannot exceed 4096." + + "\n• Use comma as delimiter without any space." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ABCAPITAL,NSE:ABFRL,NSE:AUROPHARMA,NSE:BANDHANBNK,NSE:BEL,NSE:BHEL,NSE:BPCL,NSE:BSOFT,NSE:COLPAL,NSE:CONCOR,NSE:CUB,NSE:DLF,NSE:EICHERMOT,NSE:GAIL,NSE:GNFC,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRANULES,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:IDEA,NSE:IGL,NSE:INDIACEM,NSE:INDUSTOWER,NSE:LAURUSLABS,NSE:MANAPPURAM,NSE:INDHOTEL,NSE:MUTHOOTFIN,NSE:NATIONALUM,NSE:NAUKRI,NSE:NMDC,NSE:OBEROIRLTY,NSE:PETRONET,NSE:PFC,NSE:RECLTD,NSE:SAIL,NSE:TATACHEM,NSE:VEDL,NSE:VOLTAS,NSE:ZEEL", + title="Paste Symbols", tooltip=tt_is, group=g_scrtb) + +string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_scrtb) +bool i_scr_show_bull = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_scrtb) +bool i_scr_show_bear = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_scrtb) + +int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) +string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) +string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) + +//_____________________________ Menu Screener End + +//_____________________________ Menu Indicators Start + +g_pchg = '██████████████ 250 Candle % Change ██████████████' +tt_pchg = + "• Calculate the % change between the past 250th candle and the current candle." + + "\n• For a bullish trend, the input value is considered positive; for a bearish trend, it's negative." + + "\n• The default value is 8 for daily timeframe. For intraday timeframes like 5 minutes, change it to 2 or 4 or adjust as needed for other timeframes." + +float i_pchg_250 = input.float(defval=8, title='Above/Below %', minval=0, tooltip=tt_pchg, group=g_pchg) + +g_rsi = '███████████ Relative Strength Index (RSI) ███████████' +bool i_rsi_display = input.bool(defval=true, title='Display', group=g_rsi) +int i_rsi_len = input.int(defval=14, title='RSI Length', minval=1, group=g_rsi) +int i_rsi_sma_len = input.int(defval=14, title='SMA Length', minval=1, group=g_rsi) +int i_rsi_ob = input.int(defval=60, title='Overbought', minval=0, maxval=100, group=g_rsi) +int i_rsi_os = input.int(defval=40, title='Oversold', minval=0, maxval=100, group=g_rsi) +float i_rsi_voffset = input.float(defval=1.3, title='Vertical Offset', step=0.1, group=g_rsi) +float i_rsi_height = input.float(defval=2, title='Height', step=0.1, group=g_rsi) + +g_mfi = '█████████████ Money Flow Index (MFI) █████████████' +bool i_mfi_display = input.bool(defval=true, title='Display', group=g_mfi) +int i_mfi_len = input.int(defval=14, title='MFI Length', minval=1, group=g_mfi) +int i_mfi_ob = input.int(defval=60, title='Overbought', minval=0, maxval=100, group=g_mfi) +int i_mfi_os = input.int(defval=40, title='Oversold', minval=0, maxval=100, group=g_mfi) +float i_mfi_voffset = input.float(defval=1.6, title='Vertical Offset', step=0.1, group=g_mfi)// 1.1 +float i_mfi_height = input.float(defval=1, title='Height', step=0.1, group=g_mfi)//1.0 + +g_cci = '██████████ Commodity Channel Index (CCI) ██████████' +bool i_cci_display = input.bool(defval=true, title='Display', group=g_cci) +int i_cci_len = input.int(defval=20, title='CCI Length', minval=1, group=g_cci) +int i_cci_sma_len = input.int(defval=5, title='SMA Length', minval=1, group=g_cci) +int i_cci_ob = input.int(defval=100, title='Overbought', minval=0, group=g_cci) +int i_cci_os = input.int(defval=-100, title='Oversold', maxval=0, group=g_cci) +float i_cci_voffset = input.float(defval=1.8, title='Vertical Offset', step=0.1, group=g_cci) +float i_cci_height = input.float(defval=0.2, title='Height', step=0.1, group=g_cci) + +g_vol = '██████████████████ Volume ██████████████████' +tt_vm = + "• The value shifts the volume moving average upward." + + "\n• The default value of 1 means no multiplier is applied, but a multiplier of 5 indicates higher volume according to the strategy." + +bool i_vol_display = input.bool(defval=true, title='Display', inline='VOL', group=g_vol) +string i_vol_type = input.string(defval='Regular Volume', title='Type', options=['Buying/Selling Volume', 'Regular Volume', 'None'], group=g_vol) +int i_vol_ma_len = input.int(defval=20, title='MA Length', minval=1, group=g_vol) +float i_vol_ma_multi = input.float(defval=5, title='MA Multiplier (x)', minval=1, tooltip=tt_vm, group=g_vol) +i_vol_hoffset = 0 +float i_vol_voffset = input.float(defval=0.3, title='Vertical Offset', step=0.1, group=g_vol) +float i_vol_height = input.float(defval=0.6, title='Height', step=0.1, group=g_vol) + +g_st = '█████████████████ Supertrend █████████████████' +bool i_st_display = input.bool(defval=true, title='Display', group=g_st) +int i_st_atr_period = input.int(defval=10, title="ATR Length", minval=1, group=g_st) +float i_st_factor = input.float(defval=3.0, title="Factor", minval=0.01, step=0.01, group=g_st) + +//_____________________________ Menu Indicators End + +//_____________________________ Menu Table Start + +g_tb = '███████████████████ Table ███████████████████' +string i_tbl_position = input.string(defval=position.top_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) +string i_tbl_text_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) + +//_____________________________ Menu Table End + +//_____________________________ Chart Settings Start + +g_ch = '████████████████ Chart Settings ████████████████' +int i_display_len = input.int(defval=50, title='Display Length', minval=1, group=g_ch) +color i_pos_col = input.color(defval=#26A69A, title='Positive', group=g_ch) +color i_pos_light_col = input.color(defval=#B2DFDB, title='Positive Light', group=g_ch) +color i_neg_light_col = input.color(defval=#FFCDD2, title='Negative Light', group=g_ch) +color i_neg_col = input.color(defval=#FF5250, title='Negative', group=g_ch) +color i_indicator_col = input.color(defval=#2962FF, title='Indicator', group=g_ch) +color i_signal_col = input.color(defval=#FF6D00, title='Signal', group=g_ch) +color i_neu_col = input.color(defval=#787B86, title='Neutral', group=g_ch) + +//_____________________________ Chart Settings End + +//_____________________________ 1. Percentage Change 250 Start + +float pchg = (ta.change(close, 250) / close) * 100 + +//_____________________________ 1. Percentage Change 250 end + +//_____________________________ 2. RSI Start + +float rsi = ta.rsi(close, i_rsi_len) +float rsi_sma = ta.sma(rsi, i_rsi_sma_len) + +//_____________________________ 2. RSI End + +//_____________________________ 3. MFI Start + +float mfi = ta.mfi(hlc3, i_mfi_len) + +//_____________________________ 3. MFI End + +//_____________________________ 4. CCI Start + +float cci = ta.cci(hlc3, i_cci_len) +float cci_sma = ta.sma(cci, i_cci_sma_len) + +//_____________________________ 4. CCI End + +//_____________________________ 5. Volume: 20 SMA Start + +vol_sma = ta.ema(volume, i_vol_ma_len) * i_vol_ma_multi + +//_____________________________ 5. Volume: 20 SMA End + +//_____________________________ 6. Supertrend Start + +[supertrend, direction] = ta.supertrend(i_st_factor, i_st_atr_period) + +supertrend := i_st_display and barstate.isfirst ? na : supertrend +upTrend = plot(series=i_st_display and direction < 0 ? supertrend : na, title="Supertrend Up", color=i_pos_col, style=plot.style_linebr) +downTrend = plot(series=i_st_display and direction < 0 ? na : supertrend, title="Supertrend Down", color=i_neg_col, style=plot.style_linebr) +bodyMiddle = plot(series=i_st_display and barstate.isfirst ? na : (open + close) / 2, title="Body Middle", display=display.none) + +//fill(plot1=bodyMiddle, plot2=upTrend, color=color.new(i_pos_col, 90), fillgaps=false) +//fill(plot1=bodyMiddle, plot2=downTrend, color=color.new(i_neg_col, 90), fillgaps=false) + +//_____________________________ 6. Supertrend End + +//_____________________________ Signals Start + +// Condition +short_cont = + //ta.crossunder(pchg, (-i_pchg_250)) and + pchg < (-i_pchg_250) and + rsi < i_rsi_os and + mfi < i_mfi_os and + cci < i_cci_os and + volume > vol_sma and + barstate.isconfirmed + +long_cont = + //ta.crossover(pchg, i_pchg_250) and + pchg > i_pchg_250 and + rsi > i_rsi_ob and + mfi > i_mfi_ob and + cci > i_cci_ob and + volume > vol_sma and + barstate.isconfirmed + +// Plot +plotshape(series=short_cont, title='Short Signal', style=shape.triangledown, location=location.abovebar, color=i_neg_light_col, size=size.tiny) +plotshape(series=long_cont, title='Long Signal', style=shape.triangleup, location=location.belowbar, color=i_pos_light_col, size=size.tiny) + +bgcolor(color=short_cont ? color.new(i_neg_light_col, 90) : long_cont ? color.new(i_pos_light_col, 90) : na, title='Signal Bgcolor', show_last=i_display_len) +barcolor(color=short_cont ? i_neg_light_col : long_cont ? i_pos_light_col : na, title='Signal Candle') + +//_____________________________ Signals End + +//_____________________________ Overlay Charts Start + +// Acknowledgement & Reference +// Trader: 'dgtrd' +// Indicator Title: 'Technical Analyst by DGT' +// Indicator Link: 'https://www.tradingview.com/script/r2kuEi0l-Technical-Analyst-by-DGT/' + +// Functions ----------------------------------------------------------------------------------- // + +f_drawLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) => + var id = label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) + label.set_text(id, _text) + label.set_tooltip(id, _tooltip) + label.set_xy(id, _x, _y) + label.set_textcolor(id, _textcolor) + +// -Calculations ================================================================================ // + +source = close +nzVolume = nz(volume) + +//------------------------------------------------------------------------------ +// Volume + +//vol_sma = ta.sma(nzVolume, i_vol_ma_len) + +B = nzVolume * (close - low) / (high - low) +S = nzVolume * (high - close) / (high - low) + +// Draw Charts +var a_lines = array.new_line() +var a_hist = array.new_box() + +//i_display_len = 50 +priceHighest = ta.highest(high, i_display_len) +priceLowest = ta.lowest (low , i_display_len) +priceChangeRate = (priceHighest - priceLowest) / priceHighest + +oscHighest = 100//ta.highest(osc, i_display_len) + +volumeMARate = nzVolume / vol_sma +volumeHighest = ta.highest(nzVolume, i_display_len) +bullCandle = close > open + +if barstate.islast + if array.size(a_lines) > 0 + for i = 1 to array.size(a_lines) + line.delete(array.shift(a_lines)) + + if array.size(a_hist) > 0 + for i = 1 to array.size(a_hist) + box.delete(array.shift(a_hist)) + + if i_mfi_display + mid_line = math.avg(100, 0) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_ob / oscHighest * priceChangeRate * i_mfi_height), + bar_index , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_ob / oscHighest * priceChangeRate * i_mfi_height), color.new(i_pos_col, 75), 1)) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_mfi_height), + bar_index , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_mfi_height), color.new(i_neu_col, 75), 1)) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_os / oscHighest * priceChangeRate * i_mfi_height), + bar_index , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + i_mfi_os / oscHighest * priceChangeRate * i_mfi_height), color.new(i_neg_col, 75), 1)) + f_drawLabelX( bar_index + 3 , priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_mfi_height), 'MFI', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, str.tostring(mfi, '#.##')) + + if i_rsi_display + mid_line = math.avg(100, 0) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_ob / oscHighest * priceChangeRate * i_rsi_height), + bar_index , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_ob / oscHighest * priceChangeRate * i_rsi_height), color.new(i_pos_col, 75), 1)) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_rsi_height), + bar_index , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_rsi_height), color.new(i_neu_col, 75), 1)) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_os / oscHighest * priceChangeRate * i_rsi_height), + bar_index , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + i_rsi_os / oscHighest * priceChangeRate * i_rsi_height), color.new(i_neg_col, 75), 1)) + f_drawLabelX( bar_index + 3 , priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_rsi_height), 'RSI', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, str.tostring(rsi, '#.##')) + + if i_cci_display + mid_line = math.avg(100, 0) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_ob / oscHighest * priceChangeRate * i_cci_height), + bar_index , priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_ob / oscHighest * priceChangeRate * i_cci_height), color.new(i_pos_col, 75), 1)) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_cci_voffset), + bar_index , priceLowest * (1 - priceChangeRate * i_cci_voffset), color.new(i_neu_col, 75), 1)) + array.push(a_hist, box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_os / oscHighest * priceChangeRate * i_cci_height), + bar_index , priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + i_cci_os / oscHighest * priceChangeRate * i_cci_height), color.new(i_neg_col, 75), 1)) + f_drawLabelX( bar_index + 3 , priceLowest * (1 - priceChangeRate * i_cci_voffset), 'CCI', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, str.tostring(cci, '#.##')) + + if i_vol_type != 'None' + f_drawLabelX( bar_index + 3 , priceHighest * (1 + priceChangeRate * i_vol_voffset), 'VOL', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.small, text.align_center, 'Buy Vol : ' + str.tostring(B / (B + S) * 100, '#.##') + '%\nSell Vol : ' + str.tostring(S / (B + S) * 100, '#.##') + '%\nLast Vol : ' + str.tostring(nzVolume, format.volume) + '\nAvg Vol : ' + str.tostring(vol_sma, format.volume)) + + for barIndex = 0 to i_display_len - 1 + if array.size(a_lines) < 500 + + if i_mfi_display + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mfi[barIndex] / oscHighest * priceChangeRate * i_mfi_height), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_mfi_voffset) * (1 + mfi[barIndex + 1] / oscHighest * priceChangeRate * i_mfi_height), xloc.bar_index, extend.none, i_indicator_col , line.style_solid, 1)) + + if i_rsi_display + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi[barIndex] / oscHighest * priceChangeRate * i_rsi_height), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi[barIndex + 1] / oscHighest * priceChangeRate * i_rsi_height), xloc.bar_index, extend.none, i_indicator_col , line.style_solid, 1)) + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi_sma[barIndex] / oscHighest * priceChangeRate * i_rsi_height), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_rsi_voffset) * (1 + rsi_sma[barIndex + 1] / oscHighest * priceChangeRate * i_rsi_height), xloc.bar_index, extend.none, i_signal_col , line.style_solid, 1)) + + if i_cci_display + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci[barIndex] / oscHighest * priceChangeRate * i_cci_height), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci[barIndex + 1] / oscHighest * priceChangeRate * i_cci_height), xloc.bar_index, extend.none, i_indicator_col , line.style_solid, 1)) + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci_sma[barIndex] / oscHighest * priceChangeRate * i_cci_height), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_cci_voffset) * (1 + cci_sma[barIndex + 1] / oscHighest * priceChangeRate * i_cci_height), xloc.bar_index, extend.none, i_signal_col , line.style_solid, 1)) + + if nzVolume + if i_vol_type != 'None' + array.push(a_hist, box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), + bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height), i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_col, 0) : bullCandle[barIndex] ? color.new(i_pos_col, 0) : color.new(i_neg_col, 0), 2, bgcolor = i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_col, 0) : bullCandle[barIndex] ? color.new(i_pos_col, 0) : color.new(i_neg_col, 0))) + if i_vol_type == 'Buying/Selling Volume' + array.push(a_hist, box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), + bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + S[barIndex] / volumeHighest * priceChangeRate * i_vol_height), color.new(i_neg_col, 0), 2, bgcolor = color.new(i_neg_col, 0))) + // Voumme MA + if i_vol_display + array.push(a_lines, line.new(bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex]), + bar_index[barIndex + 1] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex + 1] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex + 1]), xloc.bar_index, extend.none, i_neu_col, line.style_solid, 1)) + +//_____________________________ Overlay Charts End + +//_____________________________ Overlay Charts Table Start + +var table tbl = table.new(position=i_tbl_position, columns=2, rows=5, border_width=2) + +// Color +col_pchg = pchg > i_pchg_250 ? i_pos_col : pchg < (-i_pchg_250) ? i_neg_col : i_neu_col +col_rsi = rsi > i_rsi_ob ? i_pos_col : rsi < i_rsi_os ? i_neg_col : i_neu_col +col_mfi = mfi > i_mfi_ob ? i_pos_col : mfi < i_mfi_os ? i_neg_col : i_neu_col +col_cci = cci > i_cci_ob ? i_pos_col : cci < i_cci_os ? i_neg_col : i_neu_col +col_vol = volume > vol_sma ? i_pos_col : i_neu_col + +// Function to populate cells in the table +cell(int column, int row, string txt, color color) => + table.cell(tbl, column, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) + +// Check if it's the last bar +if barstate.islast + cell(0, 0, "%Chg", col_pchg) + cell(0, 1, "RSI", col_rsi) + cell(0, 2, "MFI", col_mfi) + cell(0, 3, "CCI", col_cci) + cell(0, 4, "Vol", col_vol) + + cell(1, 0, str.tostring(pchg, '#.##'), col_pchg) + cell(1, 1, str.tostring(rsi, '#.##'), col_rsi) + cell(1, 2, str.tostring(mfi, '#.##'), col_mfi) + cell(1, 3, str.tostring(cci, '#.##'), col_cci) + cell(1, 4, str.tostring((volume / 100000), '#.##') + ' L', col_vol) + +//_____________________________ Overlay Charts Table Start + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_001, out_001] = feed(effective_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), +[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), +[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), +[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), +[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), +[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), +[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), +[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), +[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), +[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038)//, [tid_040, out_040] = feed(out_039) + +//_____________________________ Get Symbols for Screener End + +//_____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Screener Conditions +bearish_cond = short_cont +bullish_cond = long_cont + +// Define Bull and Bear Conditions +bull = not(i_scr_direction == "Bearish") +bear = not(i_scr_direction == "Bullish") + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_bull and bearish_cond and bear + signal := -1 + + // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_bear and bullish_cond and bull + signal := 1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + + [_time, price, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 4, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, price, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, signal)) + +// Screener function to collect data +screener(s) => + [_time, price, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, strPrice, strSignal) + +// Call Screener function for multiple symbols +screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), +screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), +screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), +screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), +screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), +screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039)//, screener(tid_040) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_tbl_disp_rows + while matrix.rows(matrix) > i_scr_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table scr_tbl = table.new(position=i_scr_tbl_position, columns=3, rows=102, border_width=1) + +// Function to populate cells in the table +scr_cell_title(col, row, txt) => + table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_col, text_halign=text.align_center, bgcolor = color.new(i_neu_col, 90), text_size=i_scr_tbl_text_size) + +scr_cell(col, row, txt, color) => + table.cell(scr_tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_scr_tbl_text_size) + +// Check if it's the last bar +if barstate.islast + // Clear existing data in the table + table.clear(scr_tbl, 0, 0, 2, 101) + + scr_cell_title(0, 0, 'Momentum Investing') + table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=2, end_row=0) + scr_cell_title(0, 1, "Symbol") + scr_cell_title(1, 1, "Time") + scr_cell_title(2, 1, "Price") + + j = 2 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + col = matrix.get(matrix, i, 3) == "1" ? i_pos_col : + matrix.get(matrix, i, 3) == "-1" ? i_neg_col : i_neu_col + + // Populate cells in the table + scr_cell(0, j, matrix.get(matrix, i, 0), col) + scr_cell(1, j, matrix.get(matrix, i, 1), col) + scr_cell(2, j, matrix.get(matrix, i, 2), col) + + j += 1 + +//_____________________________ Screener End + +//_____________________________ Code End + +// Readme First: +// +// About: +// This is a Momentum Investing Strategy Setup shared by trader Ankush Bajaj. +// The original video is based on the daily timeframe for long-term investment. +// This strategy can also be adapted for lower timeframes. +// To adapted the strategy for lower timeframes like 5 minutes, change the 'Above/Below %' to 2 or 4 or adjust as needed according your timeframe. +// Example: For 5 min timeframe use 'Above/Below %' as 2. For 1hr timeframe use 'Above/Below %' as 4. +// Also adjust the 'MA Multiplier (x)' value. Default is 5x. This can be adjusted to 2 times, 3 times etc. +// +// Strategy Reference Video: +// Video Title: "Momentum Investing Strategies | Understand Different Types of Momentum Strategies | Ep 141" +// Video Link: https://www.youtube.com/watch?v=-uEEmnFtDIw +// Video Title: "Momentum Investing using Technical Indicators | Ep 142 | Samco Securities" +// Video Link: https://www.youtube.com/watch?v=zmpsx7BpzvU&t=1154s +// +// Strategy Type: Momentum +// Bias: Strongly Directional +// Trading Style: Investment +// Instrument: Any +// Original Symbol: Any +// Timeframe: Daily (default) +// +// Indicator Used and Settings: +// 1. % Change of last 250 candle +// 2. RSI 14 +// 3. MFI 14 +// 4. CCI 20 +// 5. Volume 20 EMA +// +// Long Entry Rules (As per the video): +// - Daily Timeframe +// - % Change of 250 Candle > 8 +// - RSI above 60 +// - MFI above 60 +// - CCI above 100 +// - Volume > EMA 20 of Volume * 5 +// - Market Cap > 1000 Crore +// - Price > Rs.50 +// +// Short Entry Rules (Not mentioned in the video): +// - Daily Timeframe +// - % Change of 250 Candle < -8 +// - RSI below 40 +// - MFI below 40 +// - CCI below -100 +// - Volume > EMA 20 of Volume * 5 +// - Market Cap > 1000 Crore +// - Price > Rs.50 + diff --git a/Momentum Setup - RSI Directional Momentum/[Scanner] Momentum Setup - RSI Directional Momentum.txt b/Momentum Setup - RSI Directional Momentum/[Scanner] Momentum Setup - RSI Directional Momentum.txt index 2dff101..d57b7cc 100644 --- a/Momentum Setup - RSI Directional Momentum/[Scanner] Momentum Setup - RSI Directional Momentum.txt +++ b/Momentum Setup - RSI Directional Momentum/[Scanner] Momentum Setup - RSI Directional Momentum.txt @@ -1,782 +1,1006 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=6 -indicator(title = 'Momentum Setup - RSI Directional Momentum Scanner', shorttitle = 'RSIDMScan', behind_chart = false) - -//___________________________ Menu Start - -string g_scn_tb = '█████████████████ Scanner █████████████████' - -string tt_ch = - "Continuous Break:" + - "\n• Buy: RSI crosses above 60, dips below, then breaks the previous high while staying above 60." + - "\n• Sell: RSI crosses below 40, rises above, then breaks the previous low while staying below 40." + - - "\n\n Continuous Retracement:" + - "\n• After a Continuous Break, a Fibonacci level is set." + - "\n• Buy: Price retraces to this level and bounces." + - "\n• Sell: Price retraces to this level and drops." + - - "\n\n Flip Break:" + - "\n• If a Continuous Break fails, the trade flips (Long → Short, Short → Long)." + - - "\n\n Flip Retracement:" + - "\n• If a Continuous Retracement fails, the trade flips (Long → Short, Short → Long)." + - - "\n\n Divergence:" + - "\n• Buy: Price makes a lower low, RSI makes a higher low." + - "\n• Sell: Price makes a higher high, RSI makes a lower high." + - - "\n\n Hidden Divergence (Trend continuation):" + - "\n• Buy: Price makes a higher low, RSI makes a lower low." + - "\n• Sell: Price makes a lower high, RSI makes a higher high." - -string tt_is = - "• Reads only the first 40 symbols." + - "\n• Max 4096 characters." + - "\n• Format: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_scn_choose = input.string( - defval = 'Continuous Break', - title = 'Scanning Method', - options = ['Continuous Break', 'Continuous Retracement', 'Flip Break', 'Flip Retracement', 'Divergence', 'Hidden Divergence'], tooltip = tt_ch, group = g_scn_tb) - -string i_symbols = input.text_area( - defval = 'NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:BIOCON,NSE:BPCL,NSE:CESC,NSE:DELHIVERY,NSE:FEDERALBNK,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IGL,NSE:IIFL,NSE:INDUSTOWER,NSE:IOC,NSE:IREDA,NSE:IRFC,NSE:JIOFIN,NSE:LTF,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:M_MFIN,NSE:NATIONALUM,NSE:NCC,NSE:NYKAA,NSE:ONGC,NSE:PETRONET,NSE:POONAWALLA,NSE:POWERGRID,NSE:RBLBANK,NSE:SAIL,NSE:TATASTEEL,NSE:UNIONBANK,NSE:ZOMATO', - title = 'Paste Symbols', tooltip = tt_is, group = g_scn_tb) - -bool i_scn_show_table = input.bool(defval = true, title = 'Display Table', group = g_scn_tb) -bool i_scn_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scn_tb) -bool i_scn_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scn_tb) - -int i_scn_tbl_show_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scn_tb) -string i_scn_tbl_pos = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scn_tb) -string i_scn_tbl_txt_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scn_tb) - -string g_rsi = '██████████ Relative Strength Index (RSI) ██████████' -string tt_ret_fib = - "• 0: Bottom of bullish & top of bearish breaking candle." + - "\n• 1: Top of bullish & bottom of bearish breaking candle." + - "\n• 0.5: 50% of the breaking candle." -int i_rsi_len = input.int(defval = 14, title = 'RSI Length', minval = 1, group = g_rsi) -float i_rsi_src = input.source(defval = close, title = 'RSI Source', group = g_rsi) -int i_rsi_ma_len = input.int(defval = 14, title = 'SMA Length', minval = 1, group = g_rsi) -float i_rsi_fib_val = input.float(defval = 0.5, title = 'Fib Value', step = 0.1, tooltip = tt_ret_fib, group = g_rsi) -bool i_rsi_show_bull = input.bool(defval = true, title = 'Display Bullish Divergence', group = g_rsi) -bool i_rsi_show_bear = input.bool(defval = true, title = 'Display Bearish Divergence', group = g_rsi) -bool i_rsi_show_hbull = input.bool(defval = true, title = 'Display Hidden Bullish Divergence', group = g_rsi) -bool i_rsi_show_hbear = input.bool(defval = true, title = 'Display Hidden Bearish Divergence', group = g_rsi) -int i_rsi_p_right = input.int(defval = 5, title = 'Pivot Lookback Right', group = g_rsi) -int i_rsi_p_left = input.int(defval = 5, title = 'Pivot Lookback Left', group = g_rsi) -int i_rsi_range_max = input.int(defval = 60, title = 'Max of Lookback Range', group = g_rsi) -int i_rsi_range_min = input.int(defval = 5, title = 'Min of Lookback Range', group = g_rsi) - -string g_af = '██████████████ Additional Fiters ██████████████' - -string tt_pchg = - "• Percentage change of the day." -string tt_vpchg = - "• 0% means today's volume must exceed the previous day's." + - "\n• 300%+ often signals a major breakout (today or next day)." -string tt_atr = "• Filters out longer or more volatile signal candles." -string tt_atr_mul = "• Higher values filter longer or more volatile candles." -string tt_bf = "• 80 means the body covers 80%+ of the candle." -string tt_bs = "• 2 means the candle is twice the size of the previous one." -string tt_vol = "• Filter candles with volume > SMA of volume." -string tt_rv = "• Filter candles with volume > Relative Volume." -string tt_tf = "• Filter signals within a given time." -string tt_df = "• Filter signals on specified dates (for Break Candles (2) only)." - -bool i_pchg_filter = input.bool(defval = false, title = 'Apply % Change Filter', tooltip = tt_pchg, group = g_af) -float i_pchg_above_below = input.float(defval = 2, title = '% Change Above/Below +/-', minval = 0, group = g_af) - -bool i_vol_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vpchg, group = g_af) -int i_vol_above = input.int(defval = 500000, title = 'Volume Above', minval = 0, group = g_af) - -bool i_vol_pchg_filter = input.bool(defval = false, title = 'Apply Volume % Change Filter', tooltip = tt_vpchg, group = g_af) -float i_vol_pchg_above = input.float(defval = 0, title = 'Volume % Change Above', minval = 0, group = g_af) - -bool i_atr_filter = input.bool(defval = false, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) -int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) -float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) - -bool i_body_filter = input.bool(defval = false, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) -float i_body_percent = input.float(defval = 70, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 - -bool i_body_size_filter = input.bool(defval = false, title = 'Apply Body Size Filter', tooltip = tt_bs, group = g_af) -int i_body_size_multi = input.int(defval = 2, title = 'Body Size Multiplier (x)', minval = 0, group = g_af) - -bool i_volume_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vol, group = g_af) -int i_vol_sma_length = input.int(defval = 20, minval = 1, title = 'Volume SMA Length', group = g_af) - -bool i_rel_vol_filter = input.bool(defval = false, title = 'Apply Relative Volume Filter', tooltip = tt_rv, group = g_af) -int i_rel_vol_avg_vol_len = input.int(defval = 90, title = 'Relative Volume Length', minval = 2, group = g_af) -float i_rel_vol_avg_vol_multi = input.float(defval = 5, title = 'Rel Vol SMA Multiplier', minval = 0, group = g_af) - -bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) -int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) -int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) -int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) -int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) - -bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) -int i_day = input.int(defval = 25, minval = 1, maxval = 31, title = 'Day', group = g_af) -int i_month = input.int(defval = 10, minval = 1, maxval = 12, title = 'Month', group = g_af) -int i_year = input.int(defval = 2024, minval = 0, title = 'Year', group = g_af) - -string g_cum = '█████████████ Performance Table █████████████' -bool i_cum_tbl_disp = input.bool(defval = true, title = 'Display', group = g_cum) -string i_cum_tbl_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_cum) -string i_cum_tbl_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_cum) - -//string g_ch = '█████████████████ Colors █████████████████' -color i_pos_color = #089981 //input.color(defval = #089981, title = 'Positive', group = g_ch) -color i_pos_light_color = #70CCBD //input.color(defval = #70CCBD, title = 'Positive Light', group = g_ch) -color i_neg_light_color = #FAA1A4 //input.color(defval = #FAA1A4, title = 'Negative Light', group = g_ch) -color i_neg_color = #F23645 //input.color(defval = #F23645, title = 'Negative', group = g_ch) -color i_indicator_color = #2962FF //input.color(defval = #2962FF, title = 'Indicator', group = g_ch) -color i_signal_color = #FF6D00 //input.color(defval = #FF6D00, title = 'Signal', group = g_ch) -color i_neu_color = #D1D4DC //input.color(defval = #D1D4DC, title = 'Neutral Light', group = g_ch) -color i_neu_dark_color = #0F0F0F //input.color(defval = #0F0F0F, title = 'Neutral', group = g_ch) - -//___________________________ Menu End - -//___________________________ Performance Start - -is_new_day = ta.change(time('D')) != 0 - -// Cumulative Percentage Change -var float cum_pchg = na -day_pchg = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 -cum_pchg := is_new_day ? day_pchg : na(cum_pchg) ? day_pchg : cum_pchg + day_pchg - -// Cumulative Volume and Volume Percentage Change -var float curr_cum_vol = na -var float prev_cum_vol = na -if is_new_day - prev_cum_vol := curr_cum_vol - curr_cum_vol := volume - curr_cum_vol -else - curr_cum_vol := na(curr_cum_vol) ? volume : curr_cum_vol + volume - curr_cum_vol -prev_vol_safe = nz(prev_cum_vol, curr_cum_vol) -cum_vol_pchg = (curr_cum_vol - prev_vol_safe) / prev_vol_safe * 100 - -var table tbl_cum = table.new(position=i_cum_tbl_pos, columns=2, rows=4, border_width=1, force_overlay=true) - -cell_perform(col, row, txt, txt_color, aligh) => - table.cell(tbl_cum, col, row, txt, text_color=txt_color, text_halign=aligh, bgcolor=i_neu_dark_color, text_size=i_cum_tbl_size) - -if barstate.islast and i_cum_tbl_disp - pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color - vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color - prev_vol_pchg_col = prev_vol_safe < curr_cum_vol ? i_neg_color : i_pos_color - - cell_perform(0, 0, '%Chg', chart.fg_color, text.align_left) - cell_perform(1, 0, str.tostring(cum_pchg, '#.##') + ' %', pchg_col, text.align_right) - cell_perform(0, 1, 'Vol %Chg', chart.fg_color, text.align_left) - cell_perform(1, 1, str.tostring(cum_vol_pchg, '#.##') + ' %', vol_pchg_col, text.align_right) - cell_perform(0, 2, 'Vol', chart.fg_color, text.align_left) - cell_perform(1, 2, str.tostring(curr_cum_vol / 100000, '#.##') + ' L', vol_pchg_col, text.align_right) - cell_perform(0, 3, 'PD Vol', chart.fg_color, text.align_left) - cell_perform(1, 3, str.tostring(prev_vol_safe / 100000, '#.##') + ' L', prev_vol_pchg_col, text.align_right) - -//___________________________ Performance End - -//___________________________ Additional Filters Start - -// Pre-calculate common values -candle_range = high - low -body_size = math.abs(close - open) - -// Combined filter conditions -pchg_above_filter = not i_pchg_filter or cum_pchg > i_pchg_above_below -pchg_below_filter = not i_pchg_filter or cum_pchg < -i_pchg_above_below -vol_filter = not i_vol_filter or curr_cum_vol >= i_vol_above -vol_pchg_filter = not i_vol_pchg_filter or cum_vol_pchg >= i_vol_pchg_above - -// ATR Filter -atr_filter = not i_atr_filter or candle_range > ta.atr(i_atr_length) * i_atr_multi - -// Body Filters -body_filter = not i_body_filter or candle_range > 0 and body_size / candle_range >= i_body_percent -body_size_filter = not i_body_size_filter or candle_range > 0 and body_size / candle_range >= i_body_percent and candle_range >= (high[1] - low[1]) * i_body_size_multi - -// Volume Filters -volume_filter = not i_volume_filter or volume > ta.sma(volume, i_vol_sma_length) - -// Relative Volume Filter -var bool rel_vol_filter = true -if i_rel_vol_filter - average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) - relative_volume = volume / nz(average_volume[1], volume) - rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi - rel_vol_filter := relative_volume > rel_vol_sma_multiplier - -// Time Filter -time_filter = - not i_time_filter or - (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and - (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) - -// Date Filter -date_filter = not i_date_filter or year == i_year and month == i_month and dayofmonth == i_day - -//___________________________ Additional Filters End - -//___________________________ RSI Start - -// Acknowledgement & Reference -// Trader: 'TradingView' -// Indicator Title: Built-in Relative Strength Index, RSI Divergence Indicator - -color no_color = #00000000 - -// RSI Calculation -float rsi = ta.rsi(i_rsi_src, i_rsi_len) -float rsi_ma = ta.sma(rsi, i_rsi_ma_len) - -// RSI Plot -plot(series = rsi, title = 'RSI', color = i_indicator_color, linewidth = 2) -plot(series = rsi_ma, title = 'RSI Moving Average', color = i_signal_color) - -// RSI Bands -float overbought = 70 -float breakout = 60 -float middle = 50 -float breakdown = 40 -float oversold = 30 -hline(price = overbought, title = 'Band Overbought', color = color.new(i_neg_color, 50), linestyle = hline.style_dotted) -band_ub = hline(price = breakout, title = 'Band Bullish', color = color.new(i_neu_color, 50), linestyle = hline.style_dotted) -hline(price = middle, title = 'Band Middle', color = color.new(i_neu_color, 50), linestyle = hline.style_dotted) -band_lb = hline(price = breakdown, title = 'Band Bearish', color = color.new(i_neu_color, 50), linestyle = hline.style_dotted) -hline(price = oversold, title = 'Band Oversold', color = color.new(i_pos_color, 50), linestyle = hline.style_dotted) -fill(hline1 = band_ub, hline2 = band_lb, color = color.new(i_neu_color, 95), title = 'Fill Middle') - -// Divergence Calculation -_inRange(cond) => - bars = ta.barssince(cond) - i_rsi_range_min <= bars and bars <= i_rsi_range_max - -bool plFound = not na(ta.pivotlow(rsi, i_rsi_p_left, i_rsi_p_right)) -bool phFound = not na(ta.pivothigh(rsi, i_rsi_p_left, i_rsi_p_right)) -float rsiLBR = rsi[i_rsi_p_right] -float lowLBR = low[i_rsi_p_right] -float highLBR = high[i_rsi_p_right] - -// Bull Divergence -rsiHL = rsiLBR > ta.valuewhen(plFound, rsiLBR, 1) and _inRange(plFound[1]) -priceLL = lowLBR < ta.valuewhen(plFound, lowLBR, 1) -bullDiv = i_scn_choose == 'Divergence' and i_rsi_show_bull and priceLL and rsiHL and plFound - -// Bear Divergence -rsiLH = rsiLBR < ta.valuewhen(phFound, rsiLBR, 1) and _inRange(phFound[1]) -priceHH = highLBR > ta.valuewhen(phFound, highLBR, 1) -bearDiv = i_scn_choose == 'Divergence' and i_rsi_show_bear and priceHH and rsiLH and phFound - -// Hidden Bullish -rsiLL = rsiLBR < ta.valuewhen(plFound, rsiLBR, 1) and _inRange(plFound[1]) -priceHL = lowLBR > ta.valuewhen(plFound, lowLBR, 1) -hiddenBullDiv = i_scn_choose == 'Hidden Divergence' and i_rsi_show_hbull and priceHL and rsiLL and plFound - -// Hidden Bearish -rsiHH = rsiLBR > ta.valuewhen(phFound, rsiLBR, 1) and _inRange(phFound[1]) -priceLH = highLBR < ta.valuewhen(phFound, highLBR, 1) -hiddenBearDiv = i_scn_choose == 'Hidden Divergence' and i_rsi_show_hbear and priceLH and rsiHH and phFound - -// Divergence Plots -// Underlay -plot(i_scn_choose == 'Divergence' and plFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Bull Div', color = bullDiv ? i_pos_color : no_color, linewidth = 2, display = display.pane, editable = i_rsi_show_bull) -//plotshape(bullDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Bull Div", text=" Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, editable=i_rsi_show_bull) -plot(i_scn_choose == 'Divergence' and phFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Bear Div', color = bearDiv ? i_neg_color : no_color, linewidth = 2, display = display.pane, editable = i_rsi_show_bear) -//plotshape(bearDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Bear Div", text=" Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, editable=i_rsi_show_bear) -// Overlay -plot(i_scn_choose == 'Divergence' and plFound ? lowLBR : na, offset = -i_rsi_p_right, title = 'Line Bull Div Over', color = bullDiv ? i_pos_color : no_color, linewidth = 2, display = display.pane, force_overlay = true) -//plotshape(bullDiv ? lowLBR : na, offset=-i_rsi_p_right, title="Label Bull Div Over", text=" Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, force_overlay=true) -plot(i_scn_choose == 'Divergence' and phFound ? highLBR : na, offset = -i_rsi_p_right, title = 'Line Bear Div Over', color = bearDiv ? i_neg_color : no_color, linewidth = 2, display = display.pane, force_overlay = true) -//plotshape(bearDiv ? highLBR : na, offset=-i_rsi_p_right, title="Label Bear Div Over", text=" Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, force_overlay=true) - -// Underlay -plot(i_scn_choose == 'Hidden Divergence' and plFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bull Div', color = hiddenBullDiv ? i_pos_color : no_color, display = display.pane, editable = i_rsi_show_hbull) -//plotshape(hiddenBullDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bull Div", text=" H Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, editable=i_rsi_show_hbull) -plot(i_scn_choose == 'Hidden Divergence' and phFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bear Div', color = hiddenBearDiv ? i_neg_color : no_color, display = display.pane, editable = i_rsi_show_hbear) -//plotshape(hiddenBearDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bear Div", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, editable=i_rsi_show_hbear) -// Overlay -plot(i_scn_choose == 'Hidden Divergence' and plFound ? lowLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bull Div Over', color = hiddenBullDiv ? i_pos_color : no_color, display = display.pane, force_overlay = true) -//plotshape(hiddenBullDiv ? lowLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bull Div Over", text=" H Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, force_overlay=true) -plot(i_scn_choose == 'Hidden Divergence' and phFound ? highLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bear Div Over', color = hiddenBearDiv ? i_neg_color : no_color, display = display.pane, force_overlay = true) -//plotshape(hiddenBearDiv ? highLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bear Div Over", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, force_overlay=true) - -//___________________________ RSI End - -//___________________________ Signals Start - -// Acknowledgement & Reference -// Trader: 'vitvlkv' -// Indicator Title: 'HOWTO: cond1 + cond2 = alert once' -// Indicator Link: 'https://www.tradingview.com/script/UHkEyCV3-HOWTO-cond1-cond2-alert-once/' - -// State Machine for Continuous Signals -var int state = 0 -state := nz(state[1]) == 3 or nz(state[1]) == 6 ? 0 : nz(state[1]) - -// Short Conditions -bool short_1 = - ta.crossunder(rsi, breakdown) and - rsi < rsi_ma and - (state == 0 or state >= 4 and state <= 5) - -var float short_1_low = na -var float short_1_rsi = na -var int short_1_bar = na -if short_1 - short_1_low := low - short_1_rsi := rsi - short_1_bar := bar_index - -bool short_2 = rsi > breakdown - -bool short_3 = - not na(short_1_low) and - rsi < breakdown and - rsi < rsi_ma and - close < short_1_low and - //ta.crossunder(close, short_1_low) and - pchg_above_filter and - pchg_below_filter and - vol_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - date_filter and - barstate.isconfirmed - -// Long Conditions -long_1 = - ta.crossover(rsi, breakout) and - rsi > rsi_ma and - (state == 0 or state >= 1 and state <= 2) - -var float long_1_high = na -var float long_1_rsi = na -var int long_1_bar = na -if long_1 - long_1_high := high - long_1_rsi := rsi - long_1_bar := bar_index - -long_2 = rsi < breakout - -long_3 = - not na(long_1_high) and - rsi > breakout and - rsi > rsi_ma and - close > long_1_high and - //ta.crossover(close, long_1_high) and - pchg_above_filter and - pchg_below_filter and - vol_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - date_filter and - barstate.isconfirmed - -// State Transitions -if short_1 - state := 1 -else if short_2 and state == 1 - state := 2 -else if short_3 and state == 2 - state := 3 -else if long_1 - state := 4 -else if long_2 and state == 4 - state := 5 -else if long_3 and state == 5 - state := 6 - -// Continuous Signals -short_cont_break = state == 3 -long_cont_break = state == 6 - -//___________________________ Continuous Retracement Signals - -// Fibonacci Levels for Continuous Signals -var float short_signal_high = na -var float short_signal_low = na -var int short_signal_bar = na -var float long_signal_high = na -var float long_signal_low = na -var int long_signal_bar = na - -if short_cont_break - short_signal_high := high - short_signal_low := low - short_signal_bar := bar_index - -if long_cont_break - long_signal_high := high - long_signal_low := low - long_signal_bar := bar_index - -short_fib_val = - not na(short_signal_high) and not na(short_signal_low) ? - short_signal_high - (short_signal_high - short_signal_low) * i_rsi_fib_val : na - -long_fib_val = - not na(long_signal_high) and not na(long_signal_low) ? - long_signal_low + (long_signal_high - long_signal_low) * i_rsi_fib_val : na - -// Continuous Retracement Signals -var bool short_active = false -var bool long_active = false -var bool short_cont_ret_done = false -var bool long_cont_ret_done = false -var int short_ret_bar = na -var float short_ret_high = na -var int long_ret_bar = na -var float long_ret_low = na - -if short_cont_break - short_active := true - long_active := false - short_cont_ret_done := false - long_cont_ret_done := false - -if long_cont_break - long_active := true - short_active := false - long_cont_ret_done := false - short_cont_ret_done := false - -short_cont_ret = - short_active and - not short_cont_ret_done and - not na(short_fib_val) and - ta.crossover(high, short_fib_val) and - high[1] < short_fib_val - -long_cont_ret = - long_active and - not long_cont_ret_done and - not na(long_fib_val) and - ta.crossunder(low, long_fib_val) and - low[1] > long_fib_val - -if short_cont_ret - short_cont_ret_done := true - short_ret_bar := bar_index - short_ret_high := high -if long_cont_ret - long_cont_ret_done := true - long_ret_bar := bar_index - long_ret_low := low - -//___________________________ Flip Signals - -// Acknowledgement & Reference -// Trader: 'vitvlkv' -// Indicator Title: 'HOWTO: Skip consecutive signals' -// Indicator Link: 'https://www.tradingview.com/script/2M9I2sgP-HOWTO-Skip-consecutive-signals/' - -exrem(bool cond1, bool cond2) => - var int signal = 0 - signal := cond1 ? 1 : cond2 ? -1 : signal[1] - bool entry = signal != signal[1] - [entry and signal == 1, entry and signal == -1] - -[long_flip_break, short_flip_break] = exrem(long_cont_break, short_cont_break) -[long_flip_ret, short_flip_ret] = exrem(long_cont_ret, short_cont_ret) - -//___________________________ Plot Signal - -choice_cont_ln = i_scn_choose == 'Continuous Break' -choice_cont_ret_ln = i_scn_choose == 'Continuous Retracement' - -choice_cont = i_scn_choose == 'Continuous Break' or i_scn_choose == 'Continuous Retracement' -choice_cont_ret = i_scn_choose == 'Continuous Retracement' -choice_flip = i_scn_choose == 'Flip Break' -choice_flip_ret = i_scn_choose == 'Flip Retracement' - -// Line Instances -f_drawLine(id, x1, y1, x2, y2, col) => - line.new(x1, y1, x2, y2, color=col, style=line.style_dotted, force_overlay=true) - -var line short_line_1 = na -var line short_line_2 = na -var line long_line_1 = na -var line long_line_2 = na - -if short_cont_break and choice_cont_ln and not na(short_1_low) and not na(short_signal_low) and not na(short_1_bar) and not na(short_signal_bar) - short_line_1 := f_drawLine(short_line_1, short_1_bar, short_1_low, short_signal_bar, short_1_low, i_neg_color) - -if short_cont_ret and choice_cont_ret_ln and not na(short_fib_val) and not na(short_ret_high) and not na(short_signal_bar) and not na(short_ret_bar) - short_line_2 := f_drawLine(short_line_2, short_signal_bar, short_fib_val, short_ret_bar, short_fib_val, i_neg_color) - -if long_cont_break and choice_cont_ln and not na(long_1_high) and not na(long_signal_high) and not na(long_1_bar) and not na(long_signal_bar) - long_line_1 := f_drawLine(long_line_1, long_1_bar, long_1_high, long_signal_bar, long_1_high, i_pos_color) - -if long_cont_ret and choice_cont_ret_ln and not na(long_fib_val) and not na(long_ret_low) and not na(long_signal_bar) and not na(long_ret_bar) - long_line_2 := f_drawLine(long_line_2, long_signal_bar, long_fib_val, long_ret_bar, long_fib_val, i_pos_color) - -// Continuous 1st Alert -plotshape(i_scn_show_short and choice_cont ? short_1 : false, title = 'Cont 1st Short', style = shape.circle, location = location.abovebar, color = i_neg_light_color, size = size.auto, force_overlay = true) -plotshape(i_scn_show_long and choice_cont ? long_1 : false, title = 'Cont 1st Long', style = shape.circle, location = location.belowbar, color = i_pos_light_color, size = size.auto, force_overlay = true) -barcolor(i_scn_show_short and choice_cont and short_1 ? i_neg_light_color : i_scn_show_long and choice_cont and long_1 ? i_pos_light_color : na, title = 'Cont 1st Candle') -//bgcolor(i_scn_show_short and choice_cont and short_1 ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_cont and long_1 ? color.new(i_pos_light_color, 90) : na, title="Cont 1st Bgcolor") - -// Continuous 2nd Breakout -plotshape(i_scn_show_short and choice_cont ? short_cont_break : false, title = 'Cont 2nd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '2', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) -plotshape(i_scn_show_long and choice_cont ? long_cont_break : false, title = 'Cont 2nd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '2', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) -barcolor(i_scn_show_short and choice_cont and short_cont_break ? i_neg_light_color : i_scn_show_long and choice_cont and long_cont_break ? i_pos_light_color : na, title = 'Cont 2nd Candle') -bgcolor(i_scn_show_short and choice_cont and short_cont_break ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_cont and long_cont_break ? color.new(i_pos_light_color, 90) : na, title = 'Cont 2nd Bgcolor') - -// Continuous 3rd Retracement -plotshape(i_scn_show_short and choice_cont_ret ? short_cont_ret : false, title = 'Cont 3rd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '3', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) -plotshape(i_scn_show_long and choice_cont_ret ? long_cont_ret : false, title = 'Cont 3rd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '3', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) -barcolor(i_scn_show_short and choice_cont_ret and short_cont_ret ? i_neg_light_color : i_scn_show_long and choice_cont_ret and long_cont_ret ? i_pos_light_color : na, title = 'Cont 3rd Candle') -bgcolor(i_scn_show_short and choice_cont_ret and short_cont_ret ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_cont_ret and long_cont_ret ? color.new(i_pos_light_color, 90) : na, title = 'Cont 3rd Bgcolor') - -// Flip 2nd Breakout -plotshape(i_scn_show_short and choice_flip ? short_flip_break : false, title = 'Flip 2nd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '2', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) -plotshape(i_scn_show_long and choice_flip ? long_flip_break : false, title = 'Flip 2nd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '2', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) -barcolor(i_scn_show_short and choice_flip and short_flip_break ? i_neg_light_color : i_scn_show_long and choice_flip and long_flip_break ? i_pos_light_color : na, title = 'Flip 2nd Candle') -bgcolor(i_scn_show_short and choice_flip and short_flip_break ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_flip and long_flip_break ? color.new(i_pos_light_color, 90) : na, title = 'Flip 2nd Bgcolor') - -// Flip 3rd Retracement -plotshape(i_scn_show_short and choice_flip_ret ? short_flip_ret : false, title = 'Flip 3rd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '3', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) -plotshape(i_scn_show_long and choice_flip_ret ? long_flip_ret : false, title = 'Flip 3rd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '3', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) -barcolor(i_scn_show_short and choice_flip_ret and short_flip_ret ? i_neg_light_color : i_scn_show_long and choice_flip_ret and long_flip_ret ? i_pos_light_color : na, title = 'Flip 3rd Candle') -bgcolor(i_scn_show_short and choice_flip_ret and short_flip_ret ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_flip_ret and long_flip_ret ? color.new(i_pos_light_color, 90) : na, title = 'Flip 3rd Bgcolor') - -//___________________________ Signals End - -//___________________________ Get Symbols List for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -// Feed Function -feed(input_string) => - if na(input_string) or str.length(input_string) == 0 - [string(na), string(na)] - else - result = str.split(input_string, ',') - first_item = '' - for i = 0 to array.size(result) - 1 by 1 - trimmed = str.trim(array.get(result, i)) - if trimmed != '' - first_item := trimmed - break - remaining = str.replace(input_string, first_item + ',', '', 1) - [first_item, remaining] - -// Flexible Symbol Extraction -sym_split_arr = str.split(i_symbols, ',') -new_sym_arr = array.new_string(array.size(sym_split_arr), na) -for i = 0 to array.size(sym_split_arr) - 1 by 1 - trimmed = str.trim(array.get(sym_split_arr, i)) - if trimmed != '' - array.set(new_sym_arr, i, trimmed) - -// Assign symbols dynamically -t_01 = array.size(new_sym_arr) > 0 ? array.get(new_sym_arr, 0) : na -t_02 = array.size(new_sym_arr) > 1 ? array.get(new_sym_arr, 1) : na -t_03 = array.size(new_sym_arr) > 2 ? array.get(new_sym_arr, 2) : na -t_04 = array.size(new_sym_arr) > 3 ? array.get(new_sym_arr, 3) : na -t_05 = array.size(new_sym_arr) > 4 ? array.get(new_sym_arr, 4) : na -t_06 = array.size(new_sym_arr) > 5 ? array.get(new_sym_arr, 5) : na -t_07 = array.size(new_sym_arr) > 6 ? array.get(new_sym_arr, 6) : na -t_08 = array.size(new_sym_arr) > 7 ? array.get(new_sym_arr, 7) : na -t_09 = array.size(new_sym_arr) > 8 ? array.get(new_sym_arr, 8) : na -t_10 = array.size(new_sym_arr) > 9 ? array.get(new_sym_arr, 9) : na -t_11 = array.size(new_sym_arr) > 10 ? array.get(new_sym_arr, 10) : na -t_12 = array.size(new_sym_arr) > 11 ? array.get(new_sym_arr, 11) : na -t_13 = array.size(new_sym_arr) > 12 ? array.get(new_sym_arr, 12) : na -t_14 = array.size(new_sym_arr) > 13 ? array.get(new_sym_arr, 13) : na -t_15 = array.size(new_sym_arr) > 14 ? array.get(new_sym_arr, 14) : na -t_16 = array.size(new_sym_arr) > 15 ? array.get(new_sym_arr, 15) : na -t_17 = array.size(new_sym_arr) > 16 ? array.get(new_sym_arr, 16) : na -t_18 = array.size(new_sym_arr) > 17 ? array.get(new_sym_arr, 17) : na -t_19 = array.size(new_sym_arr) > 18 ? array.get(new_sym_arr, 18) : na -t_20 = array.size(new_sym_arr) > 19 ? array.get(new_sym_arr, 19) : na -t_21 = array.size(new_sym_arr) > 20 ? array.get(new_sym_arr, 20) : na -t_22 = array.size(new_sym_arr) > 21 ? array.get(new_sym_arr, 21) : na -t_23 = array.size(new_sym_arr) > 22 ? array.get(new_sym_arr, 22) : na -t_24 = array.size(new_sym_arr) > 23 ? array.get(new_sym_arr, 23) : na -t_25 = array.size(new_sym_arr) > 24 ? array.get(new_sym_arr, 24) : na -t_26 = array.size(new_sym_arr) > 25 ? array.get(new_sym_arr, 25) : na -t_27 = array.size(new_sym_arr) > 26 ? array.get(new_sym_arr, 26) : na -t_28 = array.size(new_sym_arr) > 27 ? array.get(new_sym_arr, 27) : na -t_29 = array.size(new_sym_arr) > 28 ? array.get(new_sym_arr, 28) : na -t_30 = array.size(new_sym_arr) > 29 ? array.get(new_sym_arr, 29) : na -t_31 = array.size(new_sym_arr) > 30 ? array.get(new_sym_arr, 30) : na -t_32 = array.size(new_sym_arr) > 31 ? array.get(new_sym_arr, 31) : na -t_33 = array.size(new_sym_arr) > 32 ? array.get(new_sym_arr, 32) : na -t_34 = array.size(new_sym_arr) > 33 ? array.get(new_sym_arr, 33) : na -t_35 = array.size(new_sym_arr) > 34 ? array.get(new_sym_arr, 34) : na -t_36 = array.size(new_sym_arr) > 35 ? array.get(new_sym_arr, 35) : na -t_37 = array.size(new_sym_arr) > 36 ? array.get(new_sym_arr, 36) : na -t_38 = array.size(new_sym_arr) > 37 ? array.get(new_sym_arr, 37) : na -t_39 = array.size(new_sym_arr) > 38 ? array.get(new_sym_arr, 38) : na -t_40 = array.size(new_sym_arr) > 39 ? array.get(new_sym_arr, 39) : na - -//___________________________ Get Symbols List for Screener End - -//___________________________ Scanner Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Scanner Conditions -bool short_cond = - i_scn_choose == 'Continuous Break' ? short_cont_break : - i_scn_choose == 'Continuous Retracement' ? short_cont_ret : - i_scn_choose == 'Flip Break' ? short_flip_break : - i_scn_choose == 'Flip Retracement' ? short_flip_ret : - i_scn_choose == 'Divergence' ? bearDiv : hiddenBearDiv - -bool long_cond = - i_scn_choose == 'Continuous Break' ? long_cont_break : - i_scn_choose == 'Continuous Retracement' ? long_cont_ret : - i_scn_choose == 'Flip Break' ? long_flip_break : - i_scn_choose == 'Flip Retracement' ? long_flip_ret : - i_scn_choose == 'Divergence' ? bullDiv : hiddenBullDiv - -// Indicator Calculation Function -indicator_calculation() => - // Declare variables with var for persistence - var float price = na - var int _time = na - var float pchg = na - var float vol_pchg = na - var int signal = na - - if barstate.isconfirmed - // Single-line signal assignment - signal := i_scn_show_long and long_cond ? 1 : i_scn_show_short and short_cond ? -1 : na - - if not na(signal) - price := math.round_to_mintick(close) - _time := time - pchg := cum_pchg - vol_pchg := cum_vol_pchg - vol_pchg - - [_time, price, pchg, vol_pchg, signal] - -// Time Formatting Function -format_time(x) => - str.format_time(x, timeframe.isintraday ? 'HH:mm dd-MM-yyyy' : 'dd-MM-yyyy', syminfo.timezone) - -// Symbol Extraction Function -ticker_extract(s) => - array.get(str.split(s, ':'), 1) - -// Matrix setup -var matrix = matrix.new(0, 6, na) - -// Add Rows Function -rows_to_matix(symbol, _time, price, pchg, vol_pchg, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, pchg, vol_pchg, signal)) - -// Scanner Function -scan(new_sym_arr) => - for i = 0 to array.size(new_sym_arr) - 1 by 1 - sym = ticker.modify(array.get(new_sym_arr, i), syminfo.session) - [_time, price, pchg, vol_pchg, signal] = request.security(sym, timeframe.period, indicator_calculation()) - if not na(signal) and _time == time - rows_to_matix( - ticker_extract(array.get(new_sym_arr, i)), - format_time(_time), - str.tostring(price), - str.tostring(pchg, '#.##'), - str.tostring(vol_pchg, '#.##'), - str.tostring(signal)) - -// Scan Symbols Array -scan(new_sym_arr) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scn_tbl_show_rows - while matrix.rows(matrix) > i_scn_tbl_show_rows - matrix.remove_row(matrix, matrix.rows(matrix) - 1) - -// Draw Table -var table tbl_scan = table.new(position = i_scn_tbl_pos, columns = 5, rows = 102, border_width = 1, force_overlay = true) - -// Cells Function -cell_scan_title(int _column, int _row, string _title) => - table.cell(table_id = tbl_scan, column = _column, row = _row, text = _title, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size) - -cell_scan(col, row, txt, _text_color) => - table.cell(tbl_scan, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size) - -// Scanner Table -if barstate.islast and i_scn_show_table - // Clear existing data in the table - table.clear(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 2, end_row = 101) - - cell_scan_title(0, 0, i_scn_choose) - table.merge_cells(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 4, end_row = 0) - cell_scan_title(0, 1, 'Symbol') - cell_scan_title(1, 1, 'Time') - cell_scan_title(2, 1, 'Price') - cell_scan_title(3, 1, '%Chg') - cell_scan_title(4, 1, 'V %Chg') - - j = 4 - - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 by 1 - color txt_color = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : na - - cell_scan(0, j, matrix.get(matrix, i, 0), txt_color) - cell_scan(1, j, matrix.get(matrix, i, 1), txt_color) - cell_scan(2, j, matrix.get(matrix, i, 2), txt_color) - cell_scan(3, j, matrix.get(matrix, i, 3), txt_color) - cell_scan(4, j, matrix.get(matrix, i, 4), txt_color) - j := j + 1 - -//___________________________ Scanner End - -//___________________________ Code End - -// Read Me First -// -// Indicator Title: "Momentum Setup - RSI Directional Momentum Scanner" -// -// Overview -// - Upgraded From: "Momentum Setup: RSI Confirmed Direction Scanner". -// - Improvements: Optimized for speed, refined signals, better performance. -// -// Features -// - Scanning Methods: -// - Continuous Break: RSI breakout signals. -// - Continuous Retracement: Fibonacci retracement after break. -// - Flip Break: Failed break flips trade direction. -// - Flip Retracement: Failed retracement flips trade. -// - Divergence: Price vs. RSI divergence. -// - Hidden Divergence: Trend continuation signals. -// -// Note: Read tooltips for more clarity. -// -// Questions?: Message the author on TradingView: https://www.tradingview.com/u/Arun_K_Bhaskar/ -// -// More Indicators: Free TradingView indicators and source code on GitHub: https://github.com/ArunKBhaskar/PineScript +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=6 +indicator(title = 'Momentum Setup - RSI Directional Momentum Scanner', shorttitle = 'RSIDMScan', behind_chart = false) + +//___________________________ Menu Start + +string g_scn_tb = '█████████████████ Scanner █████████████████' + +string tt_ch = + "Continuous Break:" + + "\n• Buy: RSI crosses above 60, dips below, then breaks the previous high while staying above 60." + + "\n• Sell: RSI crosses below 40, rises above, then breaks the previous low while staying below 40." + + + "\n\n Continuous Retracement:" + + "\n• After a Continuous Break, a Fibonacci level is set." + + "\n• Buy: Price retraces to this level and bounces." + + "\n• Sell: Price retraces to this level and drops." + + + "\n\n Flip Break:" + + "\n• If a Continuous Break fails, the trade flips (Long → Short, Short → Long)." + + + "\n\n Flip Retracement:" + + "\n• If a Continuous Retracement fails, the trade flips (Long → Short, Short → Long)." + + + "\n\n Divergence:" + + "\n• Buy: Price makes a lower low, RSI makes a higher low." + + "\n• Sell: Price makes a higher high, RSI makes a lower high." + + + "\n\n Hidden Divergence (Trend continuation):" + + "\n• Buy: Price makes a higher low, RSI makes a lower low." + + "\n• Sell: Price makes a lower high, RSI makes a higher high." + +string tt_is = + "• Reads only the first 40 symbols." + + "\n• Max 4096 characters." + + "\n• Format: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_scn_choose = input.string( + defval = 'Continuous Break', + title = 'Scanning Method', + options = ['Continuous Break', 'Continuous Retracement', 'Flip Break', 'Flip Retracement', 'Divergence', 'Hidden Divergence'], tooltip = tt_ch, group = g_scn_tb) + +string i_symbols = input.text_area( + defval = 'NSE:ABCAPITAL,NSE:ABFRL,NSE:ASHOKLEY,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:BIOCON,NSE:BPCL,NSE:CESC,NSE:DELHIVERY,NSE:FEDERALBNK,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IGL,NSE:IIFL,NSE:INDUSTOWER,NSE:IOC,NSE:IREDA,NSE:IRFC,NSE:JIOFIN,NSE:LTF,NSE:MANAPPURAM,NSE:MOTHERSON,NSE:M_MFIN,NSE:NATIONALUM,NSE:NCC,NSE:NYKAA,NSE:ONGC,NSE:PETRONET,NSE:POONAWALLA,NSE:POWERGRID,NSE:RBLBANK,NSE:SAIL,NSE:TATASTEEL,NSE:UNIONBANK,NSE:ETERNAL', + title = 'Paste Symbols', tooltip = tt_is, group = g_scn_tb) + +bool i_scn_show_table = input.bool(defval = true, title = 'Display Table', group = g_scn_tb) +bool i_scn_show_long = input.bool(defval = true, title = 'Long Signals', inline = 'tb_2', group = g_scn_tb) +bool i_scn_show_short = input.bool(defval = true, title = 'Short Signals', inline = 'tb_2', group = g_scn_tb) + +int i_scn_tbl_show_rows = input.int(defval = 12, title = 'Display Rows', minval = 0, maxval = 100, group = g_scn_tb) +string i_scn_tbl_pos = input.string(defval = position.bottom_left, title = 'Table Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_scn_tb) +string i_scn_tbl_txt_size = input.string(defval = size.small, title = 'Table Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_scn_tb) + +string g_rsi = '██████████ Relative Strength Index (RSI) ██████████' +string tt_ret_fib = + "• 0: Bottom of bullish & top of bearish breaking candle." + + "\n• 1: Top of bullish & bottom of bearish breaking candle." + + "\n• 0.5: 50% of the breaking candle." +int i_rsi_len = input.int(defval = 14, title = 'RSI Length', minval = 1, group = g_rsi) +float i_rsi_src = input.source(defval = close, title = 'RSI Source', group = g_rsi) +int i_rsi_ma_len = input.int(defval = 14, title = 'SMA Length', minval = 1, group = g_rsi) +float i_rsi_fib_val = input.float(defval = 0.5, title = 'Fib Value', step = 0.1, tooltip = tt_ret_fib, group = g_rsi) +bool i_rsi_show_bull = input.bool(defval = true, title = 'Display Bullish Divergence', group = g_rsi) +bool i_rsi_show_bear = input.bool(defval = true, title = 'Display Bearish Divergence', group = g_rsi) +bool i_rsi_show_hbull = input.bool(defval = true, title = 'Display Hidden Bullish Divergence', group = g_rsi) +bool i_rsi_show_hbear = input.bool(defval = true, title = 'Display Hidden Bearish Divergence', group = g_rsi) +int i_rsi_p_right = input.int(defval = 5, title = 'Pivot Lookback Right', group = g_rsi) +int i_rsi_p_left = input.int(defval = 5, title = 'Pivot Lookback Left', group = g_rsi) +int i_rsi_range_max = input.int(defval = 60, title = 'Max of Lookback Range', group = g_rsi) +int i_rsi_range_min = input.int(defval = 5, title = 'Min of Lookback Range', group = g_rsi) + +string g_af = '██████████████ Additional Fiters ██████████████' + +string tt_pchg = + "• Percentage change of the day." +string tt_vpchg = + "• 0% means today's volume must exceed the previous day's." + + "\n• 300%+ often signals a major breakout (today or next day)." +string tt_atr = "• Filters out longer or more volatile signal candles." +string tt_atr_mul = "• Higher values filter longer or more volatile candles." +string tt_bf = "• 80 means the body covers 80%+ of the candle." +string tt_bs = "• 2 means the candle is twice the size of the previous one." +string tt_vol = "• Filter candles with volume > SMA of volume." +string tt_rv = "• Filter candles with volume > Relative Volume." +string tt_tf = "• Filter signals within a given time." +string tt_df = "• Filter signals on specified dates (for Break Candles (2) only)." + +bool i_pchg_filter = input.bool(defval = false, title = 'Apply % Change Filter', tooltip = tt_pchg, group = g_af) +float i_pchg_above_below = input.float(defval = 2, title = '% Change Above/Below +/-', minval = 0, group = g_af) + +bool i_vol_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vpchg, group = g_af) +int i_vol_above = input.int(defval = 500000, title = 'Volume Above', minval = 0, group = g_af) + +bool i_vol_pchg_filter = input.bool(defval = false, title = 'Apply Volume % Change Filter', tooltip = tt_vpchg, group = g_af) +float i_vol_pchg_above = input.float(defval = 0, title = 'Volume % Change Above', minval = 0, group = g_af) + +bool i_atr_filter = input.bool(defval = false, title = 'Apply ATR Filter', tooltip = tt_atr, group = g_af) +int i_atr_length = input.int(defval = 14, minval = 1, title = 'ATR Length', group = g_af) +float i_atr_multi = input.float(defval = 1, title = 'ATR Multiplier', minval = 1, group = g_af) + +bool i_body_filter = input.bool(defval = false, title = 'Apply Body % Filter', tooltip = tt_bf, group = g_af) +float i_body_percent = input.float(defval = 70, title = 'Body % Above', minval = 0, maxval = 100, group = g_af) / 100 + +bool i_body_size_filter = input.bool(defval = false, title = 'Apply Body Size Filter', tooltip = tt_bs, group = g_af) +int i_body_size_multi = input.int(defval = 2, title = 'Body Size Multiplier (x)', minval = 0, group = g_af) + +bool i_volume_filter = input.bool(defval = false, title = 'Apply Volume Filter', tooltip = tt_vol, group = g_af) +int i_vol_sma_length = input.int(defval = 20, minval = 1, title = 'Volume SMA Length', group = g_af) + +bool i_rel_vol_filter = input.bool(defval = false, title = 'Apply Relative Volume Filter', tooltip = tt_rv, group = g_af) +int i_rel_vol_avg_vol_len = input.int(defval = 90, title = 'Relative Volume Length', minval = 2, group = g_af) +float i_rel_vol_avg_vol_multi = input.float(defval = 5, title = 'Rel Vol SMA Multiplier', minval = 0, group = g_af) + +bool i_time_filter = input.bool(defval = false, title = 'Apply Time Filter', tooltip = tt_tf, group = g_af) +int i_hour_1 = input.int(defval = 9, minval = 0, title = 'Time From', inline = 't_1', group = g_af) +int i_minute_1 = input.int(defval = 15, minval = 0, title = ':', inline = 't_1', group = g_af) +int i_hour_2 = input.int(defval = 10, minval = 0, title = 'Time To ', inline = 't_2', group = g_af) +int i_minute_2 = input.int(defval = 15, minval = 0, title = ':', inline = 't_2', group = g_af) + +bool i_date_filter = input.bool(defval = false, title = 'Apply Date Filter', tooltip = tt_df, group = g_af) +int i_day = input.int(defval = 25, minval = 1, maxval = 31, title = 'Day', group = g_af) +int i_month = input.int(defval = 10, minval = 1, maxval = 12, title = 'Month', group = g_af) +int i_year = input.int(defval = 2024, minval = 0, title = 'Year', group = g_af) + +string g_cum = '█████████████ Performance Table █████████████' +bool i_cum_tbl_disp = input.bool(defval = true, title = 'Display', group = g_cum) +string i_cum_tbl_pos = input.string(defval = position.bottom_right, title = 'Position', options = [position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group = g_cum) +string i_cum_tbl_size = input.string(defval = size.normal, title = 'Size', options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group = g_cum) + +//string g_ch = '█████████████████ Colors █████████████████' +color i_pos_color = #089981 //input.color(defval = #089981, title = 'Positive', group = g_ch) +color i_pos_light_color = #70CCBD //input.color(defval = #70CCBD, title = 'Positive Light', group = g_ch) +color i_neg_light_color = #FAA1A4 //input.color(defval = #FAA1A4, title = 'Negative Light', group = g_ch) +color i_neg_color = #F23645 //input.color(defval = #F23645, title = 'Negative', group = g_ch) +color i_indicator_color = #2962FF //input.color(defval = #2962FF, title = 'Indicator', group = g_ch) +color i_signal_color = #FF6D00 //input.color(defval = #FF6D00, title = 'Signal', group = g_ch) +color i_neu_color = #D1D4DC //input.color(defval = #D1D4DC, title = 'Neutral Light', group = g_ch) +color i_neu_dark_color = #0F0F0F //input.color(defval = #0F0F0F, title = 'Neutral', group = g_ch) + +//___________________________ Menu End + +//___________________________ Performance Start + +is_new_day = ta.change(time('D')) != 0 + +// Cumulative Percentage Change +var float cum_pchg = na +day_pchg = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 +cum_pchg := is_new_day ? day_pchg : na(cum_pchg) ? day_pchg : cum_pchg + day_pchg + +// Cumulative Volume and Volume Percentage Change +var float curr_cum_vol = na +var float prev_cum_vol = na +if is_new_day + prev_cum_vol := curr_cum_vol + curr_cum_vol := volume + curr_cum_vol +else + curr_cum_vol := na(curr_cum_vol) ? volume : curr_cum_vol + volume + curr_cum_vol +prev_vol_safe = nz(prev_cum_vol, curr_cum_vol) +cum_vol_pchg = (curr_cum_vol - prev_vol_safe) / prev_vol_safe * 100 + +var table tbl_cum = table.new(position=i_cum_tbl_pos, columns=2, rows=4, border_width=1, force_overlay=true) + +cell_perform(col, row, txt, txt_color, aligh) => + table.cell(tbl_cum, col, row, txt, text_color=txt_color, text_halign=aligh, bgcolor=i_neu_dark_color, text_size=i_cum_tbl_size) + +if barstate.islast and i_cum_tbl_disp + pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color + vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color + prev_vol_pchg_col = prev_vol_safe < curr_cum_vol ? i_neg_color : i_pos_color + + cell_perform(0, 0, '%Chg', chart.fg_color, text.align_left) + cell_perform(1, 0, str.tostring(cum_pchg, '#.##') + ' %', pchg_col, text.align_right) + cell_perform(0, 1, 'Vol %Chg', chart.fg_color, text.align_left) + cell_perform(1, 1, str.tostring(cum_vol_pchg, '#.##') + ' %', vol_pchg_col, text.align_right) + cell_perform(0, 2, 'Vol', chart.fg_color, text.align_left) + cell_perform(1, 2, str.tostring(curr_cum_vol / 100000, '#.##') + ' L', vol_pchg_col, text.align_right) + cell_perform(0, 3, 'PD Vol', chart.fg_color, text.align_left) + cell_perform(1, 3, str.tostring(prev_vol_safe / 100000, '#.##') + ' L', prev_vol_pchg_col, text.align_right) + +//___________________________ Performance End + +//___________________________ Additional Filters Start + +// Pre-calculate common values +candle_range = high - low +body_size = math.abs(close - open) + +// Combined filter conditions +pchg_above_filter = not i_pchg_filter or cum_pchg > i_pchg_above_below +pchg_below_filter = not i_pchg_filter or cum_pchg < -i_pchg_above_below +vol_filter = not i_vol_filter or curr_cum_vol >= i_vol_above +vol_pchg_filter = not i_vol_pchg_filter or cum_vol_pchg >= i_vol_pchg_above + +// ATR Filter +atr_filter = not i_atr_filter or candle_range > ta.atr(i_atr_length) * i_atr_multi + +// Body Filters +body_filter = not i_body_filter or candle_range > 0 and body_size / candle_range >= i_body_percent +body_size_filter = not i_body_size_filter or candle_range > 0 and body_size / candle_range >= i_body_percent and candle_range >= (high[1] - low[1]) * i_body_size_multi + +// Volume Filters +volume_filter = not i_volume_filter or volume > ta.sma(volume, i_vol_sma_length) + +// Relative Volume Filter +var bool rel_vol_filter = true +if i_rel_vol_filter + average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) + relative_volume = volume / nz(average_volume[1], volume) + rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi + rel_vol_filter := relative_volume > rel_vol_sma_multiplier + +// Time Filter +time_filter = + not i_time_filter or + (hour > i_hour_1 or hour == i_hour_1 and minute >= i_minute_1) and + (hour < i_hour_2 or hour == i_hour_2 and minute < i_minute_2) + +// Date Filter +date_filter = not i_date_filter or year == i_year and month == i_month and dayofmonth == i_day + +//___________________________ Additional Filters End + +//___________________________ RSI Start + +// Acknowledgement & Reference +// Trader: 'TradingView' +// Indicator Title: Built-in Relative Strength Index, RSI Divergence Indicator + +color no_color = #00000000 + +// RSI Calculation +float rsi = ta.rsi(i_rsi_src, i_rsi_len) +float rsi_ma = ta.sma(rsi, i_rsi_ma_len) + +// RSI Plot +plot(series = rsi, title = 'RSI', color = i_indicator_color, linewidth = 2) +plot(series = rsi_ma, title = 'RSI Moving Average', color = i_signal_color) + +// RSI Bands +float overbought = 70 +float breakout = 60 +float middle = 50 +float breakdown = 40 +float oversold = 30 +hline(price = overbought, title = 'Band Overbought', color = color.new(i_neg_color, 50), linestyle = hline.style_dotted) +band_ub = hline(price = breakout, title = 'Band Bullish', color = color.new(i_neu_color, 50), linestyle = hline.style_dotted) +hline(price = middle, title = 'Band Middle', color = color.new(i_neu_color, 50), linestyle = hline.style_dotted) +band_lb = hline(price = breakdown, title = 'Band Bearish', color = color.new(i_neu_color, 50), linestyle = hline.style_dotted) +hline(price = oversold, title = 'Band Oversold', color = color.new(i_pos_color, 50), linestyle = hline.style_dotted) +fill(hline1 = band_ub, hline2 = band_lb, color = color.new(i_neu_color, 95), title = 'Fill Middle') + +// Divergence Calculation +_inRange(cond) => + bars = ta.barssince(cond) + i_rsi_range_min <= bars and bars <= i_rsi_range_max + +bool plFound = not na(ta.pivotlow(rsi, i_rsi_p_left, i_rsi_p_right)) +bool phFound = not na(ta.pivothigh(rsi, i_rsi_p_left, i_rsi_p_right)) +float rsiLBR = rsi[i_rsi_p_right] +float lowLBR = low[i_rsi_p_right] +float highLBR = high[i_rsi_p_right] + +// Bull Divergence +rsiHL = rsiLBR > ta.valuewhen(plFound, rsiLBR, 1) and _inRange(plFound[1]) +priceLL = lowLBR < ta.valuewhen(plFound, lowLBR, 1) +bullDiv = i_scn_choose == 'Divergence' and i_rsi_show_bull and priceLL and rsiHL and plFound + +// Bear Divergence +rsiLH = rsiLBR < ta.valuewhen(phFound, rsiLBR, 1) and _inRange(phFound[1]) +priceHH = highLBR > ta.valuewhen(phFound, highLBR, 1) +bearDiv = i_scn_choose == 'Divergence' and i_rsi_show_bear and priceHH and rsiLH and phFound + +// Hidden Bullish +rsiLL = rsiLBR < ta.valuewhen(plFound, rsiLBR, 1) and _inRange(plFound[1]) +priceHL = lowLBR > ta.valuewhen(plFound, lowLBR, 1) +hiddenBullDiv = i_scn_choose == 'Hidden Divergence' and i_rsi_show_hbull and priceHL and rsiLL and plFound + +// Hidden Bearish +rsiHH = rsiLBR > ta.valuewhen(phFound, rsiLBR, 1) and _inRange(phFound[1]) +priceLH = highLBR < ta.valuewhen(phFound, highLBR, 1) +hiddenBearDiv = i_scn_choose == 'Hidden Divergence' and i_rsi_show_hbear and priceLH and rsiHH and phFound + +// Divergence Plots +// Underlay +plot(i_scn_choose == 'Divergence' and plFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Bull Div', color = bullDiv ? i_pos_color : no_color, linewidth = 2, display = display.pane, editable = i_rsi_show_bull) +//plotshape(bullDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Bull Div", text=" Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, editable=i_rsi_show_bull) +plot(i_scn_choose == 'Divergence' and phFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Bear Div', color = bearDiv ? i_neg_color : no_color, linewidth = 2, display = display.pane, editable = i_rsi_show_bear) +//plotshape(bearDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Bear Div", text=" Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, editable=i_rsi_show_bear) +// Overlay +plot(i_scn_choose == 'Divergence' and plFound ? lowLBR : na, offset = -i_rsi_p_right, title = 'Line Bull Div Over', color = bullDiv ? i_pos_color : no_color, linewidth = 2, display = display.pane, force_overlay = true) +//plotshape(bullDiv ? lowLBR : na, offset=-i_rsi_p_right, title="Label Bull Div Over", text=" Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, force_overlay=true) +plot(i_scn_choose == 'Divergence' and phFound ? highLBR : na, offset = -i_rsi_p_right, title = 'Line Bear Div Over', color = bearDiv ? i_neg_color : no_color, linewidth = 2, display = display.pane, force_overlay = true) +//plotshape(bearDiv ? highLBR : na, offset=-i_rsi_p_right, title="Label Bear Div Over", text=" Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, force_overlay=true) + +// Underlay +plot(i_scn_choose == 'Hidden Divergence' and plFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bull Div', color = hiddenBullDiv ? i_pos_color : no_color, display = display.pane, editable = i_rsi_show_hbull) +//plotshape(hiddenBullDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bull Div", text=" H Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, editable=i_rsi_show_hbull) +plot(i_scn_choose == 'Hidden Divergence' and phFound ? rsiLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bear Div', color = hiddenBearDiv ? i_neg_color : no_color, display = display.pane, editable = i_rsi_show_hbear) +//plotshape(hiddenBearDiv ? rsiLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bear Div", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, editable=i_rsi_show_hbear) +// Overlay +plot(i_scn_choose == 'Hidden Divergence' and plFound ? lowLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bull Div Over', color = hiddenBullDiv ? i_pos_color : no_color, display = display.pane, force_overlay = true) +//plotshape(hiddenBullDiv ? lowLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bull Div Over", text=" H Bull ", style=shape.labelup, location=location.absolute, color=i_pos_color, textcolor=i_neu_color, force_overlay=true) +plot(i_scn_choose == 'Hidden Divergence' and phFound ? highLBR : na, offset = -i_rsi_p_right, title = 'Line Hidden Bear Div Over', color = hiddenBearDiv ? i_neg_color : no_color, display = display.pane, force_overlay = true) +//plotshape(hiddenBearDiv ? highLBR : na, offset=-i_rsi_p_right, title="Label Hidden Bear Div Over", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=i_neg_color, textcolor=i_neu_color, force_overlay=true) + +//___________________________ RSI End + +//___________________________ Signals Start + +// Acknowledgement & Reference +// Trader: 'vitvlkv' +// Indicator Title: 'HOWTO: cond1 + cond2 = alert once' +// Indicator Link: 'https://www.tradingview.com/script/UHkEyCV3-HOWTO-cond1-cond2-alert-once/' + +// State Machine for Continuous Signals +var int state = 0 +state := nz(state[1]) == 3 or nz(state[1]) == 6 ? 0 : nz(state[1]) + +// Short Conditions +bool short_1 = + ta.crossunder(rsi, breakdown) and + rsi < rsi_ma and + (state == 0 or state >= 4 and state <= 5) + +var float short_1_low = na +var float short_1_rsi = na +var int short_1_bar = na +if short_1 + short_1_low := low + short_1_rsi := rsi + short_1_bar := bar_index + +bool short_2 = rsi > breakdown + +bool short_3 = + not na(short_1_low) and + rsi < breakdown and + rsi < rsi_ma and + close < short_1_low and + //ta.crossunder(close, short_1_low) and + pchg_above_filter and + pchg_below_filter and + vol_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + date_filter and + barstate.isconfirmed + +// Long Conditions +long_1 = + ta.crossover(rsi, breakout) and + rsi > rsi_ma and + (state == 0 or state >= 1 and state <= 2) + +var float long_1_high = na +var float long_1_rsi = na +var int long_1_bar = na +if long_1 + long_1_high := high + long_1_rsi := rsi + long_1_bar := bar_index + +long_2 = rsi < breakout + +long_3 = + not na(long_1_high) and + rsi > breakout and + rsi > rsi_ma and + close > long_1_high and + //ta.crossover(close, long_1_high) and + pchg_above_filter and + pchg_below_filter and + vol_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + date_filter and + barstate.isconfirmed + +// State Transitions +if short_1 + state := 1 +else if short_2 and state == 1 + state := 2 +else if short_3 and state == 2 + state := 3 +else if long_1 + state := 4 +else if long_2 and state == 4 + state := 5 +else if long_3 and state == 5 + state := 6 + +// Continuous Signals +short_cont_break = state == 3 +long_cont_break = state == 6 + +//___________________________ Continuous Retracement Signals + +// Fibonacci Levels for Continuous Signals +var float short_signal_high = na +var float short_signal_low = na +var int short_signal_bar = na +var float long_signal_high = na +var float long_signal_low = na +var int long_signal_bar = na + +if short_cont_break + short_signal_high := high + short_signal_low := low + short_signal_bar := bar_index + +if long_cont_break + long_signal_high := high + long_signal_low := low + long_signal_bar := bar_index + +short_fib_val = + not na(short_signal_high) and not na(short_signal_low) ? + short_signal_high - (short_signal_high - short_signal_low) * i_rsi_fib_val : na + +long_fib_val = + not na(long_signal_high) and not na(long_signal_low) ? + long_signal_low + (long_signal_high - long_signal_low) * i_rsi_fib_val : na + +// Continuous Retracement Signals +var bool short_active = false +var bool long_active = false +var bool short_cont_ret_done = false +var bool long_cont_ret_done = false +var int short_ret_bar = na +var float short_ret_high = na +var int long_ret_bar = na +var float long_ret_low = na + +if short_cont_break + short_active := true + long_active := false + short_cont_ret_done := false + long_cont_ret_done := false + +if long_cont_break + long_active := true + short_active := false + long_cont_ret_done := false + short_cont_ret_done := false + +short_cont_ret = + short_active and + not short_cont_ret_done and + not na(short_fib_val) and + ta.crossover(high, short_fib_val) and + high[1] < short_fib_val + +long_cont_ret = + long_active and + not long_cont_ret_done and + not na(long_fib_val) and + ta.crossunder(low, long_fib_val) and + low[1] > long_fib_val + +if short_cont_ret + short_cont_ret_done := true + short_ret_bar := bar_index + short_ret_high := high +if long_cont_ret + long_cont_ret_done := true + long_ret_bar := bar_index + long_ret_low := low + +//___________________________ Flip Signals + +// Acknowledgement & Reference +// Trader: 'vitvlkv' +// Indicator Title: 'HOWTO: Skip consecutive signals' +// Indicator Link: 'https://www.tradingview.com/script/2M9I2sgP-HOWTO-Skip-consecutive-signals/' + +exrem(bool cond1, bool cond2) => + var int signal = 0 + signal := cond1 ? 1 : cond2 ? -1 : signal[1] + bool entry = signal != signal[1] + [entry and signal == 1, entry and signal == -1] + +[long_flip_break, short_flip_break] = exrem(long_cont_break, short_cont_break) +[long_flip_ret, short_flip_ret] = exrem(long_cont_ret, short_cont_ret) + +//___________________________ Plot Signal + +choice_cont_ln = i_scn_choose == 'Continuous Break' +choice_cont_ret_ln = i_scn_choose == 'Continuous Retracement' + +choice_cont = i_scn_choose == 'Continuous Break' or i_scn_choose == 'Continuous Retracement' +choice_cont_ret = i_scn_choose == 'Continuous Retracement' +choice_flip = i_scn_choose == 'Flip Break' +choice_flip_ret = i_scn_choose == 'Flip Retracement' + +// Line Instances +f_drawLine(id, x1, y1, x2, y2, col) => + line.new(x1, y1, x2, y2, color=col, style=line.style_dotted, force_overlay=true) + +var line short_line_1 = na +var line short_line_2 = na +var line long_line_1 = na +var line long_line_2 = na + +if short_cont_break and choice_cont_ln and not na(short_1_low) and not na(short_signal_low) and not na(short_1_bar) and not na(short_signal_bar) + short_line_1 := f_drawLine(short_line_1, short_1_bar, short_1_low, short_signal_bar, short_1_low, i_neg_color) + +if short_cont_ret and choice_cont_ret_ln and not na(short_fib_val) and not na(short_ret_high) and not na(short_signal_bar) and not na(short_ret_bar) + short_line_2 := f_drawLine(short_line_2, short_signal_bar, short_fib_val, short_ret_bar, short_fib_val, i_neg_color) + +if long_cont_break and choice_cont_ln and not na(long_1_high) and not na(long_signal_high) and not na(long_1_bar) and not na(long_signal_bar) + long_line_1 := f_drawLine(long_line_1, long_1_bar, long_1_high, long_signal_bar, long_1_high, i_pos_color) + +if long_cont_ret and choice_cont_ret_ln and not na(long_fib_val) and not na(long_ret_low) and not na(long_signal_bar) and not na(long_ret_bar) + long_line_2 := f_drawLine(long_line_2, long_signal_bar, long_fib_val, long_ret_bar, long_fib_val, i_pos_color) + +// Continuous 1st Alert +plotshape(i_scn_show_short and choice_cont ? short_1 : false, title = 'Cont 1st Short', style = shape.circle, location = location.abovebar, color = i_neg_light_color, size = size.auto, force_overlay = true) +plotshape(i_scn_show_long and choice_cont ? long_1 : false, title = 'Cont 1st Long', style = shape.circle, location = location.belowbar, color = i_pos_light_color, size = size.auto, force_overlay = true) +barcolor(i_scn_show_short and choice_cont and short_1 ? i_neg_light_color : i_scn_show_long and choice_cont and long_1 ? i_pos_light_color : na, title = 'Cont 1st Candle') +//bgcolor(i_scn_show_short and choice_cont and short_1 ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_cont and long_1 ? color.new(i_pos_light_color, 90) : na, title="Cont 1st Bgcolor") + +// Continuous 2nd Breakout +plotshape(i_scn_show_short and choice_cont ? short_cont_break : false, title = 'Cont 2nd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '2', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) +plotshape(i_scn_show_long and choice_cont ? long_cont_break : false, title = 'Cont 2nd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '2', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) +barcolor(i_scn_show_short and choice_cont and short_cont_break ? i_neg_light_color : i_scn_show_long and choice_cont and long_cont_break ? i_pos_light_color : na, title = 'Cont 2nd Candle') +bgcolor(i_scn_show_short and choice_cont and short_cont_break ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_cont and long_cont_break ? color.new(i_pos_light_color, 90) : na, title = 'Cont 2nd Bgcolor') + +// Continuous 3rd Retracement +plotshape(i_scn_show_short and choice_cont_ret ? short_cont_ret : false, title = 'Cont 3rd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '3', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) +plotshape(i_scn_show_long and choice_cont_ret ? long_cont_ret : false, title = 'Cont 3rd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '3', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) +barcolor(i_scn_show_short and choice_cont_ret and short_cont_ret ? i_neg_light_color : i_scn_show_long and choice_cont_ret and long_cont_ret ? i_pos_light_color : na, title = 'Cont 3rd Candle') +bgcolor(i_scn_show_short and choice_cont_ret and short_cont_ret ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_cont_ret and long_cont_ret ? color.new(i_pos_light_color, 90) : na, title = 'Cont 3rd Bgcolor') + +// Flip 2nd Breakout +plotshape(i_scn_show_short and choice_flip ? short_flip_break : false, title = 'Flip 2nd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '2', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) +plotshape(i_scn_show_long and choice_flip ? long_flip_break : false, title = 'Flip 2nd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '2', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) +barcolor(i_scn_show_short and choice_flip and short_flip_break ? i_neg_light_color : i_scn_show_long and choice_flip and long_flip_break ? i_pos_light_color : na, title = 'Flip 2nd Candle') +bgcolor(i_scn_show_short and choice_flip and short_flip_break ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_flip and long_flip_break ? color.new(i_pos_light_color, 90) : na, title = 'Flip 2nd Bgcolor') + +// Flip 3rd Retracement +plotshape(i_scn_show_short and choice_flip_ret ? short_flip_ret : false, title = 'Flip 3rd Short', style = shape.triangledown, location = location.abovebar, color = i_neg_light_color, text = '3', textcolor = i_neg_light_color, size = size.auto, force_overlay = true) +plotshape(i_scn_show_long and choice_flip_ret ? long_flip_ret : false, title = 'Flip 3rd Long', style = shape.triangleup, location = location.belowbar, color = i_pos_light_color, text = '3', textcolor = i_pos_light_color, size = size.auto, force_overlay = true) +barcolor(i_scn_show_short and choice_flip_ret and short_flip_ret ? i_neg_light_color : i_scn_show_long and choice_flip_ret and long_flip_ret ? i_pos_light_color : na, title = 'Flip 3rd Candle') +bgcolor(i_scn_show_short and choice_flip_ret and short_flip_ret ? color.new(i_neg_light_color, 90) : i_scn_show_long and choice_flip_ret and long_flip_ret ? color.new(i_pos_light_color, 90) : na, title = 'Flip 3rd Bgcolor') + +//___________________________ Signals End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//___________________________ Get Symbols List for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +// Feed Function +feed(input_string) => + if na(input_string) or str.length(input_string) == 0 + [string(na), string(na)] + else + result = str.split(input_string, ',') + first_item = '' + for i = 0 to array.size(result) - 1 by 1 + trimmed = str.trim(array.get(result, i)) + if trimmed != '' + first_item := trimmed + break + remaining = str.replace(input_string, first_item + ',', '', 1) + [first_item, remaining] + +// Flexible Symbol Extraction +sym_split_arr = str.split(effective_symbols, ',') +new_sym_arr = array.new_string(array.size(sym_split_arr), na) +for i = 0 to array.size(sym_split_arr) - 1 by 1 + trimmed = str.trim(array.get(sym_split_arr, i)) + if trimmed != '' + array.set(new_sym_arr, i, trimmed) + +// Assign symbols dynamically +t_01 = array.size(new_sym_arr) > 0 ? array.get(new_sym_arr, 0) : na +t_02 = array.size(new_sym_arr) > 1 ? array.get(new_sym_arr, 1) : na +t_03 = array.size(new_sym_arr) > 2 ? array.get(new_sym_arr, 2) : na +t_04 = array.size(new_sym_arr) > 3 ? array.get(new_sym_arr, 3) : na +t_05 = array.size(new_sym_arr) > 4 ? array.get(new_sym_arr, 4) : na +t_06 = array.size(new_sym_arr) > 5 ? array.get(new_sym_arr, 5) : na +t_07 = array.size(new_sym_arr) > 6 ? array.get(new_sym_arr, 6) : na +t_08 = array.size(new_sym_arr) > 7 ? array.get(new_sym_arr, 7) : na +t_09 = array.size(new_sym_arr) > 8 ? array.get(new_sym_arr, 8) : na +t_10 = array.size(new_sym_arr) > 9 ? array.get(new_sym_arr, 9) : na +t_11 = array.size(new_sym_arr) > 10 ? array.get(new_sym_arr, 10) : na +t_12 = array.size(new_sym_arr) > 11 ? array.get(new_sym_arr, 11) : na +t_13 = array.size(new_sym_arr) > 12 ? array.get(new_sym_arr, 12) : na +t_14 = array.size(new_sym_arr) > 13 ? array.get(new_sym_arr, 13) : na +t_15 = array.size(new_sym_arr) > 14 ? array.get(new_sym_arr, 14) : na +t_16 = array.size(new_sym_arr) > 15 ? array.get(new_sym_arr, 15) : na +t_17 = array.size(new_sym_arr) > 16 ? array.get(new_sym_arr, 16) : na +t_18 = array.size(new_sym_arr) > 17 ? array.get(new_sym_arr, 17) : na +t_19 = array.size(new_sym_arr) > 18 ? array.get(new_sym_arr, 18) : na +t_20 = array.size(new_sym_arr) > 19 ? array.get(new_sym_arr, 19) : na +t_21 = array.size(new_sym_arr) > 20 ? array.get(new_sym_arr, 20) : na +t_22 = array.size(new_sym_arr) > 21 ? array.get(new_sym_arr, 21) : na +t_23 = array.size(new_sym_arr) > 22 ? array.get(new_sym_arr, 22) : na +t_24 = array.size(new_sym_arr) > 23 ? array.get(new_sym_arr, 23) : na +t_25 = array.size(new_sym_arr) > 24 ? array.get(new_sym_arr, 24) : na +t_26 = array.size(new_sym_arr) > 25 ? array.get(new_sym_arr, 25) : na +t_27 = array.size(new_sym_arr) > 26 ? array.get(new_sym_arr, 26) : na +t_28 = array.size(new_sym_arr) > 27 ? array.get(new_sym_arr, 27) : na +t_29 = array.size(new_sym_arr) > 28 ? array.get(new_sym_arr, 28) : na +t_30 = array.size(new_sym_arr) > 29 ? array.get(new_sym_arr, 29) : na +t_31 = array.size(new_sym_arr) > 30 ? array.get(new_sym_arr, 30) : na +t_32 = array.size(new_sym_arr) > 31 ? array.get(new_sym_arr, 31) : na +t_33 = array.size(new_sym_arr) > 32 ? array.get(new_sym_arr, 32) : na +t_34 = array.size(new_sym_arr) > 33 ? array.get(new_sym_arr, 33) : na +t_35 = array.size(new_sym_arr) > 34 ? array.get(new_sym_arr, 34) : na +t_36 = array.size(new_sym_arr) > 35 ? array.get(new_sym_arr, 35) : na +t_37 = array.size(new_sym_arr) > 36 ? array.get(new_sym_arr, 36) : na +t_38 = array.size(new_sym_arr) > 37 ? array.get(new_sym_arr, 37) : na +t_39 = array.size(new_sym_arr) > 38 ? array.get(new_sym_arr, 38) : na +t_40 = array.size(new_sym_arr) > 39 ? array.get(new_sym_arr, 39) : na + +//___________________________ Get Symbols List for Screener End + +//___________________________ Scanner Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Scanner Conditions +bool short_cond = + i_scn_choose == 'Continuous Break' ? short_cont_break : + i_scn_choose == 'Continuous Retracement' ? short_cont_ret : + i_scn_choose == 'Flip Break' ? short_flip_break : + i_scn_choose == 'Flip Retracement' ? short_flip_ret : + i_scn_choose == 'Divergence' ? bearDiv : hiddenBearDiv + +bool long_cond = + i_scn_choose == 'Continuous Break' ? long_cont_break : + i_scn_choose == 'Continuous Retracement' ? long_cont_ret : + i_scn_choose == 'Flip Break' ? long_flip_break : + i_scn_choose == 'Flip Retracement' ? long_flip_ret : + i_scn_choose == 'Divergence' ? bullDiv : hiddenBullDiv + +// Indicator Calculation Function +indicator_calculation() => + // Declare variables with var for persistence + var float price = na + var int _time = na + var float pchg = na + var float vol_pchg = na + var int signal = na + + if barstate.isconfirmed + // Single-line signal assignment + signal := i_scn_show_long and long_cond ? 1 : i_scn_show_short and short_cond ? -1 : na + + if not na(signal) + price := math.round_to_mintick(close) + _time := time + pchg := cum_pchg + vol_pchg := cum_vol_pchg + vol_pchg + + [_time, price, pchg, vol_pchg, signal] + +// Time Formatting Function +format_time(x) => + str.format_time(x, timeframe.isintraday ? 'HH:mm dd-MM-yyyy' : 'dd-MM-yyyy', syminfo.timezone) + +// Symbol Extraction Function +ticker_extract(s) => + array.get(str.split(s, ':'), 1) + +// Matrix setup +var matrix = matrix.new(0, 6, na) + +// Add Rows Function +rows_to_matix(symbol, _time, price, pchg, vol_pchg, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, pchg, vol_pchg, signal)) + +// Scanner Function +scan(new_sym_arr) => + for i = 0 to array.size(new_sym_arr) - 1 by 1 + [_time, price, pchg, vol_pchg, signal] = request.security(array.get(new_sym_arr, i), timeframe.period, indicator_calculation()) + if not na(signal) and _time == time + rows_to_matix( + ticker_extract(array.get(new_sym_arr, i)), + format_time(_time), + str.tostring(price), + str.tostring(pchg, '#.##'), + str.tostring(vol_pchg, '#.##'), + str.tostring(signal)) + +// Scan Symbols Array +scan(new_sym_arr) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scn_tbl_show_rows + while matrix.rows(matrix) > i_scn_tbl_show_rows + matrix.remove_row(matrix, matrix.rows(matrix) - 1) + +// Draw Table +var table tbl_scan = table.new(position = i_scn_tbl_pos, columns = 5, rows = 102, border_width = 1, force_overlay = true) + +// Cells Function +cell_scan_title(int _column, int _row, string _title) => + table.cell(table_id = tbl_scan, column = _column, row = _row, text = _title, text_color = i_neu_color, text_halign = text.align_center, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size) + +cell_scan(col, row, txt, _text_color) => + table.cell(tbl_scan, col, row, text = txt, text_color = _text_color, text_halign = text.align_left, bgcolor = i_neu_dark_color, text_size = i_scn_tbl_txt_size) + +// Scanner Table +if barstate.islast and i_scn_show_table + // Clear existing data in the table + table.clear(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 2, end_row = 101) + + cell_scan_title(0, 0, i_scn_choose) + table.merge_cells(table_id = tbl_scan, start_column = 0, start_row = 0, end_column = 4, end_row = 0) + cell_scan_title(0, 1, 'Symbol') + cell_scan_title(1, 1, 'Time') + cell_scan_title(2, 1, 'Price') + cell_scan_title(3, 1, '%Chg') + cell_scan_title(4, 1, 'V %Chg') + + j = 4 + + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 by 1 + color txt_color = matrix.get(matrix, i, 5) == '1' ? i_pos_color : matrix.get(matrix, i, 5) == '-1' ? i_neg_color : na + + cell_scan(0, j, matrix.get(matrix, i, 0), txt_color) + cell_scan(1, j, matrix.get(matrix, i, 1), txt_color) + cell_scan(2, j, matrix.get(matrix, i, 2), txt_color) + cell_scan(3, j, matrix.get(matrix, i, 3), txt_color) + cell_scan(4, j, matrix.get(matrix, i, 4), txt_color) + j := j + 1 + +//___________________________ Scanner End + +//___________________________ Code End + +// Read Me First +// +// Indicator Title: "Momentum Setup - RSI Directional Momentum Scanner" +// +// Overview +// - Upgraded From: "Momentum Setup: RSI Confirmed Direction Scanner". +// - Improvements: Optimized for speed, refined signals, better performance. +// +// Features +// - Scanning Methods: +// - Continuous Break: RSI breakout signals. +// - Continuous Retracement: Fibonacci retracement after break. +// - Flip Break: Failed break flips trade direction. +// - Flip Retracement: Failed retracement flips trade. +// - Divergence: Price vs. RSI divergence. +// - Hidden Divergence: Trend continuation signals. +// +// Note: Read tooltips for more clarity. +// +// Questions?: Message the author on TradingView: https://www.tradingview.com/u/Arun_K_Bhaskar/ +// +// More Indicators: Free TradingView indicators and source code on GitHub: https://github.com/ArunKBhaskar/PineScript + diff --git a/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup with Scanner.txt b/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup with Scanner.txt index 86df2de..ac33bf9 100644 --- a/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup with Scanner.txt +++ b/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup with Scanner.txt @@ -1,689 +1,913 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -indicator(title='Momentum Setup: Vijay Thakare Option Buying Scalping Setup Scanner', shorttitle='VT Scalp Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) - -//_____________________________ Menu Screener Start - -g_scrtb = '█████████████████ Screener █████████████████' - -string i_scr_choose = input.string(defval='Continuous Signals', title='Screening Method', options=['Continuous Signals', 'Flip Signals'], group=g_scrtb) - -tt_is = "• Reads only up to first 40 symbols." + - "\n• Total characters cannot exceed 4096." + - "\n• Use comma as delimiter without any space." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:NIFTY,NSE:NIFTYJR,NSE:BANKNIFTY,NSE:CNXFINANCE,NSE:NIFTY_MID_SELECT,BSE:SENSEX,BSE:SNSX50,BSE:BANK,NSE:ASHOKLEY,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:CANBK,NSE:COALINDIA,NSE:ENGINERSIN,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IRCON,NSE:IRFC,NSE:JSWINFRA,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:ONGC,NSE:PFC,NSE:PNB,NSE:POWERGRID,NSE:RAILTEL,NSE:RVNL,NSE:SAIL,NSE:SJVN,NSE:UNIONBANK,NSE:VEDL,NSE:ZEEL,NSE:ZOMATO", - title="Paste Symbols", tooltip=tt_is, group=g_scrtb) - -string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Long', 'Short'], inline='tb_1', group=g_scrtb) -bool i_scr_show_bull = input.bool(defval=true, title='Only Long', inline='tb_2', group=g_scrtb) -bool i_scr_show_bear = input.bool(defval=true, title='Only Short', inline='tb_2', group=g_scrtb) - -int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) -string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) -string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) - -//_____________________________ Menu Screener End - -//_____________________________ Menu Indicators Start - -g_st = '█████████████████ Supertrend █████████████████' -//bool i_st_display = input.bool(defval=true, title='Display', group=g_st) -int i_st_atr_period = input.int(defval=10, title="ATR Length", minval=1, group=g_st) -float i_st_factor = input.float(defval=3.0, title="Factor", minval=0.01, step=0.01, group=g_st) - -gp_ma = '████████ Exponential Moving Average (EMA) ████████' -bool i_ma_display = input.bool(defval=true, title='Display', group=gp_ma) -int i_ma_len_1 = input.int(defval=20, title='Length', minval=1, group=gp_ma) -int i_ma_len_2 = input.int(defval=50, title='Length', minval=1, group=gp_ma) -int i_ma_len_3 = input.int(defval=100, title='Length', minval=1, group=gp_ma) -int i_ma_len_4 = input.int(defval=200, title='Length', minval=1, group=gp_ma) - -g_vwap = '████████████████ VWAP / TWAP ████████████████' -tt_vt = "• Choose TWAP if Volume is not available for the Symbol." -bool i_vtwap_display = input.bool(defval=true, title='Display', group=g_vwap) -string i_vtwap_choice = input.string(defval = "VWAP", title="Choose", options=["VWAP", "TWAP"], tooltip=tt_vt, group=g_vwap) -string i_vtwap_timeframe = input.timeframe(defval = "1D", title = "Timeframe", group=g_vwap) - -g_macd = '███████████████████ MACD ███████████████████' -bool i_macd_display = input.bool(defval=true, title='Display', group=g_macd) -int i_macd_fast_len = input.int(defval=3, title='Fast Length', minval=1, group=g_macd) -int i_macd_slow_len = input.int(defval=9, title='Slow Length', minval=1, group=g_macd) -int i_macd_signal_len = input.int(defval=15, title='Signal Smoothing', minval=1, group=g_macd) -float i_macd_voffset = input.float(defval=0.5, title='Vertical Offset', step=0.1, group=g_macd) -float i_macd_height = input.float(defval=0.7, title='Height', step=0.1, group=g_macd) - -g_stoc = '█████████████████ Stochastic █████████████████' -bool i_stoc_display = input.bool(defval=true, title='Display', group=g_stoc) -int i_stoc_k_len = input.int(defval=5, title='%K Length', minval=1, group=g_stoc) -int i_stoc_k_smooth = input.int(defval=3, title='%K Smoothing', minval=1, group=g_stoc) -int i_stoc_d_smooth = input.int(defval=3, title='%D Smoothing', minval=1, group=g_stoc) -int i_stoc_over_bought = input.int(defval=60, title='Over Bought', minval=1, group=g_stoc) -int i_stoc_over_sold = input.int(defval=40, title='Over Sold', minval=1, group=g_stoc) -float i_stoc_voffset = input.float(defval=1.8, title='Vertical Offset', step=0.1, group=g_stoc)// 1.1 -float i_stoc_height = input.float(defval=0.6, title='Height', step=0.1, group=g_stoc)//1.0 - -g_vol = '██████████████████ Volume ██████████████████' -bool i_vol_display = input.bool(defval=true, title='Display', inline='VOL', group=g_vol) -//int i_vol_sma_length = input.int(defval=20, title='MA Length', minval=1, group=g_vol) -string i_vol_type = input.string(defval='Regular Volume', title='Type', options=['Buying/Selling Volume', 'Regular Volume', 'None'], group = g_vol) -i_vol_hoffset = 0 -float i_vol_voffset = input.float(defval=0.5, title='Vertical Offset', step=0.1, group=g_vol) -float i_vol_height = input.float(defval=0.6, title='Height', step=0.1, group=g_vol) - -//_____________________________ Menu Indicators End - -//_____________________________ Menu Additional Fiters Start - -g_af = '███████████████ Additional Fiters ███████████████' - -tt_atr = "ATR helps filter out longer or more volatile signal candles." -tt_atr_mul = "Higher multiplier value filters a longer or more volatile signal candle." - -tt_bf = "If the input is '80', it means the body covers over 80% of the candle." - -tt_bs = '2 means the candle is 2 times larger than the previous candle.' - -tt_vol = "Filter out a candle when its volume is greater than the SMA of the volume." - -tt_rv = "Filter out a candle when its volume is greater than the Relative Volume." - -tt_tf = "Filter out a signals between the given Time." - -bool i_atr_filter = input.bool(defval=false, title='Apply ATR Filter', tooltip=tt_atr, group=g_af) -int i_atr_length = input.int(defval=14, minval=1, title='ATR Length', group=g_af) -float i_atr_multi = input.float(defval=1, title='ATR Multiplier', minval=1, group=g_af) - -bool i_body_filter = input.bool(defval=false, title='Apply Body % Filter', tooltip=tt_bf, group=g_af) -float i_body_percent = input.float(defval=80, title='Body % Above', minval=0, maxval=100, group=g_af) / 100 - -bool i_body_size_filter = input.bool(defval=false, title='Apply Body Size Filter', tooltip=tt_bs, group=g_af) -int i_body_size_multiplier = input.int(defval=2, title='Body Size Multiplier (x)', minval=0, group=g_af) - -bool i_volume_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vol, group=g_af) -int i_vol_sma_length = input.int(defval=20, minval=1, title='Volume SMA Length', group=g_af) - -bool i_rel_vol_filter = input.bool(defval=false, title='Apply Relative Volume Filter', tooltip=tt_rv, group=g_af) -int i_rel_vol_avg_vol_len = input.int(defval=90, title='Relative Volume Length', minval=2, group=g_af) -float i_rel_vol_avg_vol_multi = input.float(defval=2, title='Rel Vol SMA Multiplier', minval=0, group=g_af) - -bool i_time_filter = input.bool(defval=false, title='Apply Time Filter', tooltip=tt_tf, group=g_af) -int i_hour_1 = input.int(defval=9, minval=0, title='Time From', inline='t_1', group=g_af) -int i_minute_1 = input.int(defval=15, minval=0, title=':', inline='t_1', group=g_af) -int i_hour_2 = input.int(defval=10, minval=0, title='Time To ', inline='t_2', group=g_af) -int i_minute_2 = input.int(defval=15, minval=0, title=':', inline='t_2', group=g_af) - -//_____________________________ Menu Additional Fiters End - -//_____________________________ Chart Settings Start - -g_ch = '███████████████ Chart Settings ███████████████' -int i_display_len = input.int(defval=50, title='Display Length', minval=1, group=g_ch) -color i_pos_color = input.color(defval=#26A69A, title='Positive', group=g_ch) -color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) -color i_neu_color = input.color(defval=#D1D4DC, title='Neutral', group=g_ch) -color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) -color i_neg_color = input.color(defval=#FF5252, title='Negative', group=g_ch) -color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) -color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) - -//_____________________________ Chart Settings End - -//_____________________________ 1. EMA 20, 50, 100, 200 Start - -float ema_1 = ta.ema(close, i_ma_len_1) -float ema_2 = ta.ema(close, i_ma_len_2) -float ema_3 = ta.ema(close, i_ma_len_3) -float ema_4 = ta.ema(close, i_ma_len_4) - -plot(series=i_ma_display ? ema_1 : na, title='EMA 1', color=i_pos_color) -plot(series=i_ma_display ? ema_2 : na, title='EMA 2', color=i_indicator_color) -plot(series=i_ma_display ? ema_3 : na, title='EMA 3', color=i_signal_color) -plot(series=i_ma_display ? ema_4 : na, title='EMA 4', color=i_neg_color) - -//_____________________________ 1. EMA 20, 50, 100, 200 End - -//_____________________________ 2. VWAP / TWAP Start - -// VWAP -float vwap = na -[_vwap, _stdevUpper, _] = ta.vwap(hlc3, timeframe.change(i_vtwap_timeframe), 1) -vwap := _vwap - -// TWAP -twap(source, anchorChange) => - var prices = 0.0 - var count = 0 - - if anchorChange - prices := 0 - count := 0 - - prices += source - count += 1 - - prices / count - -twapValue = twap(ohlc4, timeframe.change(i_vtwap_timeframe)) - -vwap_twap_choice = i_vtwap_choice == "VWAP" ? vwap : twapValue -plot(series = i_vtwap_display ? vwap_twap_choice : na, title = "VWAP/TWAP", color=i_neu_color) - -//_____________________________ 2. VWAP / TWAP End - -//_____________________________ 3. MACD: 3, 9, 15 Start - -[macdLine, signalLine, histLine] = ta.macd(close, i_macd_fast_len, i_macd_slow_len, i_macd_signal_len) - -//_____________________________ 3. MACD: 3, 9, 15 End - -//_____________________________ 4. Stochastic: 5, 3, 3 Start - -float stoc_k = ta.sma(ta.stoch(close, high, low, i_stoc_k_len), i_stoc_k_smooth) -float stoc_d = ta.sma(stoc_k, i_stoc_d_smooth) - -//_____________________________ 4. Stochastic: 5, 3, 3 End - -//_____________________________ 5. Volume: 20 SMA Start - -vol_sma = ta.sma(volume, i_vol_sma_length) - -//_____________________________ 5. Volume: 20 SMA End - -//_____________________________ 6. Supertrend Start - -[supertrend, direction] = ta.supertrend(i_st_factor, i_st_atr_period) - -supertrend := barstate.isfirst ? na : supertrend -upTrend = plot(series=direction < 0 ? supertrend : na, title="Supertrend Up", color = i_pos_color, style = plot.style_linebr) -downTrend = plot(series=direction < 0 ? na : supertrend, title="Supertrend Down", color = i_neg_color, style = plot.style_linebr) -bodyMiddle = plot(series=barstate.isfirst ? na : ohlc4, title="Body Middle", display = display.none) - -fill(plot1=bodyMiddle, plot2=upTrend, color=color.new(i_pos_color, 90), fillgaps=false, display=display.none) -fill(plot1=bodyMiddle, plot2=downTrend, color=color.new(i_neg_color, 90), fillgaps=false, display=display.none) - -//_____________________________ 6. Supertrend End - -//_____________________________ Additional Filters Start - -// ATR Filter -bool atr_filter = true -if i_atr_filter - atr_filter := (high - low) > ta.atr(i_atr_length) * i_atr_multi - -// Body Percent Filter -bool body_filter = true -if i_body_filter - body_filter := (math.abs(close - open)) / (high - low) >= i_body_percent - -// Body Size Filter -bool body_size_filter = true -if i_body_size_filter - body_size_filter := (math.abs(close - open)) / (high - low) >= i_body_percent and (high - low) >= (high[1] - low[1]) * i_body_size_multiplier - -// Volume SMA Filter -bool volume_filter = true -if i_volume_filter - volume_filter := volume > ta.sma(volume, i_vol_sma_length) - -// Relative Volume Filter -average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) -relative_volume = volume / average_volume[1] -rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi - -bool rel_vol_filter = true -if i_rel_vol_filter - rel_vol_filter := relative_volume > rel_vol_sma_multiplier - -// Time Filter -bool time_filter = true -if i_time_filter - time_filter := (hour > i_hour_1 or (hour == i_hour_1 and minute >= i_minute_1)) and (hour < i_hour_2 or (hour == i_hour_2 and minute < i_minute_2)) - -//_____________________________ Additional Filters End - -//_____________________________ Retracement Signals Start -// Short Retracement Start - -// Short Condition 1 -short_ret_cont_1 = macdLine > 0 - -// Short Condition 2 -short_ret_cont_2 = - close < supertrend and - close < vwap_twap_choice and - stoc_k < i_stoc_over_bought and - stoc_k < stoc_d and - macdLine < 0 and - macdLine < signalLine and - macdLine < histLine and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - barstate.isconfirmed - -// Short Retracement Trigger -var bear_break_current_state = 0 -bear_break_previous_state = nz(bear_break_current_state[1]) -bear_break_current_state := bear_break_previous_state == 2 ? 0 : bear_break_previous_state -if short_ret_cont_1 and bear_break_current_state == 0 - bear_break_current_state := 1 -if short_ret_cont_2 and bear_break_current_state == 1 - bear_break_current_state := 2 - -short_ret_trigger = bear_break_current_state == 2 ? true : false - -//___________________________ Short Retracement End - -//___________________________ Long Retracement Start -// Long Retracement Start - -// Long Condition 1 -long_ret_cont_1 = macdLine < 0 - -// Long Condition 2 -long_ret_cont_2 = - close > supertrend and - close > vwap_twap_choice and - stoc_k > i_stoc_over_sold and - stoc_k > stoc_d and - macdLine > 0 and - macdLine > signalLine and - macdLine > histLine and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - barstate.isconfirmed - -// Long Retracement Trigger -var bull_break_current_state = 0 -bull_break_previous_state = nz(bull_break_current_state[1]) -bull_break_current_state := bull_break_previous_state == 2 ? 0 : bull_break_previous_state -if long_ret_cont_1 and bull_break_current_state == 0 - bull_break_current_state := 1 -if long_ret_cont_2 and bull_break_current_state == 1 - bull_break_current_state := 2 - -long_ret_trigger = bull_break_current_state == 2 ? true : false - -//___________________________ Long Retracement End - - -//_______________________ Signals End - - -//___________________________ Plot Retracements - -plotshape(series=i_scr_choose == 'Continuous Signals' and short_ret_trigger ? 3 : na, title='Short Continuous', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) -plotshape(series=i_scr_choose == 'Continuous Signals' and long_ret_trigger ? 3 : na, title='Long Continuous', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) - -bgcolor(color=i_scr_choose == 'Continuous Signals' and short_ret_trigger ? color.new(i_neg_light_color, 90) : i_scr_choose == 'Continuous Signals' and long_ret_trigger ? color.new(i_pos_light_color, 90) : na, title='Continuous Bgcolor', show_last=i_display_len) -barcolor(color=i_scr_choose == 'Continuous Signals' and short_ret_trigger ? i_neg_light_color : i_scr_choose == 'Continuous Signals' and long_ret_trigger ? i_pos_light_color : na, title='Continuous Candle') - -//_____________________________ Retracement Signals End - -//_____________________________ Flip Signals Start - -// Signal Generation Function -exrem(condition_1, condition_2) => - var entry_signal = 0 - entry_signal := condition_1 ? 1 : condition_2 ? -1 : entry_signal[1] - entry = entry_signal != entry_signal[1] - long = entry and entry_signal == 1 - short = entry and entry_signal == -1 - [long, short] - -[long_entry, short_entry] = exrem(long_ret_cont_2, short_ret_cont_2) - -//___________________________ Plot Flip - -plotshape(series=i_scr_choose == 'Flip Signals' ? short_entry : na, title='Short Flip', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) -plotshape(series=i_scr_choose == 'Flip Signals' ? long_entry : na, title='Long Flip', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) - -bgcolor(color=i_scr_choose == 'Flip Signals' and short_entry ? color.new(i_neg_light_color, 90) : i_scr_choose == 'Flip Signals' and long_entry ? color.new(i_pos_light_color, 90) : na, title='Flip Bgcolor', show_last=i_display_len) -barcolor(color=i_scr_choose == 'Flip Signals' and short_entry ? i_neg_light_color : i_scr_choose == 'Flip Signals' and long_entry ? i_pos_light_color : na, title='Flip Candle') - -//plotshape(series=short_ret_cont_2, title='Short Shape', style=shape.diamond, location=location.top, color=color.new(i_neg_color, 50), size=size.tiny, display=display.none) -//plotshape(series=long_ret_cont_2, title='Long Shape', style=shape.diamond, location=location.bottom, color=color.new(i_pos_color, 50), size=size.tiny, display=display.none) - -//_____________________________ Flip Signals End - -//_____________________________ Signals End - -//_____________________________ Overlay Charts Start - -// Acknowledgement & Reference -// Trader: 'dgtrd' -// Indicator Title: 'Technical Analyst by DGT' -// Indicator Link: 'https://www.tradingview.com/script/r2kuEi0l-Technical-Analyst-by-DGT/' - -// Functions ----------------------------------------------------------------------------------- // - -f_drawLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) => - var id = label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) - label.set_text(id, _text) - label.set_tooltip(id, _tooltip) - label.set_xy(id, _x, _y) - label.set_textcolor(id, _textcolor) - -// -Calculations ================================================================================ // - -source = close -nzVolume = nz(volume) - -//------------------------------------------------------------------------------ -// Momentum : MACD Oscillator - -histColor = histLine >= 0 ? histLine[1] < histLine ? i_pos_color : i_pos_light_color : histLine[1] < histLine ? i_neg_light_color : i_neg_color - -//------------------------------------------------------------------------------ -// Volume - -volMa = ta.sma(nzVolume, i_vol_sma_length) - -B = nzVolume * (close - low) / (high - low) -S = nzVolume * (high - close) / (high - low) - -// Draw Charts -var a_lines = array.new_line() -var a_hist = array.new_box() - -//i_display_len = 50 -priceHighest = ta.highest(high, i_display_len) -priceLowest = ta.lowest (low , i_display_len) -priceChangeRate = (priceHighest - priceLowest) / priceHighest - -oscHighest = 100//ta.highest(osc, i_display_len) -macdHighest = ta.highest(macdLine, i_display_len) - ta.lowest(macdLine, i_display_len) - -volumeMARate = nzVolume / volMa -volumeHighest = ta.highest(nzVolume, i_display_len) -bullCandle = close > open - -if barstate.islast - if array.size(a_lines) > 0 - for i = 1 to array.size(a_lines) - line.delete(array.shift(a_lines)) - - if array.size(a_hist) > 0 - for i = 1 to array.size(a_hist) - box.delete(array.shift(a_hist)) - - if i_stoc_display - mid_line = math.avg(100, 0) - array.push(a_hist , box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_bought / oscHighest * priceChangeRate * i_stoc_height), - bar_index , priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_bought / oscHighest * priceChangeRate * i_stoc_height), color.new(i_neg_color , 75), 1)) - array.push(a_hist , box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_stoc_height), - bar_index , priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_stoc_height), color.new(i_neu_color , 75), 1)) - array.push(a_hist , box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_sold / oscHighest * priceChangeRate * i_stoc_height), - bar_index , priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_sold / oscHighest * priceChangeRate * i_stoc_height), color.new(i_pos_color, 75), 1)) - f_drawLabelX(bar_index + 3, priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_stoc_height), 'STOC', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.tiny, text.align_center, '%stoc_k : ' + str.tostring(stoc_k, '#.##') + '\n%stoc_d : ' + str.tostring(stoc_d, '#.##')) - - if i_macd_display - f_drawLabelX(bar_index + 3, priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + 50 / oscHighest * priceChangeRate * i_macd_height), 'MACD', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.tiny, text.align_center, '')//'macd : ' + str.tostring(macdLine, '#.##') + '\nsignal : ' + str.tostring(signalLine, '#.##')) - - if i_vol_type != 'None' - f_drawLabelX(bar_index + 3, priceHighest * (1 + priceChangeRate * i_vol_voffset), 'VOL', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.tiny, text.align_center, 'buying volume : ' + str.tostring(B / (B + S) * 100, '#.##') + '%\nselling volume : ' + str.tostring(S / (B + S) * 100, '#.##') + '%\nlast volume : ' + str.tostring(nzVolume, format.volume) + '\naverage volume : ' + str.tostring(volMa, format.volume)) - - for barIndex = 0 to i_display_len - 1 - if array.size(a_lines) < 500 - - if i_stoc_display - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_k[barIndex] / oscHighest * priceChangeRate * i_stoc_height), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_k[barIndex + 1] / oscHighest * priceChangeRate * i_stoc_height), xloc.bar_index, extend.none, i_indicator_color , line.style_solid, 1)) - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_d[barIndex] / oscHighest * priceChangeRate * i_stoc_height), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_d[barIndex + 1] / oscHighest * priceChangeRate * i_stoc_height), xloc.bar_index, extend.none, i_signal_color , line.style_solid, 1)) - - if i_macd_display - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + macdLine[barIndex] / macdHighest * priceChangeRate * i_macd_height ), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + macdLine[barIndex + 1] / macdHighest * priceChangeRate * i_macd_height ), xloc.bar_index, extend.none, i_indicator_color , line.style_solid, 1)) - array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + signalLine[barIndex] / macdHighest * priceChangeRate * i_macd_height ), - bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + signalLine[barIndex + 1] / macdHighest * priceChangeRate * i_macd_height ), xloc.bar_index, extend.none, i_signal_color , line.style_solid, 1)) - - array.push(a_hist , box.new (bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset), - bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + histLine[barIndex] / macdHighest * priceChangeRate * i_macd_height), histColor[barIndex], 2)) - - if nzVolume - if i_vol_type != 'None' - array.push(a_hist , box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), - bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height), i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_color, 0) : bullCandle[barIndex] ? color.new(i_pos_color, 0) : color.new(i_neg_color, 0), 2, bgcolor = i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_color, 0) : bullCandle[barIndex] ? color.new(i_pos_color, 0) : color.new(i_neg_color, 0))) - if i_vol_type == 'Buying/Selling Volume' - array.push(a_hist , box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), - bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + S[barIndex] / volumeHighest * priceChangeRate * i_vol_height), color.new(i_neg_color, 0), 2, bgcolor = color.new(i_neg_color, 0))) - // Voumme MA - if i_vol_display - array.push(a_lines, line.new(bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex]), - bar_index[barIndex + 1] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex + 1] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex + 1]), xloc.bar_index, extend.none, i_neu_color, line.style_solid, 1)) - -//_____________________________ Overlay Charts End - -//_____________________________ Get Symbols for Screener Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_01, out_01] = feed(i_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), -[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), -[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), -[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), -[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), -[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), -[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), -[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), -[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), -[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) - -//_____________________________ Get Symbols for Screener End - -//_____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Choose Screening Method -bear_method = - i_scr_choose == 'Continuous Signals' ? short_ret_trigger : - i_scr_choose == 'Flip Signals' ? short_entry : na - -bull_method = - i_scr_choose == 'Continuous Signals' ? long_ret_trigger : - i_scr_choose == 'Flip Signals' ? long_entry : na - -// Screener Conditions -bearish_cond = bear_method -bullish_cond = bull_method - -// Define Bull and Bear Conditions -bull = not(i_scr_direction == "Short") -bear = not(i_scr_direction == "Long") - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Short Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_bull and bearish_cond and bear - signal := -1 - - // Check for Long Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_bear and bullish_cond and bull - signal := 1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - - [_time, price, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 4, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, price, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, price, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, strPrice, strSignal) - -// Call Screener function for multiple symbols -screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), -screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), -screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), -screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), -screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), -screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_tbl_disp_rows - while matrix.rows(matrix) > i_scr_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table scr_tbl = table.new(position=i_scr_tbl_position, columns=3, rows=102, border_width=1) - -// Function to populate cells in the table -scr_cell_title(col, row, txt) => - table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor = color.new(i_neu_color, 90), text_size=i_scr_tbl_text_size) - -scr_cell(col, row, txt, color) => - table.cell(scr_tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_scr_tbl_text_size) - -// Check if it's the last bar -if barstate.islast - // Clear existing data in the table - table.clear(scr_tbl, 0, 0, 2, 101) - - scr_cell_title(0, 0, i_scr_choose) - table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=2, end_row=0) - scr_cell_title(0, 1, "Symbol") - scr_cell_title(1, 1, "Time") - scr_cell_title(2, 1, "Price") - - j = 2 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - col = matrix.get(matrix, i, 3) == "1" ? i_pos_color : - matrix.get(matrix, i, 3) == "-1" ? i_neg_color : i_neu_color - - // Populate cells in the table - scr_cell(0, j, matrix.get(matrix, i, 0), col) - scr_cell(1, j, matrix.get(matrix, i, 1), col) - scr_cell(2, j, matrix.get(matrix, i, 2), col) - - j += 1 - -//_____________________________ Screener End - -//_____________________________ Code End - -// Readme First: -// -// About: -// This is a BANKNIFTY option buying or scalping setup shared by trader Vijay S. Thakare on YouTube. -// -// Strategy Reference Video: -// Vijay Thakare at Traders Carnival Seminar: -// Video Title: "Vijay Thakare: An Excellent Option Scalper Sharing His Knowledge @ Traders Carnival" -// Video Link: https://www.youtube.com/watch?v=6INokexfeLc -// -// Explanation Video from His YouTube Channel: -// Video Title: "Setup Video" -// Video Link: https://www.youtube.com/watch?v=KK5j1dgklIY&t=9150s -// -// Strategy Type: Momentum -// Bias: Strongly Directional -// Trading Style: Scalping -// Instrument: Option - Buying -// Original Symbol: NSE:BANKNIFTY (Works with other symbols as well) -// Timeframe: 5 minute -// -// Risk Reward Ratio: 1:2 -// Stop Loss: Rs. 20 on the premium chart -// Target: Rs. 40 on the premium chart -// -// Charts Referred: -// - BANKNIFTY Futures Chart -// - BANKNIFTY Options Premium Chart -// -// Indicator Used and Settings: -// 1. EMA: Close, 20, 50, 100, 200 -// 2. VWAP: Daily VWAP -// 3. MACD: Fast Length - 3, Slow Length - 9, Signal Smoothing - 15 -// 4. Stochastic: %K Length - 5, %K Smoothing - 3, %D Smoothing - 3 -// -// Long Entry Rules: -// - Close above VWAP -// - Close above Supertrend (Not in original strategy. It avoids many false signals.) -// - MACD above 0 -// - Stochastic above 40 -// - Consider VWAP, EMA 20, 50, 100, 200 are closer to each other -// - Rising volume (optional) -// -// Short Entry Rules: -// - Close below VWAP -// - Close below Supertrend (Not in original strategy. It avoids many false signals.) -// - MACD below 0 -// - Stochastic below 60 -// - Consider VWAP, EMA 20, 50, 100, 200 are closer to each other -// - Rising volume (optional) -// -// Update 09 June 2024 -// 1. Added Supertrend filter. -// 2. Added TWAP to use it with Symbols without Volume. -// 3. Removed indicator values Table. -// 4. Two types of scanners are available. One generates continuous signals and one generates flip signals. +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +indicator(title='Momentum Setup: Vijay Thakare Option Buying Scalping Setup Scanner', shorttitle='VT Scalp Scan', overlay=true, max_bars_back=500, max_lines_count=500, max_boxes_count=500) + +//_____________________________ Menu Screener Start + +g_scrtb = '█████████████████ Screener █████████████████' + +string i_scr_choose = input.string(defval='Continuous Signals', title='Screening Method', options=['Continuous Signals', 'Flip Signals'], group=g_scrtb) + +tt_is = "• Reads only up to first 40 symbols." + + "\n• Total characters cannot exceed 4096." + + "\n• Use comma as delimiter without any space." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:NIFTY,NSE:NIFTYJR,NSE:BANKNIFTY,NSE:CNXFINANCE,NSE:NIFTY_MID_SELECT,BSE:SENSEX,BSE:SNSX50,BSE:BANK,NSE:ASHOKLEY,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:CANBK,NSE:COALINDIA,NSE:ENGINERSIN,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IRCON,NSE:IRFC,NSE:JSWINFRA,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:ONGC,NSE:PFC,NSE:PNB,NSE:POWERGRID,NSE:RAILTEL,NSE:RVNL,NSE:SAIL,NSE:SJVN,NSE:UNIONBANK,NSE:VEDL,NSE:ZEEL,NSE:ETERNAL", + title="Paste Symbols", tooltip=tt_is, group=g_scrtb) + +string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Long', 'Short'], inline='tb_1', group=g_scrtb) +bool i_scr_show_bull = input.bool(defval=true, title='Only Long', inline='tb_2', group=g_scrtb) +bool i_scr_show_bear = input.bool(defval=true, title='Only Short', inline='tb_2', group=g_scrtb) + +int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) +string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) +string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) + +//_____________________________ Menu Screener End + +//_____________________________ Menu Indicators Start + +g_st = '█████████████████ Supertrend █████████████████' +//bool i_st_display = input.bool(defval=true, title='Display', group=g_st) +int i_st_atr_period = input.int(defval=10, title="ATR Length", minval=1, group=g_st) +float i_st_factor = input.float(defval=3.0, title="Factor", minval=0.01, step=0.01, group=g_st) + +gp_ma = '████████ Exponential Moving Average (EMA) ████████' +bool i_ma_display = input.bool(defval=true, title='Display', group=gp_ma) +int i_ma_len_1 = input.int(defval=20, title='Length', minval=1, group=gp_ma) +int i_ma_len_2 = input.int(defval=50, title='Length', minval=1, group=gp_ma) +int i_ma_len_3 = input.int(defval=100, title='Length', minval=1, group=gp_ma) +int i_ma_len_4 = input.int(defval=200, title='Length', minval=1, group=gp_ma) + +g_vwap = '████████████████ VWAP / TWAP ████████████████' +tt_vt = "• Choose TWAP if Volume is not available for the Symbol." +bool i_vtwap_display = input.bool(defval=true, title='Display', group=g_vwap) +string i_vtwap_choice = input.string(defval = "VWAP", title="Choose", options=["VWAP", "TWAP"], tooltip=tt_vt, group=g_vwap) +string i_vtwap_timeframe = input.timeframe(defval = "1D", title = "Timeframe", group=g_vwap) + +g_macd = '███████████████████ MACD ███████████████████' +bool i_macd_display = input.bool(defval=true, title='Display', group=g_macd) +int i_macd_fast_len = input.int(defval=3, title='Fast Length', minval=1, group=g_macd) +int i_macd_slow_len = input.int(defval=9, title='Slow Length', minval=1, group=g_macd) +int i_macd_signal_len = input.int(defval=15, title='Signal Smoothing', minval=1, group=g_macd) +float i_macd_voffset = input.float(defval=0.5, title='Vertical Offset', step=0.1, group=g_macd) +float i_macd_height = input.float(defval=0.7, title='Height', step=0.1, group=g_macd) + +g_stoc = '█████████████████ Stochastic █████████████████' +bool i_stoc_display = input.bool(defval=true, title='Display', group=g_stoc) +int i_stoc_k_len = input.int(defval=5, title='%K Length', minval=1, group=g_stoc) +int i_stoc_k_smooth = input.int(defval=3, title='%K Smoothing', minval=1, group=g_stoc) +int i_stoc_d_smooth = input.int(defval=3, title='%D Smoothing', minval=1, group=g_stoc) +int i_stoc_over_bought = input.int(defval=60, title='Over Bought', minval=1, group=g_stoc) +int i_stoc_over_sold = input.int(defval=40, title='Over Sold', minval=1, group=g_stoc) +float i_stoc_voffset = input.float(defval=1.8, title='Vertical Offset', step=0.1, group=g_stoc)// 1.1 +float i_stoc_height = input.float(defval=0.6, title='Height', step=0.1, group=g_stoc)//1.0 + +g_vol = '██████████████████ Volume ██████████████████' +bool i_vol_display = input.bool(defval=true, title='Display', inline='VOL', group=g_vol) +//int i_vol_sma_length = input.int(defval=20, title='MA Length', minval=1, group=g_vol) +string i_vol_type = input.string(defval='Regular Volume', title='Type', options=['Buying/Selling Volume', 'Regular Volume', 'None'], group = g_vol) +i_vol_hoffset = 0 +float i_vol_voffset = input.float(defval=0.5, title='Vertical Offset', step=0.1, group=g_vol) +float i_vol_height = input.float(defval=0.6, title='Height', step=0.1, group=g_vol) + +//_____________________________ Menu Indicators End + +//_____________________________ Menu Additional Fiters Start + +g_af = '███████████████ Additional Fiters ███████████████' + +tt_atr = "ATR helps filter out longer or more volatile signal candles." +tt_atr_mul = "Higher multiplier value filters a longer or more volatile signal candle." + +tt_bf = "If the input is '80', it means the body covers over 80% of the candle." + +tt_bs = '2 means the candle is 2 times larger than the previous candle.' + +tt_vol = "Filter out a candle when its volume is greater than the SMA of the volume." + +tt_rv = "Filter out a candle when its volume is greater than the Relative Volume." + +tt_tf = "Filter out a signals between the given Time." + +bool i_atr_filter = input.bool(defval=false, title='Apply ATR Filter', tooltip=tt_atr, group=g_af) +int i_atr_length = input.int(defval=14, minval=1, title='ATR Length', group=g_af) +float i_atr_multi = input.float(defval=1, title='ATR Multiplier', minval=1, group=g_af) + +bool i_body_filter = input.bool(defval=false, title='Apply Body % Filter', tooltip=tt_bf, group=g_af) +float i_body_percent = input.float(defval=80, title='Body % Above', minval=0, maxval=100, group=g_af) / 100 + +bool i_body_size_filter = input.bool(defval=false, title='Apply Body Size Filter', tooltip=tt_bs, group=g_af) +int i_body_size_multiplier = input.int(defval=2, title='Body Size Multiplier (x)', minval=0, group=g_af) + +bool i_volume_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vol, group=g_af) +int i_vol_sma_length = input.int(defval=20, minval=1, title='Volume SMA Length', group=g_af) + +bool i_rel_vol_filter = input.bool(defval=false, title='Apply Relative Volume Filter', tooltip=tt_rv, group=g_af) +int i_rel_vol_avg_vol_len = input.int(defval=90, title='Relative Volume Length', minval=2, group=g_af) +float i_rel_vol_avg_vol_multi = input.float(defval=2, title='Rel Vol SMA Multiplier', minval=0, group=g_af) + +bool i_time_filter = input.bool(defval=false, title='Apply Time Filter', tooltip=tt_tf, group=g_af) +int i_hour_1 = input.int(defval=9, minval=0, title='Time From', inline='t_1', group=g_af) +int i_minute_1 = input.int(defval=15, minval=0, title=':', inline='t_1', group=g_af) +int i_hour_2 = input.int(defval=10, minval=0, title='Time To ', inline='t_2', group=g_af) +int i_minute_2 = input.int(defval=15, minval=0, title=':', inline='t_2', group=g_af) + +//_____________________________ Menu Additional Fiters End + +//_____________________________ Chart Settings Start + +g_ch = '███████████████ Chart Settings ███████████████' +int i_display_len = input.int(defval=50, title='Display Length', minval=1, group=g_ch) +color i_pos_color = input.color(defval=#26A69A, title='Positive', group=g_ch) +color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) +color i_neu_color = input.color(defval=#D1D4DC, title='Neutral', group=g_ch) +color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) +color i_neg_color = input.color(defval=#FF5252, title='Negative', group=g_ch) +color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) +color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) + +//_____________________________ Chart Settings End + +//_____________________________ 1. EMA 20, 50, 100, 200 Start + +float ema_1 = ta.ema(close, i_ma_len_1) +float ema_2 = ta.ema(close, i_ma_len_2) +float ema_3 = ta.ema(close, i_ma_len_3) +float ema_4 = ta.ema(close, i_ma_len_4) + +plot(series=i_ma_display ? ema_1 : na, title='EMA 1', color=i_pos_color) +plot(series=i_ma_display ? ema_2 : na, title='EMA 2', color=i_indicator_color) +plot(series=i_ma_display ? ema_3 : na, title='EMA 3', color=i_signal_color) +plot(series=i_ma_display ? ema_4 : na, title='EMA 4', color=i_neg_color) + +//_____________________________ 1. EMA 20, 50, 100, 200 End + +//_____________________________ 2. VWAP / TWAP Start + +// VWAP +float vwap = na +[_vwap, _stdevUpper, _] = ta.vwap(hlc3, timeframe.change(i_vtwap_timeframe), 1) +vwap := _vwap + +// TWAP +twap(source, anchorChange) => + var prices = 0.0 + var count = 0 + + if anchorChange + prices := 0 + count := 0 + + prices += source + count += 1 + + prices / count + +twapValue = twap(ohlc4, timeframe.change(i_vtwap_timeframe)) + +vwap_twap_choice = i_vtwap_choice == "VWAP" ? vwap : twapValue +plot(series = i_vtwap_display ? vwap_twap_choice : na, title = "VWAP/TWAP", color=i_neu_color) + +//_____________________________ 2. VWAP / TWAP End + +//_____________________________ 3. MACD: 3, 9, 15 Start + +[macdLine, signalLine, histLine] = ta.macd(close, i_macd_fast_len, i_macd_slow_len, i_macd_signal_len) + +//_____________________________ 3. MACD: 3, 9, 15 End + +//_____________________________ 4. Stochastic: 5, 3, 3 Start + +float stoc_k = ta.sma(ta.stoch(close, high, low, i_stoc_k_len), i_stoc_k_smooth) +float stoc_d = ta.sma(stoc_k, i_stoc_d_smooth) + +//_____________________________ 4. Stochastic: 5, 3, 3 End + +//_____________________________ 5. Volume: 20 SMA Start + +vol_sma = ta.sma(volume, i_vol_sma_length) + +//_____________________________ 5. Volume: 20 SMA End + +//_____________________________ 6. Supertrend Start + +[supertrend, direction] = ta.supertrend(i_st_factor, i_st_atr_period) + +supertrend := barstate.isfirst ? na : supertrend +upTrend = plot(series=direction < 0 ? supertrend : na, title="Supertrend Up", color = i_pos_color, style = plot.style_linebr) +downTrend = plot(series=direction < 0 ? na : supertrend, title="Supertrend Down", color = i_neg_color, style = plot.style_linebr) +bodyMiddle = plot(series=barstate.isfirst ? na : ohlc4, title="Body Middle", display = display.none) + +fill(plot1=bodyMiddle, plot2=upTrend, color=color.new(i_pos_color, 90), fillgaps=false, display=display.none) +fill(plot1=bodyMiddle, plot2=downTrend, color=color.new(i_neg_color, 90), fillgaps=false, display=display.none) + +//_____________________________ 6. Supertrend End + +//_____________________________ Additional Filters Start + +// ATR Filter +bool atr_filter = true +if i_atr_filter + atr_filter := (high - low) > ta.atr(i_atr_length) * i_atr_multi + +// Body Percent Filter +bool body_filter = true +if i_body_filter + body_filter := (math.abs(close - open)) / (high - low) >= i_body_percent + +// Body Size Filter +bool body_size_filter = true +if i_body_size_filter + body_size_filter := (math.abs(close - open)) / (high - low) >= i_body_percent and (high - low) >= (high[1] - low[1]) * i_body_size_multiplier + +// Volume SMA Filter +bool volume_filter = true +if i_volume_filter + volume_filter := volume > ta.sma(volume, i_vol_sma_length) + +// Relative Volume Filter +average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) +relative_volume = volume / average_volume[1] +rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi + +bool rel_vol_filter = true +if i_rel_vol_filter + rel_vol_filter := relative_volume > rel_vol_sma_multiplier + +// Time Filter +bool time_filter = true +if i_time_filter + time_filter := (hour > i_hour_1 or (hour == i_hour_1 and minute >= i_minute_1)) and (hour < i_hour_2 or (hour == i_hour_2 and minute < i_minute_2)) + +//_____________________________ Additional Filters End + +//_____________________________ Retracement Signals Start +// Short Retracement Start + +// Short Condition 1 +short_ret_cont_1 = macdLine > 0 + +// Short Condition 2 +short_ret_cont_2 = + close < supertrend and + close < vwap_twap_choice and + stoc_k < i_stoc_over_bought and + stoc_k < stoc_d and + macdLine < 0 and + macdLine < signalLine and + macdLine < histLine and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + barstate.isconfirmed + +// Short Retracement Trigger +var bear_break_current_state = 0 +bear_break_previous_state = nz(bear_break_current_state[1]) +bear_break_current_state := bear_break_previous_state == 2 ? 0 : bear_break_previous_state +if short_ret_cont_1 and bear_break_current_state == 0 + bear_break_current_state := 1 +if short_ret_cont_2 and bear_break_current_state == 1 + bear_break_current_state := 2 + +short_ret_trigger = bear_break_current_state == 2 ? true : false + +//___________________________ Short Retracement End + +//___________________________ Long Retracement Start +// Long Retracement Start + +// Long Condition 1 +long_ret_cont_1 = macdLine < 0 + +// Long Condition 2 +long_ret_cont_2 = + close > supertrend and + close > vwap_twap_choice and + stoc_k > i_stoc_over_sold and + stoc_k > stoc_d and + macdLine > 0 and + macdLine > signalLine and + macdLine > histLine and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + barstate.isconfirmed + +// Long Retracement Trigger +var bull_break_current_state = 0 +bull_break_previous_state = nz(bull_break_current_state[1]) +bull_break_current_state := bull_break_previous_state == 2 ? 0 : bull_break_previous_state +if long_ret_cont_1 and bull_break_current_state == 0 + bull_break_current_state := 1 +if long_ret_cont_2 and bull_break_current_state == 1 + bull_break_current_state := 2 + +long_ret_trigger = bull_break_current_state == 2 ? true : false + +//___________________________ Long Retracement End + + +//_______________________ Signals End + + +//___________________________ Plot Retracements + +plotshape(series=i_scr_choose == 'Continuous Signals' and short_ret_trigger ? 3 : na, title='Short Continuous', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) +plotshape(series=i_scr_choose == 'Continuous Signals' and long_ret_trigger ? 3 : na, title='Long Continuous', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) + +bgcolor(color=i_scr_choose == 'Continuous Signals' and short_ret_trigger ? color.new(i_neg_light_color, 90) : i_scr_choose == 'Continuous Signals' and long_ret_trigger ? color.new(i_pos_light_color, 90) : na, title='Continuous Bgcolor', show_last=i_display_len) +barcolor(color=i_scr_choose == 'Continuous Signals' and short_ret_trigger ? i_neg_light_color : i_scr_choose == 'Continuous Signals' and long_ret_trigger ? i_pos_light_color : na, title='Continuous Candle') + +//_____________________________ Retracement Signals End + +//_____________________________ Flip Signals Start + +// Signal Generation Function +exrem(condition_1, condition_2) => + var entry_signal = 0 + entry_signal := condition_1 ? 1 : condition_2 ? -1 : entry_signal[1] + entry = entry_signal != entry_signal[1] + long = entry and entry_signal == 1 + short = entry and entry_signal == -1 + [long, short] + +[long_entry, short_entry] = exrem(long_ret_cont_2, short_ret_cont_2) + +//___________________________ Plot Flip + +plotshape(series=i_scr_choose == 'Flip Signals' ? short_entry : na, title='Short Flip', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny) +plotshape(series=i_scr_choose == 'Flip Signals' ? long_entry : na, title='Long Flip', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny) + +bgcolor(color=i_scr_choose == 'Flip Signals' and short_entry ? color.new(i_neg_light_color, 90) : i_scr_choose == 'Flip Signals' and long_entry ? color.new(i_pos_light_color, 90) : na, title='Flip Bgcolor', show_last=i_display_len) +barcolor(color=i_scr_choose == 'Flip Signals' and short_entry ? i_neg_light_color : i_scr_choose == 'Flip Signals' and long_entry ? i_pos_light_color : na, title='Flip Candle') + +//plotshape(series=short_ret_cont_2, title='Short Shape', style=shape.diamond, location=location.top, color=color.new(i_neg_color, 50), size=size.tiny, display=display.none) +//plotshape(series=long_ret_cont_2, title='Long Shape', style=shape.diamond, location=location.bottom, color=color.new(i_pos_color, 50), size=size.tiny, display=display.none) + +//_____________________________ Flip Signals End + +//_____________________________ Signals End + +//_____________________________ Overlay Charts Start + +// Acknowledgement & Reference +// Trader: 'dgtrd' +// Indicator Title: 'Technical Analyst by DGT' +// Indicator Link: 'https://www.tradingview.com/script/r2kuEi0l-Technical-Analyst-by-DGT/' + +// Functions ----------------------------------------------------------------------------------- // + +f_drawLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) => + var id = label.new(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) + label.set_text(id, _text) + label.set_tooltip(id, _tooltip) + label.set_xy(id, _x, _y) + label.set_textcolor(id, _textcolor) + +// -Calculations ================================================================================ // + +source = close +nzVolume = nz(volume) + +//------------------------------------------------------------------------------ +// Momentum : MACD Oscillator + +histColor = histLine >= 0 ? histLine[1] < histLine ? i_pos_color : i_pos_light_color : histLine[1] < histLine ? i_neg_light_color : i_neg_color + +//------------------------------------------------------------------------------ +// Volume + +volMa = ta.sma(nzVolume, i_vol_sma_length) + +B = nzVolume * (close - low) / (high - low) +S = nzVolume * (high - close) / (high - low) + +// Draw Charts +var a_lines = array.new_line() +var a_hist = array.new_box() + +//i_display_len = 50 +priceHighest = ta.highest(high, i_display_len) +priceLowest = ta.lowest (low , i_display_len) +priceChangeRate = (priceHighest - priceLowest) / priceHighest + +oscHighest = 100//ta.highest(osc, i_display_len) +macdHighest = ta.highest(macdLine, i_display_len) - ta.lowest(macdLine, i_display_len) + +volumeMARate = nzVolume / volMa +volumeHighest = ta.highest(nzVolume, i_display_len) +bullCandle = close > open + +if barstate.islast + if array.size(a_lines) > 0 + for i = 1 to array.size(a_lines) + line.delete(array.shift(a_lines)) + + if array.size(a_hist) > 0 + for i = 1 to array.size(a_hist) + box.delete(array.shift(a_hist)) + + if i_stoc_display + mid_line = math.avg(100, 0) + array.push(a_hist , box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_bought / oscHighest * priceChangeRate * i_stoc_height), + bar_index , priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_bought / oscHighest * priceChangeRate * i_stoc_height), color.new(i_neg_color , 75), 1)) + array.push(a_hist , box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_stoc_height), + bar_index , priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_stoc_height), color.new(i_neu_color , 75), 1)) + array.push(a_hist , box.new (bar_index[i_display_len], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_sold / oscHighest * priceChangeRate * i_stoc_height), + bar_index , priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + i_stoc_over_sold / oscHighest * priceChangeRate * i_stoc_height), color.new(i_pos_color, 75), 1)) + f_drawLabelX(bar_index + 3, priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + mid_line / oscHighest * priceChangeRate * i_stoc_height), 'STOC', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.tiny, text.align_center, '%stoc_k : ' + str.tostring(stoc_k, '#.##') + '\n%stoc_d : ' + str.tostring(stoc_d, '#.##')) + + if i_macd_display + f_drawLabelX(bar_index + 3, priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + 50 / oscHighest * priceChangeRate * i_macd_height), 'MACD', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.tiny, text.align_center, '')//'macd : ' + str.tostring(macdLine, '#.##') + '\nsignal : ' + str.tostring(signalLine, '#.##')) + + if i_vol_type != 'None' + f_drawLabelX(bar_index + 3, priceHighest * (1 + priceChangeRate * i_vol_voffset), 'VOL', xloc.bar_index, yloc.price, #00000000, label.style_label_left, chart.fg_color, size.tiny, text.align_center, 'buying volume : ' + str.tostring(B / (B + S) * 100, '#.##') + '%\nselling volume : ' + str.tostring(S / (B + S) * 100, '#.##') + '%\nlast volume : ' + str.tostring(nzVolume, format.volume) + '\naverage volume : ' + str.tostring(volMa, format.volume)) + + for barIndex = 0 to i_display_len - 1 + if array.size(a_lines) < 500 + + if i_stoc_display + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_k[barIndex] / oscHighest * priceChangeRate * i_stoc_height), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_k[barIndex + 1] / oscHighest * priceChangeRate * i_stoc_height), xloc.bar_index, extend.none, i_indicator_color , line.style_solid, 1)) + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_d[barIndex] / oscHighest * priceChangeRate * i_stoc_height), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_stoc_voffset) * (1 + stoc_d[barIndex + 1] / oscHighest * priceChangeRate * i_stoc_height), xloc.bar_index, extend.none, i_signal_color , line.style_solid, 1)) + + if i_macd_display + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + macdLine[barIndex] / macdHighest * priceChangeRate * i_macd_height ), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + macdLine[barIndex + 1] / macdHighest * priceChangeRate * i_macd_height ), xloc.bar_index, extend.none, i_indicator_color , line.style_solid, 1)) + array.push(a_lines, line.new(bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + signalLine[barIndex] / macdHighest * priceChangeRate * i_macd_height ), + bar_index[barIndex + 1], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + signalLine[barIndex + 1] / macdHighest * priceChangeRate * i_macd_height ), xloc.bar_index, extend.none, i_signal_color , line.style_solid, 1)) + + array.push(a_hist , box.new (bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset), + bar_index[barIndex], priceLowest * (1 - priceChangeRate * i_macd_voffset) * (1 + histLine[barIndex] / macdHighest * priceChangeRate * i_macd_height), histColor[barIndex], 2)) + + if nzVolume + if i_vol_type != 'None' + array.push(a_hist , box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), + bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height), i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_color, 0) : bullCandle[barIndex] ? color.new(i_pos_color, 0) : color.new(i_neg_color, 0), 2, bgcolor = i_vol_type == 'Buying/Selling Volume' ? color.new(i_pos_color, 0) : bullCandle[barIndex] ? color.new(i_pos_color, 0) : color.new(i_neg_color, 0))) + if i_vol_type == 'Buying/Selling Volume' + array.push(a_hist , box.new (bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset), + bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + S[barIndex] / volumeHighest * priceChangeRate * i_vol_height), color.new(i_neg_color, 0), 2, bgcolor = color.new(i_neg_color, 0))) + // Voumme MA + if i_vol_display + array.push(a_lines, line.new(bar_index[barIndex] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex]), + bar_index[barIndex + 1] + i_vol_hoffset, priceHighest * (1 + priceChangeRate * i_vol_voffset) * (1 + nzVolume[barIndex + 1] / volumeHighest * priceChangeRate * i_vol_height / volumeMARate[barIndex + 1]), xloc.bar_index, extend.none, i_neu_color, line.style_solid, 1)) + +//_____________________________ Overlay Charts End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_____________________________ Get Symbols for Screener Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_01, out_01] = feed(effective_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), +[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), +[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), +[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), +[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), +[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), +[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), +[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), +[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), +[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) + +//_____________________________ Get Symbols for Screener End + +//_____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Choose Screening Method +bear_method = + i_scr_choose == 'Continuous Signals' ? short_ret_trigger : + i_scr_choose == 'Flip Signals' ? short_entry : na + +bull_method = + i_scr_choose == 'Continuous Signals' ? long_ret_trigger : + i_scr_choose == 'Flip Signals' ? long_entry : na + +// Screener Conditions +bearish_cond = bear_method +bullish_cond = bull_method + +// Define Bull and Bear Conditions +bull = not(i_scr_direction == "Short") +bear = not(i_scr_direction == "Long") + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Short Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_bull and bearish_cond and bear + signal := -1 + + // Check for Long Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_bear and bullish_cond and bull + signal := 1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + + [_time, price, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 4, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, price, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, signal)) + +// Screener function to collect data +screener(s) => + [_time, price, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, strPrice, strSignal) + +// Call Screener function for multiple symbols +screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), +screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), +screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), +screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), +screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), +screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_tbl_disp_rows + while matrix.rows(matrix) > i_scr_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table scr_tbl = table.new(position=i_scr_tbl_position, columns=3, rows=102, border_width=1) + +// Function to populate cells in the table +scr_cell_title(col, row, txt) => + table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor = color.new(i_neu_color, 90), text_size=i_scr_tbl_text_size) + +scr_cell(col, row, txt, color) => + table.cell(scr_tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_scr_tbl_text_size) + +// Check if it's the last bar +if barstate.islast + // Clear existing data in the table + table.clear(scr_tbl, 0, 0, 2, 101) + + scr_cell_title(0, 0, i_scr_choose) + table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=2, end_row=0) + scr_cell_title(0, 1, "Symbol") + scr_cell_title(1, 1, "Time") + scr_cell_title(2, 1, "Price") + + j = 2 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + col = matrix.get(matrix, i, 3) == "1" ? i_pos_color : + matrix.get(matrix, i, 3) == "-1" ? i_neg_color : i_neu_color + + // Populate cells in the table + scr_cell(0, j, matrix.get(matrix, i, 0), col) + scr_cell(1, j, matrix.get(matrix, i, 1), col) + scr_cell(2, j, matrix.get(matrix, i, 2), col) + + j += 1 + +//_____________________________ Screener End + +//_____________________________ Code End + +// Readme First: +// +// About: +// This is a BANKNIFTY option buying or scalping setup shared by trader Vijay S. Thakare on YouTube. +// +// Strategy Reference Video: +// Vijay Thakare at Traders Carnival Seminar: +// Video Title: "Vijay Thakare: An Excellent Option Scalper Sharing His Knowledge @ Traders Carnival" +// Video Link: https://www.youtube.com/watch?v=6INokexfeLc +// +// Explanation Video from His YouTube Channel: +// Video Title: "Setup Video" +// Video Link: https://www.youtube.com/watch?v=KK5j1dgklIY&t=9150s +// +// Strategy Type: Momentum +// Bias: Strongly Directional +// Trading Style: Scalping +// Instrument: Option - Buying +// Original Symbol: NSE:BANKNIFTY (Works with other symbols as well) +// Timeframe: 5 minute +// +// Risk Reward Ratio: 1:2 +// Stop Loss: Rs. 20 on the premium chart +// Target: Rs. 40 on the premium chart +// +// Charts Referred: +// - BANKNIFTY Futures Chart +// - BANKNIFTY Options Premium Chart +// +// Indicator Used and Settings: +// 1. EMA: Close, 20, 50, 100, 200 +// 2. VWAP: Daily VWAP +// 3. MACD: Fast Length - 3, Slow Length - 9, Signal Smoothing - 15 +// 4. Stochastic: %K Length - 5, %K Smoothing - 3, %D Smoothing - 3 +// +// Long Entry Rules: +// - Close above VWAP +// - Close above Supertrend (Not in original strategy. It avoids many false signals.) +// - MACD above 0 +// - Stochastic above 40 +// - Consider VWAP, EMA 20, 50, 100, 200 are closer to each other +// - Rising volume (optional) +// +// Short Entry Rules: +// - Close below VWAP +// - Close below Supertrend (Not in original strategy. It avoids many false signals.) +// - MACD below 0 +// - Stochastic below 60 +// - Consider VWAP, EMA 20, 50, 100, 200 are closer to each other +// - Rising volume (optional) +// +// Update 09 June 2024 +// 1. Added Supertrend filter. +// 2. Added TWAP to use it with Symbols without Volume. +// 3. Removed indicator values Table. +// 4. Two types of scanners are available. One generates continuous signals and one generates flip signals. + diff --git a/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup.txt b/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup.txt index c8bc17e..689ec88 100644 --- a/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup.txt +++ b/Momentum Setup - Vijay Thakare Option Buying Scalping Setup/Momentum Setup - Vijay Thakare Option Buying Scalping Setup.txt @@ -16,7 +16,7 @@ tt_is = "• Reads only up to first 40 symbols." + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" string i_symbols = input.text_area( - defval="NSE:NIFTY,NSE:NIFTYJR,NSE:BANKNIFTY,NSE:CNXFINANCE,NSE:NIFTY_MID_SELECT,BSE:SENSEX,BSE:SNSX50,BSE:BANK,NSE:ASHOKLEY,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:CANBK,NSE:COALINDIA,NSE:ENGINERSIN,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IRCON,NSE:IRFC,NSE:JSWINFRA,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:ONGC,NSE:PFC,NSE:PNB,NSE:POWERGRID,NSE:RAILTEL,NSE:RVNL,NSE:SAIL,NSE:SJVN,NSE:UNIONBANK,NSE:VEDL,NSE:ZEEL,NSE:ZOMATO", + defval="NSE:NIFTY,NSE:NIFTYJR,NSE:BANKNIFTY,NSE:CNXFINANCE,NSE:NIFTY_MID_SELECT,BSE:SENSEX,BSE:SNSX50,BSE:BANK,NSE:ASHOKLEY,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BEL,NSE:BHEL,NSE:CANBK,NSE:COALINDIA,NSE:ENGINERSIN,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:IEX,NSE:IRCON,NSE:IRFC,NSE:JSWINFRA,NSE:MOTHERSON,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:ONGC,NSE:PFC,NSE:PNB,NSE:POWERGRID,NSE:RAILTEL,NSE:RVNL,NSE:SAIL,NSE:SJVN,NSE:UNIONBANK,NSE:VEDL,NSE:ZEEL,NSE:ETERNAL", title="Paste Symbols", tooltip=tt_is, group=g_scrtb) string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Long', 'Short'], inline='tb_1', group=g_scrtb) diff --git a/Trend Following Setup - Sideways Market Skipper Scanner/Scanner - Trend Following Setup - Sideways Market Skipper Scanner.txt b/Trend Following Setup - Sideways Market Skipper Scanner/Scanner - Trend Following Setup - Sideways Market Skipper Scanner.txt index 5d148b0..5c2d5d9 100644 --- a/Trend Following Setup - Sideways Market Skipper Scanner/Scanner - Trend Following Setup - Sideways Market Skipper Scanner.txt +++ b/Trend Following Setup - Sideways Market Skipper Scanner/Scanner - Trend Following Setup - Sideways Market Skipper Scanner.txt @@ -1,578 +1,802 @@ -// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -indicator(title='Trend Following Setup - Sideways Market Skipper Scanner', shorttitle='Sideways Skip Scan', overlay=false, max_bars_back=500) - -//_____________________________ Menu Scanner Start - -g_scrtb = '██████████████████ Scanner ██████████████████' - -//string i_scr_choose = input.string(defval='Continuous Signals', title='Scanning Method', options=['Continuous Signals', 'Flip Signals'], group=g_scrtb) - -tt_is = "• Reads only up to first 40 symbols." + - "\n• Total characters cannot exceed 4096." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ABFRL,NSE:ASHOKA,NSE:BALMLAWRIE,NSE:BEL,NSE:BHEL,NSE:BOMDYEING,NSE:CANBK,NSE:DBREALTY,NSE:DCXINDIA,NSE:ENGINERSIN,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:INDIACEM,NSE:INOXWIND,NSE:IRCON,NSE:IRFC,NSE:ITI,NSE:MARKSANS,NSE:MIDHANI,NSE:MRPL,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NFL,NSE:NHPC,NSE:NLCINDIA,NSE:PNB,NSE:PTC,NSE:RAILTEL,NSE:RCF,NSE:RELINFRA,NSE:RVNL,NSE:SAIL,NSE:SCI,NSE:SJVN,NSE:TI,NSE:UNIONBANK,NSE:VEDL,NSE:ZEEL", - title="Paste Symbols", tooltip=tt_is, group=g_scrtb) - -bool i_scr_show_table = input.bool(defval=true, title='Display Table', group=g_scrtb) -bool i_scr_show_long = input.bool(defval=true, title='Long Signals', inline='tb_2', group=g_scrtb) -bool i_scr_show_short = input.bool(defval=true, title='Short Signals', inline='tb_2', group=g_scrtb) - -int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) -string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) -string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) - -//_____________________________ Menu Scanner End - -//_____________________________ Menu Supertrend Start - -g_st = '█████████████████ Supertrend █████████████████' -//bool i_st_display = input.bool(defval=true, title='Display', group=g_st) -int i_st_atr_period = input.int(defval=10, title="ATR Length", minval=1, group=g_st) -float i_st_factor = input.float(defval=3.0, title="Factor", minval=0.01, step=0.01, group=g_st) - -//_____________________________ Menu Supertrend End - -//_____________________________ Menu Range Start - -g_r = '███████████████ Volatility Range ███████████████' - -tt_r = - "• 'Auto ATR': Automatically sets the range based on the ATR value." + - "\n• The range adjusts automatically when switching between symbols." + - "\n• The default ATR timeframe is 1 hour." + - "\n• For a Supertrend Long Crossover, the range is defined by adding the ATR value." + - "\n• For a Supertrend Short Crossunder, the range is defined by subtracting the ATR value." + - "\n\n• Type Points: Manually enter the points for different symbols to define the volatility range." + - "\n• For example, the points are 60 for NIFTY and 120 for BANKNIFTY." - -tt_tp = "Applicable only when 'Range Type' is selected as 'Type Points'." - -tt_atr_tf = - "• This uses the ATR value of the given timeframe." + - "\n• The default ATR timeframe is 1 hour." - -bool i_atr_range_display = input.bool(defval=true, title='Display', group=g_r) -string i_atr_range_choice = input.string(defval='Auto ATR', title='Range Type', options=['Auto ATR', 'Type Points'], tooltip=tt_r, group=g_r) -float i_atr_range_points = input.float(defval=120, title="Type Points", minval=0.01, tooltip=tt_tp, group=g_r) - -//string i_atr_range_timeframe = input.timeframe(defval='60', title='ATR Timeframe', tooltip=tt_atr_tf, group=g_r) -int i_atr_range_length = input.int(defval=14, title='ATR Length', minval=1, group=g_r) -string i_atr_range_smoothing = input.string(title="ATR Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"], group=g_r) -float i_atr_range_multiplier = input.float(defval=1.5, title="ATR Multiplier", minval=1, step=0.5, group=g_r) -int i_atr_range_sma_length = input.int(defval=14, title='ATR SMA Length', minval=1, group=g_r) - -//_____________________________ Menu Range End - -//_____________________________ Menu Additional Fiters Start - -g_af = '███████████████ Additional Fiters ███████████████' -tt_pchg = - "• If '% Change Above/Below +/-' is 4, it means relative volume is considered when the price change is above 4%." + - "\n• A value of 4% is positive for bullish scenarios and negative for bearish scenarios." + - "\n• The percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." -tt_vpchg = - "• If 'Volume % Change Above' is 0, it means Relative Volume is considered when today's volume is greater than the previous day's volume." + - "\n• For 'Screening Method' choice 'Retracement to EMA,' the 'Apply Volume % Change Filter' can be unchecked." + - "\n• A 'Volume % Change Above' 300% or more often indicates a major breakout, which may happen today or the next day." + - "\n• The volume percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." -tt_atr = - "• ATR helps filter out longer or more volatile signal candles." -tt_atr_mul = - "• Higher multiplier value filters a longer or more volatile signal candle." -tt_bf = - "• If the input is '80', it means the body covers over 80% of the candle." -tt_bs = - "• 2 means the candle is 2 times larger than the previous candle." -tt_vol = - "• Filter out a candle when its volume is greater than the SMA of the volume." -tt_rv = - "• Filter out a candle when its volume is greater than the Relative Volume." -tt_tf = - "• Filter out a signals between the given Time." - -bool i_pchg_filter = input.bool(defval=false, title='Apply % Change Filter', tooltip=tt_pchg, group=g_af) -float i_pchg_above_below = input.float(defval=2, title='% Change Above/Below +/-', minval=0, group=g_af) - -bool i_vol_pchg_filter = input.bool(defval=false, title='Apply Volume % Change Filter', tooltip=tt_vpchg, group=g_af) -float i_vol_pchg_above = input.float(defval=0, title='Volume % Change Above', minval=0, group=g_af) - -bool i_atr_filter = input.bool(defval=true, title='Apply ATR Filter', tooltip=tt_atr, group=g_af) -int i_atr_length = input.int(defval=14, minval=1, title='ATR Length', group=g_af) -float i_atr_multi = input.float(defval=1, title='ATR Multiplier', minval=1, group=g_af) - -bool i_body_filter = input.bool(defval=false, title='Apply Body % Filter', tooltip=tt_bf, group=g_af) -float i_body_percent = input.float(defval=80, title='Body % Above', minval=0, maxval=100, group=g_af) / 100 - -bool i_body_size_filter = input.bool(defval=false, title='Apply Body Size Filter', tooltip=tt_bs, group=g_af) -int i_body_size_multiplier = input.int(defval=2, title='Body Size Multiplier (x)', minval=0, group=g_af) - -bool i_volume_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vol, group=g_af) -int i_vol_sma_length = input.int(defval=20, minval=1, title='Volume SMA Length', group=g_af) - -bool i_rel_vol_filter = input.bool(defval=false, title='Apply Relative Volume Filter', tooltip=tt_rv, group=g_af) -int i_rel_vol_avg_vol_len = input.int(defval=90, title='Relative Volume Length', minval=2, group=g_af) -float i_rel_vol_avg_vol_multi = input.float(defval=5, title='Rel Vol SMA Multiplier', minval=0, group=g_af) - -bool i_time_filter = input.bool(defval=false, title='Apply Time Filter', tooltip=tt_tf, group=g_af) -int i_hour_1 = input.int(defval=9, minval=0, title='Time From', inline='t_1', group=g_af) -int i_minute_1 = input.int(defval=15, minval=0, title=':', inline='t_1', group=g_af) -int i_hour_2 = input.int(defval=10, minval=0, title='Time To ', inline='t_2', group=g_af) -int i_minute_2 = input.int(defval=15, minval=0, title=':', inline='t_2', group=g_af) - -//_____________________________ Menu Additional Fiters End - -//_____________________________ Menu Table Start - -g_dtb = '█████████████████ Data Table █████████████████' -bool i_tbl_data_show = input.bool(defval=true, title='Display Table', group=g_dtb) -string i_tbl_data_pos = input.string(defval=position.bottom_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_dtb) -string i_tbl_data_txt_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_dtb) - -//_____________________________ Menu Table End - -//_____________________________ Chart Settings Start - -g_ch = '███████████████ Chart Settings ███████████████' -color i_pos_dark_color = input.color(defval=#03110F, title='Positive Dark', group=g_ch) -color i_pos_color = input.color(defval=#26A69A, title='Positive Mid', group=g_ch) -color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) -color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) -color i_neg_color = input.color(defval=#FF5252, title='Negative Mid', group=g_ch) -color i_neg_dark_color = input.color(defval=#180809, title='Negative Dark', group=g_ch) -color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) -color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) -color i_neu_color = input.color(defval=#D1D4DC, title='Neutral Light', group=g_ch) -color i_neu_mid_color = input.color(defval=#2A2E39, title='Neutral Mid', group=g_ch) -color i_neu_dark_color = input.color(defval=#141516, title='Neutral Dark', group=g_ch) - -//_____________________________ Chart Settings End - -//_____________________________ 1. Supertrend Start - -[supertrend, direction] = ta.supertrend(i_st_factor, i_st_atr_period) -supertrend := barstate.isfirst ? na : supertrend - -// Plot Supertrend -upTrend = plot(series=direction < 0 ? supertrend : na, title="Supertrend Up", color=i_pos_color, style=plot.style_linebr, force_overlay=true) -downTrend = plot(series=direction < 0 ? na : supertrend, title="Supertrend Down", color=i_neg_color, style=plot.style_linebr, force_overlay=true) -bodyMiddle = plot(series=barstate.isfirst ? na : (open + close) / 2, title="Body Middle", display=display.none, force_overlay=true) -fill(plot1=bodyMiddle, plot2=upTrend, color=color.new(i_pos_color, 90), fillgaps=false) -fill(plot1=bodyMiddle, plot2=downTrend, color=color.new(i_neg_color, 90), fillgaps=false) - -//_____________________________ 1. Supertrend End - -//_____________________________ 2. ATR Start - -ma_function_atr(source, length) => - switch i_atr_range_smoothing - 'RMA' => ta.rma(source, length) - 'SMA' => ta.sma(source, length) - 'EMA' => ta.ema(source, length) - 'WMA' => ta.wma(source, length) - -atr = ma_function_atr(ta.tr(true), i_atr_range_length) -atr_sma = ta.sma(atr, i_atr_range_sma_length) -plot(series=atr, title="ATR", color=i_indicator_color) -plot(series=atr_sma, title="ATR SMA", color=i_signal_color) - -// Range Source -range_input = i_atr_range_choice == 'Auto ATR' ? (atr * i_atr_range_multiplier) : i_atr_range_points -range_source = i_atr_range_choice == 'Type Points' ? i_atr_range_points :range_input - -//_____________________________ 2. ATR End - -//_____________________________ Cumulative Percentage Change Start - -// Function to calculate Daily Cumulative Percentage Change of Close Price -cumulative_percentage_change() => - var float _cum_pct_change = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 - _cum_pct_change := _is_new_day ? _daily_pct_change : (na(_cum_pct_change) ? _daily_pct_change : (_cum_pct_change + _daily_pct_change)) - _cum_pct_change - -// Calculate current cumulative percentage change -cum_pchg = cumulative_percentage_change() - -//_____________________________ Cumulative Percentage Change End - -//_____________________________ Cumulative Volume Percentage Change Start - -// Function to calculate Daily Cumulative Volume -cumulative_volume() => - var float _cum_vol = na - _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 - _cum_vol := _is_new_day ? volume : (na(_cum_vol) ? volume : (_cum_vol + volume)) - _cum_vol - -// Calculate current and previous day cumulative volumes -var float current_cum_vol = na -var float prev_cum_vol = na - -if ta.change(time('D')) != 0 - prev_cum_vol := current_cum_vol - current_cum_vol := volume -else - current_cum_vol += volume - -// Calculate Cumulative Volume Percentage Change -cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 - -//_____________________________ Cumulative Volume Percentage Change End - -//_____________________________ Additional Filters Start - -// % Change Filter -bool pchg_above_filter = true -bool pchg_below_filter = true -if i_pchg_filter - pchg_above_filter := cum_pchg > i_pchg_above_below - pchg_below_filter := cum_pchg < -i_pchg_above_below - -// Volume % Change Filter -bool vol_pchg_filter = true -if i_vol_pchg_filter - vol_pchg_filter := cum_vol_pchg >= i_vol_pchg_above - -// ATR Filter -bool atr_filter = true -if i_atr_filter - atr_filter := (high - low) > ta.atr(i_atr_length) * i_atr_multi - -// Body Percent Filter -bool body_filter = true -if i_body_filter - body_filter := (math.abs(close - open)) / (high - low) >= i_body_percent - -// Body Size Filter -bool body_size_filter = true -if i_body_size_filter - body_size_filter := (math.abs(close - open)) / (high - low) >= i_body_percent and (high - low) >= (high[1] - low[1]) * i_body_size_multiplier - -// Volume SMA Filter -bool volume_filter = true -if i_volume_filter - volume_filter := volume > ta.sma(volume, i_vol_sma_length) - -// Continuous Signals Filter -average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) -relative_volume = volume / average_volume[1] -rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi - -bool rel_vol_filter = true -if i_rel_vol_filter - rel_vol_filter := relative_volume > rel_vol_sma_multiplier - -// Time Filter -bool time_filter = true -if i_time_filter - time_filter := (hour > i_hour_1 or (hour == i_hour_1 and minute >= i_minute_1)) and (hour < i_hour_2 or (hour == i_hour_2 and minute < i_minute_2)) - -//_____________________________ Additional Filters End - -//_____________________________ Signals Start - -// Condition 1 -short_cont = ta.crossunder(close, supertrend) and barstate.isconfirmed -long_cont = ta.crossover(close, supertrend) and barstate.isconfirmed - -// Get Volatility Range After Cross -var top_price = float(na) -var bottom_price = float(na) - -if (short_cont) - bottom_price := close - range_source - top_price := na // Reset top_price to avoid plotting it - -if (long_cont) - top_price := close + range_source - bottom_price := na // Reset bottom_price to avoid plotting it - -// Condition 2 -short_break_cond = - close < bottom_price and - open > close and - atr > atr_sma and - pchg_below_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - barstate.isconfirmed - -long_break_cond = - close > top_price and - open < close and - atr > atr_sma and - pchg_above_filter and - vol_pchg_filter and - atr_filter and - body_filter and - body_size_filter and - volume_filter and - rel_vol_filter and - time_filter and - barstate.isconfirmed - -// Short Signal -var short_current_state = 0 -bear_previous_state = nz(short_current_state[1]) -short_current_state := bear_previous_state == 2 ? 0 : bear_previous_state -if short_cont and short_current_state == 0 - short_current_state := 1 -if short_break_cond and short_current_state == 1 - short_current_state := 2 - -bool short_break_trigger = short_current_state == 2 ? true : false - -// Long Signal -var long_current_state = 0 -bull_previous_state = nz(long_current_state[1]) -long_current_state := bull_previous_state == 2 ? 0 : bull_previous_state -if long_cont and long_current_state == 0 - long_current_state := 1 -if long_break_cond and long_current_state == 1 - long_current_state := 2 - -bool long_break_trigger = long_current_state == 2 ? true : false - -// Plot Supertrend Cross Bar -barcolor(color=short_cont ? i_neg_light_color : long_cont ? i_pos_light_color : na, title='Supertrend Cross Candle') - -// Plot Break Signal -plotshape(series=long_break_trigger ? 3 : na, title='Long Signal', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny, force_overlay=true) -plotshape(series=short_break_trigger ? 3 : na, title='Short Signal', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny, force_overlay=true) -barcolor(color=short_break_trigger ? i_neg_light_color : long_break_trigger ? i_pos_light_color : na, title='Signal Candle') - -// Plot Historical Range -plot(series=i_atr_range_display and i_atr_range_display and top_price == top_price[1] ? top_price : na, title='Top Range', color=i_pos_color, linewidth=1, style=plot.style_steplinebr, offset=-1, force_overlay=true) -plot(series=i_atr_range_display and i_atr_range_display and bottom_price == bottom_price[1] ? bottom_price : na, title='Bottom Range', color=i_neg_color, linewidth=1, style=plot.style_steplinebr, offset=-1, force_overlay=true) - -//_____________________________ Signals End - -//_____________________________ Data Table Start - -// To String -day_pchg_str = str.tostring(cum_pchg,"#.##") + ' %' -volume_pchg_str = str.tostring(cum_vol_pchg,"#.##") + ' %' -day_volume_str = str.tostring(current_cum_vol/100000,"#.##") + ' L' -prev_day_volume_str = str.tostring(prev_cum_vol/100000,"#.##") + ' L' - -// Color -bgcolor_1 = i_neu_dark_color -bgcolor_2 = i_neu_mid_color - -pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color -vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color -prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color - -// Plot Table -var table tbl_data = table.new(position=i_tbl_data_pos, columns=2, rows=4, border_width=1, force_overlay=true) - -if barstate.islast and i_tbl_data_show - table.cell(table_id=tbl_data, column=0, row=0, text="%Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=0, text=day_pchg_str, text_color=pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=1, text="Vol %Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=1, text=volume_pchg_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=2, text="Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=2, text=day_volume_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) - - table.cell(table_id=tbl_data, column=0, row=3, text="PD Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - table.cell(table_id=tbl_data, column=1, row=3, text=prev_day_volume_str, text_color=prev_vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) - -//_____________________________ Data Table End - -//_____________________________ Get Symbols for Scanner Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Scanner' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Scanner/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_01, out_01] = feed(i_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), -[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), -[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), -[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), -[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), -[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), -[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), -[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), -[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), -[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) - -//_____________________________ Get Symbols for Scanner End - -//_____________________________ Scanner Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Scanner [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Scanner-By-MUQWISHI/' - -// Scanner Conditions -short_cond = short_break_trigger -long_cond = long_break_trigger - -// Function for Scanner Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - _cum_pchg = float(na) - _cum_vol_pchg = float(na) - signal = int(na) - - if barstate.isconfirmed - // Check for Short Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_long and long_cond - signal := 1 - - // Check for Long Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_short and short_cond - signal := -1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - _cum_pchg := cum_pchg - _cum_vol_pchg := cum_vol_pchg - - [_time, price, _cum_pchg, _cum_vol_pchg, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 6, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) - -// Scanner function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - str_cum_pchg = str.tostring(_cum_pchg, '#.##') - str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) - -// Call Scanner function for multiple symbols -screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), -screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), -screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), -screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), -screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), -screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_scr_tbl_disp_rows - while matrix.rows(matrix) > i_scr_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table scr_tbl = table.new(position=i_scr_tbl_position, columns=5, rows=102, border_width=1, force_overlay=true) - -// Function to populate cells in the table -scr_cell_title(col, row, txt) => - table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor=i_neu_dark_color, text_size=i_scr_tbl_text_size) - -scr_cell(col, row, txt, _text_color, _bgcolor) => - table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign=text.align_left, bgcolor=_bgcolor, text_size=i_scr_tbl_text_size) - -// Check if it's the last bar -if barstate.islast and i_scr_show_table - // Clear existing data in the table - table.clear(scr_tbl, 0, 0, 2, 101) - - scr_cell_title(0, 0, "Sideways Market Skipper") - table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=4, end_row=0) - scr_cell_title(0, 1, "Symbol") - scr_cell_title(1, 1, "Time") - scr_cell_title(2, 1, "Price") - scr_cell_title(3, 1, "%Chg") - scr_cell_title(4, 1, "V %Chg") - - j = 4 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - - _textcolor = - matrix.get(matrix, i, 5) == "1" ? i_pos_color : - matrix.get(matrix, i, 5) == "-1" ? i_neg_color : i_neu_color - - _bg_color = - matrix.get(matrix, i, 5) == "1" ? i_pos_dark_color : - matrix.get(matrix, i, 5) == "-1" ? i_neg_dark_color : i_neu_color - - // Populate cells in the table - scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) - scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) - scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) - scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) - scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) - - j += 1 - -//_____________________________ Scanner End - -//_____________________________ Code End - -// Readme First: -// -// Trend Following Setup - Sideways Market Skipper Scanner -// -// Long Signal Logic: -// - Close crosses above the Supertrend. -// - Add ATR value (with multiplier) to the close to identify the potential sideways or volatility range. -// - When the price crosses this range, it's considered a breakout. -// - The ATR should be rising or the volatility is increasing. -// -// Short Signal Logic: -// - Close crosses below the Supertrend. -// - Substract ATR value (with multiplier) to the close to identify the potential sideways or volatility range. -// - When the price crosses this range, it's considered a breakdown. -// - The ATR should be rising or the volatility is increasing. -// -// Entry: Enter after the retracement once the signal is generated. +// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +indicator(title='Trend Following Setup - Sideways Market Skipper Scanner', shorttitle='Sideways Skip Scan', overlay=false, max_bars_back=500) + +//_____________________________ Menu Scanner Start + +g_scrtb = '██████████████████ Scanner ██████████████████' + +//string i_scr_choose = input.string(defval='Continuous Signals', title='Scanning Method', options=['Continuous Signals', 'Flip Signals'], group=g_scrtb) + +tt_is = "• Reads only up to first 40 symbols." + + "\n• Total characters cannot exceed 4096." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ABFRL,NSE:ASHOKA,NSE:BALMLAWRIE,NSE:BEL,NSE:BHEL,NSE:BOMDYEING,NSE:CANBK,NSE:DBREALTY,NSE:DCXINDIA,NSE:ENGINERSIN,NSE:GAIL,NSE:HINDCOPPER,NSE:HUDCO,NSE:INDIACEM,NSE:INOXWIND,NSE:IRCON,NSE:IRFC,NSE:ITI,NSE:MARKSANS,NSE:MIDHANI,NSE:MRPL,NSE:NATIONALUM,NSE:NBCC,NSE:NCC,NSE:NFL,NSE:NHPC,NSE:NLCINDIA,NSE:PNB,NSE:PTC,NSE:RAILTEL,NSE:RCF,NSE:RELINFRA,NSE:RVNL,NSE:SAIL,NSE:SCI,NSE:SJVN,NSE:TI,NSE:UNIONBANK,NSE:VEDL,NSE:ZEEL", + title="Paste Symbols", tooltip=tt_is, group=g_scrtb) + +bool i_scr_show_table = input.bool(defval=true, title='Display Table', group=g_scrtb) +bool i_scr_show_long = input.bool(defval=true, title='Long Signals', inline='tb_2', group=g_scrtb) +bool i_scr_show_short = input.bool(defval=true, title='Short Signals', inline='tb_2', group=g_scrtb) + +int i_scr_tbl_disp_rows = input.int(defval=12, title='Display Rows', minval=0, maxval=100, group=g_scrtb) +string i_scr_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_scrtb) +string i_scr_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_scrtb) + +//_____________________________ Menu Scanner End + +//_____________________________ Menu Supertrend Start + +g_st = '█████████████████ Supertrend █████████████████' +//bool i_st_display = input.bool(defval=true, title='Display', group=g_st) +int i_st_atr_period = input.int(defval=10, title="ATR Length", minval=1, group=g_st) +float i_st_factor = input.float(defval=3.0, title="Factor", minval=0.01, step=0.01, group=g_st) + +//_____________________________ Menu Supertrend End + +//_____________________________ Menu Range Start + +g_r = '███████████████ Volatility Range ███████████████' + +tt_r = + "• 'Auto ATR': Automatically sets the range based on the ATR value." + + "\n• The range adjusts automatically when switching between symbols." + + "\n• The default ATR timeframe is 1 hour." + + "\n• For a Supertrend Long Crossover, the range is defined by adding the ATR value." + + "\n• For a Supertrend Short Crossunder, the range is defined by subtracting the ATR value." + + "\n\n• Type Points: Manually enter the points for different symbols to define the volatility range." + + "\n• For example, the points are 60 for NIFTY and 120 for BANKNIFTY." + +tt_tp = "Applicable only when 'Range Type' is selected as 'Type Points'." + +tt_atr_tf = + "• This uses the ATR value of the given timeframe." + + "\n• The default ATR timeframe is 1 hour." + +bool i_atr_range_display = input.bool(defval=true, title='Display', group=g_r) +string i_atr_range_choice = input.string(defval='Auto ATR', title='Range Type', options=['Auto ATR', 'Type Points'], tooltip=tt_r, group=g_r) +float i_atr_range_points = input.float(defval=120, title="Type Points", minval=0.01, tooltip=tt_tp, group=g_r) + +//string i_atr_range_timeframe = input.timeframe(defval='60', title='ATR Timeframe', tooltip=tt_atr_tf, group=g_r) +int i_atr_range_length = input.int(defval=14, title='ATR Length', minval=1, group=g_r) +string i_atr_range_smoothing = input.string(title="ATR Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"], group=g_r) +float i_atr_range_multiplier = input.float(defval=1.5, title="ATR Multiplier", minval=1, step=0.5, group=g_r) +int i_atr_range_sma_length = input.int(defval=14, title='ATR SMA Length', minval=1, group=g_r) + +//_____________________________ Menu Range End + +//_____________________________ Menu Additional Fiters Start + +g_af = '███████████████ Additional Fiters ███████████████' +tt_pchg = + "• If '% Change Above/Below +/-' is 4, it means relative volume is considered when the price change is above 4%." + + "\n• A value of 4% is positive for bullish scenarios and negative for bearish scenarios." + + "\n• The percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." +tt_vpchg = + "• If 'Volume % Change Above' is 0, it means Relative Volume is considered when today's volume is greater than the previous day's volume." + + "\n• For 'Screening Method' choice 'Retracement to EMA,' the 'Apply Volume % Change Filter' can be unchecked." + + "\n• A 'Volume % Change Above' 300% or more often indicates a major breakout, which may happen today or the next day." + + "\n• The volume percentage change is calculated using cumulative percentage change, so there might be a minor difference between the actual and displayed percentage change." +tt_atr = + "• ATR helps filter out longer or more volatile signal candles." +tt_atr_mul = + "• Higher multiplier value filters a longer or more volatile signal candle." +tt_bf = + "• If the input is '80', it means the body covers over 80% of the candle." +tt_bs = + "• 2 means the candle is 2 times larger than the previous candle." +tt_vol = + "• Filter out a candle when its volume is greater than the SMA of the volume." +tt_rv = + "• Filter out a candle when its volume is greater than the Relative Volume." +tt_tf = + "• Filter out a signals between the given Time." + +bool i_pchg_filter = input.bool(defval=false, title='Apply % Change Filter', tooltip=tt_pchg, group=g_af) +float i_pchg_above_below = input.float(defval=2, title='% Change Above/Below +/-', minval=0, group=g_af) + +bool i_vol_pchg_filter = input.bool(defval=false, title='Apply Volume % Change Filter', tooltip=tt_vpchg, group=g_af) +float i_vol_pchg_above = input.float(defval=0, title='Volume % Change Above', minval=0, group=g_af) + +bool i_atr_filter = input.bool(defval=true, title='Apply ATR Filter', tooltip=tt_atr, group=g_af) +int i_atr_length = input.int(defval=14, minval=1, title='ATR Length', group=g_af) +float i_atr_multi = input.float(defval=1, title='ATR Multiplier', minval=1, group=g_af) + +bool i_body_filter = input.bool(defval=false, title='Apply Body % Filter', tooltip=tt_bf, group=g_af) +float i_body_percent = input.float(defval=80, title='Body % Above', minval=0, maxval=100, group=g_af) / 100 + +bool i_body_size_filter = input.bool(defval=false, title='Apply Body Size Filter', tooltip=tt_bs, group=g_af) +int i_body_size_multiplier = input.int(defval=2, title='Body Size Multiplier (x)', minval=0, group=g_af) + +bool i_volume_filter = input.bool(defval=false, title='Apply Volume Filter', tooltip=tt_vol, group=g_af) +int i_vol_sma_length = input.int(defval=20, minval=1, title='Volume SMA Length', group=g_af) + +bool i_rel_vol_filter = input.bool(defval=false, title='Apply Relative Volume Filter', tooltip=tt_rv, group=g_af) +int i_rel_vol_avg_vol_len = input.int(defval=90, title='Relative Volume Length', minval=2, group=g_af) +float i_rel_vol_avg_vol_multi = input.float(defval=5, title='Rel Vol SMA Multiplier', minval=0, group=g_af) + +bool i_time_filter = input.bool(defval=false, title='Apply Time Filter', tooltip=tt_tf, group=g_af) +int i_hour_1 = input.int(defval=9, minval=0, title='Time From', inline='t_1', group=g_af) +int i_minute_1 = input.int(defval=15, minval=0, title=':', inline='t_1', group=g_af) +int i_hour_2 = input.int(defval=10, minval=0, title='Time To ', inline='t_2', group=g_af) +int i_minute_2 = input.int(defval=15, minval=0, title=':', inline='t_2', group=g_af) + +//_____________________________ Menu Additional Fiters End + +//_____________________________ Menu Table Start + +g_dtb = '█████████████████ Data Table █████████████████' +bool i_tbl_data_show = input.bool(defval=true, title='Display Table', group=g_dtb) +string i_tbl_data_pos = input.string(defval=position.bottom_right, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_dtb) +string i_tbl_data_txt_size = input.string(defval=size.normal, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_dtb) + +//_____________________________ Menu Table End + +//_____________________________ Chart Settings Start + +g_ch = '███████████████ Chart Settings ███████████████' +color i_pos_dark_color = input.color(defval=#03110F, title='Positive Dark', group=g_ch) +color i_pos_color = input.color(defval=#26A69A, title='Positive Mid', group=g_ch) +color i_pos_light_color = input.color(defval=#ACE5DC, title='Positive Light', group=g_ch) +color i_neg_light_color = input.color(defval=#FCCBCD, title='Negative Light', group=g_ch) +color i_neg_color = input.color(defval=#FF5252, title='Negative Mid', group=g_ch) +color i_neg_dark_color = input.color(defval=#180809, title='Negative Dark', group=g_ch) +color i_indicator_color = input.color(defval=#2962FF, title='Indicator', group=g_ch) +color i_signal_color = input.color(defval=#FF6D00, title='Signal', group=g_ch) +color i_neu_color = input.color(defval=#D1D4DC, title='Neutral Light', group=g_ch) +color i_neu_mid_color = input.color(defval=#2A2E39, title='Neutral Mid', group=g_ch) +color i_neu_dark_color = input.color(defval=#141516, title='Neutral Dark', group=g_ch) + +//_____________________________ Chart Settings End + +//_____________________________ 1. Supertrend Start + +[supertrend, direction] = ta.supertrend(i_st_factor, i_st_atr_period) +supertrend := barstate.isfirst ? na : supertrend + +// Plot Supertrend +upTrend = plot(series=direction < 0 ? supertrend : na, title="Supertrend Up", color=i_pos_color, style=plot.style_linebr, force_overlay=true) +downTrend = plot(series=direction < 0 ? na : supertrend, title="Supertrend Down", color=i_neg_color, style=plot.style_linebr, force_overlay=true) +bodyMiddle = plot(series=barstate.isfirst ? na : (open + close) / 2, title="Body Middle", display=display.none, force_overlay=true) +fill(plot1=bodyMiddle, plot2=upTrend, color=color.new(i_pos_color, 90), fillgaps=false) +fill(plot1=bodyMiddle, plot2=downTrend, color=color.new(i_neg_color, 90), fillgaps=false) + +//_____________________________ 1. Supertrend End + +//_____________________________ 2. ATR Start + +ma_function_atr(source, length) => + switch i_atr_range_smoothing + 'RMA' => ta.rma(source, length) + 'SMA' => ta.sma(source, length) + 'EMA' => ta.ema(source, length) + 'WMA' => ta.wma(source, length) + +atr = ma_function_atr(ta.tr(true), i_atr_range_length) +atr_sma = ta.sma(atr, i_atr_range_sma_length) +plot(series=atr, title="ATR", color=i_indicator_color) +plot(series=atr_sma, title="ATR SMA", color=i_signal_color) + +// Range Source +range_input = i_atr_range_choice == 'Auto ATR' ? (atr * i_atr_range_multiplier) : i_atr_range_points +range_source = i_atr_range_choice == 'Type Points' ? i_atr_range_points :range_input + +//_____________________________ 2. ATR End + +//_____________________________ Cumulative Percentage Change Start + +// Function to calculate Daily Cumulative Percentage Change of Close Price +cumulative_percentage_change() => + var float _cum_pct_change = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _daily_pct_change = na(close[1]) ? 0 : (close - close[1]) / close[1] * 100 + _cum_pct_change := _is_new_day ? _daily_pct_change : (na(_cum_pct_change) ? _daily_pct_change : (_cum_pct_change + _daily_pct_change)) + _cum_pct_change + +// Calculate current cumulative percentage change +cum_pchg = cumulative_percentage_change() + +//_____________________________ Cumulative Percentage Change End + +//_____________________________ Cumulative Volume Percentage Change Start + +// Function to calculate Daily Cumulative Volume +cumulative_volume() => + var float _cum_vol = na + _is_new_day = ta.change(time('D')) != 0 ? 1 : 0 + _cum_vol := _is_new_day ? volume : (na(_cum_vol) ? volume : (_cum_vol + volume)) + _cum_vol + +// Calculate current and previous day cumulative volumes +var float current_cum_vol = na +var float prev_cum_vol = na + +if ta.change(time('D')) != 0 + prev_cum_vol := current_cum_vol + current_cum_vol := volume +else + current_cum_vol += volume + +// Calculate Cumulative Volume Percentage Change +cum_vol_pchg = (current_cum_vol - nz(prev_cum_vol, current_cum_vol)) / nz(prev_cum_vol, current_cum_vol) * 100 + +//_____________________________ Cumulative Volume Percentage Change End + +//_____________________________ Additional Filters Start + +// % Change Filter +bool pchg_above_filter = true +bool pchg_below_filter = true +if i_pchg_filter + pchg_above_filter := cum_pchg > i_pchg_above_below + pchg_below_filter := cum_pchg < -i_pchg_above_below + +// Volume % Change Filter +bool vol_pchg_filter = true +if i_vol_pchg_filter + vol_pchg_filter := cum_vol_pchg >= i_vol_pchg_above + +// ATR Filter +bool atr_filter = true +if i_atr_filter + atr_filter := (high - low) > ta.atr(i_atr_length) * i_atr_multi + +// Body Percent Filter +bool body_filter = true +if i_body_filter + body_filter := (math.abs(close - open)) / (high - low) >= i_body_percent + +// Body Size Filter +bool body_size_filter = true +if i_body_size_filter + body_size_filter := (math.abs(close - open)) / (high - low) >= i_body_percent and (high - low) >= (high[1] - low[1]) * i_body_size_multiplier + +// Volume SMA Filter +bool volume_filter = true +if i_volume_filter + volume_filter := volume > ta.sma(volume, i_vol_sma_length) + +// Continuous Signals Filter +average_volume = ta.sma(volume, i_rel_vol_avg_vol_len) +relative_volume = volume / average_volume[1] +rel_vol_sma_multiplier = ta.sma(relative_volume, i_rel_vol_avg_vol_len) * i_rel_vol_avg_vol_multi + +bool rel_vol_filter = true +if i_rel_vol_filter + rel_vol_filter := relative_volume > rel_vol_sma_multiplier + +// Time Filter +bool time_filter = true +if i_time_filter + time_filter := (hour > i_hour_1 or (hour == i_hour_1 and minute >= i_minute_1)) and (hour < i_hour_2 or (hour == i_hour_2 and minute < i_minute_2)) + +//_____________________________ Additional Filters End + +//_____________________________ Signals Start + +// Condition 1 +short_cont = ta.crossunder(close, supertrend) and barstate.isconfirmed +long_cont = ta.crossover(close, supertrend) and barstate.isconfirmed + +// Get Volatility Range After Cross +var top_price = float(na) +var bottom_price = float(na) + +if (short_cont) + bottom_price := close - range_source + top_price := na // Reset top_price to avoid plotting it + +if (long_cont) + top_price := close + range_source + bottom_price := na // Reset bottom_price to avoid plotting it + +// Condition 2 +short_break_cond = + close < bottom_price and + open > close and + atr > atr_sma and + pchg_below_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + barstate.isconfirmed + +long_break_cond = + close > top_price and + open < close and + atr > atr_sma and + pchg_above_filter and + vol_pchg_filter and + atr_filter and + body_filter and + body_size_filter and + volume_filter and + rel_vol_filter and + time_filter and + barstate.isconfirmed + +// Short Signal +var short_current_state = 0 +bear_previous_state = nz(short_current_state[1]) +short_current_state := bear_previous_state == 2 ? 0 : bear_previous_state +if short_cont and short_current_state == 0 + short_current_state := 1 +if short_break_cond and short_current_state == 1 + short_current_state := 2 + +bool short_break_trigger = short_current_state == 2 ? true : false + +// Long Signal +var long_current_state = 0 +bull_previous_state = nz(long_current_state[1]) +long_current_state := bull_previous_state == 2 ? 0 : bull_previous_state +if long_cont and long_current_state == 0 + long_current_state := 1 +if long_break_cond and long_current_state == 1 + long_current_state := 2 + +bool long_break_trigger = long_current_state == 2 ? true : false + +// Plot Supertrend Cross Bar +barcolor(color=short_cont ? i_neg_light_color : long_cont ? i_pos_light_color : na, title='Supertrend Cross Candle') + +// Plot Break Signal +plotshape(series=long_break_trigger ? 3 : na, title='Long Signal', style=shape.triangleup, location=location.belowbar, color=i_pos_light_color, size=size.tiny, force_overlay=true) +plotshape(series=short_break_trigger ? 3 : na, title='Short Signal', style=shape.triangledown, location=location.abovebar, color=i_neg_light_color, size=size.tiny, force_overlay=true) +barcolor(color=short_break_trigger ? i_neg_light_color : long_break_trigger ? i_pos_light_color : na, title='Signal Candle') + +// Plot Historical Range +plot(series=i_atr_range_display and i_atr_range_display and top_price == top_price[1] ? top_price : na, title='Top Range', color=i_pos_color, linewidth=1, style=plot.style_steplinebr, offset=-1, force_overlay=true) +plot(series=i_atr_range_display and i_atr_range_display and bottom_price == bottom_price[1] ? bottom_price : na, title='Bottom Range', color=i_neg_color, linewidth=1, style=plot.style_steplinebr, offset=-1, force_overlay=true) + +//_____________________________ Signals End + +//_____________________________ Data Table Start + +// To String +day_pchg_str = str.tostring(cum_pchg,"#.##") + ' %' +volume_pchg_str = str.tostring(cum_vol_pchg,"#.##") + ' %' +day_volume_str = str.tostring(current_cum_vol/100000,"#.##") + ' L' +prev_day_volume_str = str.tostring(prev_cum_vol/100000,"#.##") + ' L' + +// Color +bgcolor_1 = i_neu_dark_color +bgcolor_2 = i_neu_mid_color + +pchg_col = cum_pchg > 0 ? i_pos_color : i_neg_color +vol_pchg_col = cum_vol_pchg > 0 ? i_pos_color : i_neg_color +prev_vol_pchg_col = prev_cum_vol < current_cum_vol ? i_neg_color : i_pos_color + +// Plot Table +var table tbl_data = table.new(position=i_tbl_data_pos, columns=2, rows=4, border_width=1, force_overlay=true) + +if barstate.islast and i_tbl_data_show + table.cell(table_id=tbl_data, column=0, row=0, text="%Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=0, text=day_pchg_str, text_color=pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=1, text="Vol %Chg", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=1, text=volume_pchg_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=2, text="Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=2, text=day_volume_str, text_color=vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_1, text_size=i_tbl_data_txt_size) + + table.cell(table_id=tbl_data, column=0, row=3, text="PD Vol", text_color=i_neu_color, text_halign=text.align_left, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + table.cell(table_id=tbl_data, column=1, row=3, text=prev_day_volume_str, text_color=prev_vol_pchg_col, text_halign=text.align_right, bgcolor=bgcolor_2, text_size=i_tbl_data_txt_size) + +//_____________________________ Data Table End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_____________________________ Get Symbols for Scanner Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Scanner' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Scanner/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_01, out_01] = feed(effective_symbols), [tid_02, out_02] = feed(out_01), [tid_03, out_03] = feed(out_02), [tid_04, out_04] = feed(out_03), +[tid_05, out_05] = feed(out_04), [tid_06, out_06] = feed(out_05), [tid_07, out_07] = feed(out_06), [tid_08, out_08] = feed(out_07), +[tid_09, out_09] = feed(out_08), [tid_10, out_10] = feed(out_09), [tid_11, out_11] = feed(out_10), [tid_12, out_12] = feed(out_11), +[tid_13, out_13] = feed(out_12), [tid_14, out_14] = feed(out_13), [tid_15, out_15] = feed(out_14), [tid_16, out_16] = feed(out_15), +[tid_17, out_17] = feed(out_16), [tid_18, out_18] = feed(out_17), [tid_19, out_19] = feed(out_18), [tid_20, out_20] = feed(out_19), +[tid_21, out_21] = feed(out_20), [tid_22, out_22] = feed(out_21), [tid_23, out_23] = feed(out_22), [tid_24, out_24] = feed(out_23), +[tid_25, out_25] = feed(out_24), [tid_26, out_26] = feed(out_25), [tid_27, out_27] = feed(out_26), [tid_28, out_28] = feed(out_27), +[tid_29, out_29] = feed(out_28), [tid_30, out_30] = feed(out_29), [tid_31, out_31] = feed(out_30), [tid_32, out_32] = feed(out_31), +[tid_33, out_33] = feed(out_32), [tid_34, out_34] = feed(out_33), [tid_35, out_35] = feed(out_34), [tid_36, out_36] = feed(out_35), +[tid_37, out_37] = feed(out_36), [tid_38, out_38] = feed(out_37), [tid_39, out_39] = feed(out_38), [tid_40, out_40] = feed(out_39) + +//_____________________________ Get Symbols for Scanner End + +//_____________________________ Scanner Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Scanner [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Scanner-By-MUQWISHI/' + +// Scanner Conditions +short_cond = short_break_trigger +long_cond = long_break_trigger + +// Function for Scanner Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + _cum_pchg = float(na) + _cum_vol_pchg = float(na) + signal = int(na) + + if barstate.isconfirmed + // Check for Short Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_long and long_cond + signal := 1 + + // Check for Long Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_short and short_cond + signal := -1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + _cum_pchg := cum_pchg + _cum_vol_pchg := cum_vol_pchg + + [_time, price, _cum_pchg, _cum_vol_pchg, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 6, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, price, _cum_pchg, _cum_vol_pchg, signal)) + +// Scanner function to collect data +screener(s) => + [_time, price, _cum_pchg, _cum_vol_pchg, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + str_cum_pchg = str.tostring(_cum_pchg, '#.##') + str_cum_vol_pchg = str.tostring(_cum_vol_pchg, '#.##') + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, strPrice, str_cum_pchg, str_cum_vol_pchg, strSignal) + +// Call Scanner function for multiple symbols +screener(tid_01), screener(tid_02), screener(tid_03), screener(tid_04), screener(tid_05), screener(tid_06), screener(tid_07), +screener(tid_08), screener(tid_09), screener(tid_10), screener(tid_11), screener(tid_12), screener(tid_13), screener(tid_14), +screener(tid_15), screener(tid_16), screener(tid_17), screener(tid_18), screener(tid_19), screener(tid_20), screener(tid_21), +screener(tid_22), screener(tid_23), screener(tid_24), screener(tid_25), screener(tid_26), screener(tid_27), screener(tid_28), +screener(tid_29), screener(tid_30), screener(tid_31), screener(tid_32), screener(tid_33), screener(tid_34), screener(tid_35), +screener(tid_36), screener(tid_37), screener(tid_38), screener(tid_39), screener(tid_40) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_scr_tbl_disp_rows + while matrix.rows(matrix) > i_scr_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table scr_tbl = table.new(position=i_scr_tbl_position, columns=5, rows=102, border_width=1, force_overlay=true) + +// Function to populate cells in the table +scr_cell_title(col, row, txt) => + table.cell(scr_tbl, col, row, text = txt, text_color = i_neu_color, text_halign=text.align_center, bgcolor=i_neu_dark_color, text_size=i_scr_tbl_text_size) + +scr_cell(col, row, txt, _text_color, _bgcolor) => + table.cell(scr_tbl, col, row, text = txt, text_color = _text_color, text_halign=text.align_left, bgcolor=_bgcolor, text_size=i_scr_tbl_text_size) + +// Check if it's the last bar +if barstate.islast and i_scr_show_table + // Clear existing data in the table + table.clear(scr_tbl, 0, 0, 2, 101) + + scr_cell_title(0, 0, "Sideways Market Skipper") + table.merge_cells(table_id=scr_tbl, start_column=0, start_row=0, end_column=4, end_row=0) + scr_cell_title(0, 1, "Symbol") + scr_cell_title(1, 1, "Time") + scr_cell_title(2, 1, "Price") + scr_cell_title(3, 1, "%Chg") + scr_cell_title(4, 1, "V %Chg") + + j = 4 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + + _textcolor = + matrix.get(matrix, i, 5) == "1" ? i_pos_color : + matrix.get(matrix, i, 5) == "-1" ? i_neg_color : i_neu_color + + _bg_color = + matrix.get(matrix, i, 5) == "1" ? i_pos_dark_color : + matrix.get(matrix, i, 5) == "-1" ? i_neg_dark_color : i_neu_color + + // Populate cells in the table + scr_cell(0, j, matrix.get(matrix, i, 0), _textcolor, _bg_color) + scr_cell(1, j, matrix.get(matrix, i, 1), _textcolor, _bg_color) + scr_cell(2, j, matrix.get(matrix, i, 2), _textcolor, _bg_color) + scr_cell(3, j, matrix.get(matrix, i, 3), _textcolor, _bg_color) + scr_cell(4, j, matrix.get(matrix, i, 4), _textcolor, _bg_color) + + j += 1 + +//_____________________________ Scanner End + +//_____________________________ Code End + +// Readme First: +// +// Trend Following Setup - Sideways Market Skipper Scanner +// +// Long Signal Logic: +// - Close crosses above the Supertrend. +// - Add ATR value (with multiplier) to the close to identify the potential sideways or volatility range. +// - When the price crosses this range, it's considered a breakout. +// - The ATR should be rising or the volatility is increasing. +// +// Short Signal Logic: +// - Close crosses below the Supertrend. +// - Substract ATR value (with multiplier) to the close to identify the potential sideways or volatility range. +// - When the price crosses this range, it's considered a breakdown. +// - The ATR should be rising or the volatility is increasing. +// +// Entry: Enter after the retracement once the signal is generated. + diff --git a/[Screener] ICT Retracement to Order Block with Screener.txt b/[Screener] ICT Retracement to Order Block with Screener.txt index 948d2b1..7d554e1 100644 --- a/[Screener] ICT Retracement to Order Block with Screener.txt +++ b/[Screener] ICT Retracement to Order Block with Screener.txt @@ -1,473 +1,696 @@ -// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -//@version=5 -indicator(title="ICT Retracement to Order Block with Screener", shorttitle="Retracement to OB", overlay=true) - -tt_p = "• Period is the count of candles used to determine the highest high & lowest low." + - "\n• Default period 30 works for all timeframes but is optimized for 15m & 1h." + - "\n• Experiment with other values as needed." -int i_period = input.int(defval=30, title="Period", minval=1, tooltip=tt_p) - -tt_vo = "• Vertical offset is like a buffer in case price doesn't hit the order block exactly." + - "\n• Default is 0, meaning no buffer. The 3rd signal appears only on precise touch to the order block." + - "\n• Example: If 'Vertical Offset (%)' is 50" + - "\n• For Long: Calculate a price 50% higher than the 1st candle's high." + - "\n• For Short: Calculate a price 50% lower than the 1st candle's low." -float i_vertical_offset = input.float(defval=0, title='Vertical Offset (%)', tooltip=tt_vo) / 100 - -//_____________________________ Menu Screener Start -g_tb = 'Screener' -tt_is = "• Input exactly 40 symbols, nothing more or less." + - "\n• Total characters cannot exceed 4096." + - "\n• Use comma as delimiter without any space." + - "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" - -string i_symbols = input.text_area( - defval="NSE:ABCAPITAL,NSE:ANANTRAJ,NSE:ASTERDM,NSE:BANKINDIA,NSE:BIOCON,NSE:CAPACITE,NSE:CESC,NSE:CGPOWER,NSE:DCBBANK,NSE:DELHIVERY,NSE:ELECTCAST,NSE:EXIDEIND,NSE:FINPIPE,NSE:FSL,NSE:GAIL,NSE:GENUSPOWER,NSE:GEPIL,NSE:GMDCLTD,NSE:GREAVESCOT,NSE:HEMIPROP,NSE:HITECH,NSE:HPL,NSE:HSCL,NSE:IIFLSEC,NSE:INDUSTOWER,NSE:IPL,NSE:JAGRAN,NSE:JWL,NSE:KALYANKJIL,NSE:KCP,NSE:L_TFH,NSE:MANINDS,NSE:MOTHERSON,NSE:NAVKARCORP,NSE:NTPC,NSE:ONGC,NSE:PAISALO,NSE:PENIND,NSE:POONAWALLA,NSE:PPLPHARMA", - title="Paste Symbols", tooltip=tt_is, group=g_tb) - -string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) -bool i_scr_show_bull_mc = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) -bool i_scr_show_bear_mc = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) - -int i_tbl_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) -string i_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) -string i_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) -//_____________________________ Menu Screener End - -//_______________________ Menu Line Start -g_ln = "Line Settings" -string i_ln_style = input.string(defval=line.style_solid, title="Style", options=[line.style_solid, line.style_dashed, line.style_dotted], group=g_ln) -int i_ln_width = input.int(defval=1, title="Width", minval=1, group=g_ln) -//_______________________ Menu Line End - -//_______________________ Menu Color Start -g_c = 'Colors' -color i_pos_col = input.color(defval=#22AB94, title='+', inline='c_1', group=g_c) -color i_neg_col = input.color(defval=#F7525F, title='-', inline='c_1', group=g_c) -color i_neu_col = input.color(defval=#B2B5BE, title='0', inline='c_1', group=g_c) -//_______________________ Menu Color End - -//_______________________ Momentum Candle Start -body = math.abs(close - open) -wick = high - low -momentum_candle = body / wick > 0.66 -//_______________________ Momentum Candle End - -//_______________________ ATR Start -atr_support = wick >= ta.atr(14) -//_______________________ ATR End - -//_______________________ Donchain Start -highest_high = ta.highest(high, i_period)[1] -lowest_low = ta.lowest(low, i_period)[1] - -plot(series=highest_high, title="Highest High", color=i_neg_col, display=display.none) -plot(series=lowest_low, title="Lowest Low", color=i_pos_col, display=display.none) -//_______________________ Donchain End - -//___________________________ Primary Signal Start -// Primary Signal Rules -primary_long_condition = barstate.isconfirmed and - open > close and - low < lowest_low and - momentum_candle and - atr_support - -primary_short_condition = barstate.isconfirmed and - open < close and - high > highest_high and - momentum_candle and - atr_support - -// Primary Signal Function -exrem(condition_1, condition_2) => - var entry_signal = 0 - entry_signal := condition_1 ? 1 : condition_2 ? -1 : entry_signal[1] - entry = entry_signal != entry_signal[1] - buy = entry and entry_signal == 1 - sell = entry and entry_signal == -1 - [buy, sell] - -// Primary Signals -[primary_long_signal, primary_short_signal] = exrem(primary_long_condition, primary_short_condition) -//___________________________ Primary Signal End - -//___________________________ Secondary Signal Start -// Acknowledgement & Reference -// Title: 'how to get high of a candle which crossover moving average' -// Link: "https://stackoverflow.com/questions/74894187/how-to-get-high-of-a-candle-which-crossover-moving-average" - -// Secondary Signal Function -trigger(primary_condition, secondary_condition) => - var current_state = 0 - previous_state = nz(current_state[1]) - current_state := previous_state == 2 ? 0 : previous_state - if primary_condition and current_state == 0 - current_state := 1 - if secondary_condition and current_state == 1 - current_state := 2 - trigger_condition = current_state == 2 ? true : false - [current_state, trigger_condition] - -var prev_high_when_crossover = float(na) -if primary_long_signal - prev_high_when_crossover := high - -var prev_low_when_crossunder = float(na) -if primary_short_signal - prev_low_when_crossunder := low - -// Secondary Signal Rules -secondary_long_condition = barstate.isconfirmed and - open < close and - close > prev_high_when_crossover and - //momentum_candle and - atr_support - -secondary_short_condition = barstate.isconfirmed and - open > close and - close < prev_low_when_crossunder and - //momentum_candle and - atr_support - -// Secondary Signal -[secondary_long, secondary_long_signal] = trigger(primary_long_signal, secondary_long_condition) -[secondary_short, secondary_short_signal] = trigger(primary_short_signal, secondary_short_condition) -//___________________________ Secondary Signal End - -//___________________________ Vertical Offset Start -vertical_offset(top_price, bottom_price, offset_value) => - diff = top_price - bottom_price - top_level = top_price + (diff * offset_value) - bottom_level = bottom_price - (diff * offset_value) - [top_level, bottom_level] - -[top_price, bottom_price] = vertical_offset(high, low, i_vertical_offset) -//___________________________ Vertical Offset End - -//___________________________ Teritiary Signal Start -var primary_long_candle_high = float(na) -if primary_long_signal - primary_long_candle_high := top_price - -var primary_short_candle_low = float(na) -if primary_short_signal - primary_short_candle_low := bottom_price - -// Teritiary Signal Rules -teritiary_long_condition = barstate.isconfirmed and - ta.crossunder(low, primary_long_candle_high) - -teritiary_short_condition = barstate.isconfirmed and - ta.crossover(high, primary_short_candle_low) - -// Teritiary Signal -[teritiary_long, teritiary_long_signal] = trigger(secondary_long_signal, teritiary_long_condition) -[teritiary_short, teritiary_short_signal] = trigger(secondary_short_signal, teritiary_short_condition) -//___________________________ Secondary Signal End - -//___________________________ Plot Alert & Break Start -// Plot Long Break & Break -plotshape( - series = primary_long_signal, - title = 'Long Break', - style = shape.circle, - location = location.belowbar, - color = i_pos_col, - text = "1", - textcolor = i_pos_col, - size = size.tiny - ) - -plot(series = primary_long_signal ? high : na, title = 'Past Long Break Line', color = i_pos_col, style = plot.style_stepline_diamond, display = display.none) - -plotshape( - series = secondary_long_signal, - title = 'Long Retrace', - style = shape.circle, - location = location.belowbar, - color = i_pos_col, - text = '2', - textcolor = i_pos_col, - size = size.tiny - ) - -plotshape( - series = teritiary_long_signal, - title = 'Long Retrace', - style = shape.circle, - location = location.belowbar, - color = i_pos_col, - text = '3', - textcolor = i_pos_col, - size = size.tiny - ) - -// Plot Short Break & Break -plotshape( - series = primary_short_signal, - title = "Short Break", - style = shape.circle, - location = location.abovebar, - color = i_neg_col, - text = "1", - textcolor = i_neg_col, - size = size.tiny - ) - -plot(series = primary_short_signal ? low : na, title = 'Past Short Break Line', color = i_neg_col, style = plot.style_stepline_diamond, display = display.none) - -plotshape( - series = secondary_short_signal, - title = 'Short Retrace', - style = shape.circle, - location = location.abovebar, - color = i_neg_col, - text = '2', - textcolor = i_neg_col, - size = size.tiny - ) - -plotshape( - series = teritiary_short_signal, - title = 'Short Retrace', - style = shape.circle, - location = location.abovebar, - color = i_neg_col, - text = '3', - textcolor = i_neg_col, - size = size.tiny - ) -//___________________________ Plot Alert & Break End - -//___________________________ Draw Alert Price Lines Start -// Acknowledgement & Reference -// Trader: "apozdnyakov" -// Indicator Title: "Three horizontal lines on condition" -// Indicator Link: "https://in.tradingview.com/script/hxogJn3E-Three-horizontal-lines-on-condition/" - -var line alert_break_line = na - -if primary_long_signal - line.delete(alert_break_line) - alert_break_line := line.new(x1=bar_index, y1=high, x2=bar_index+1, y2=high, extend=extend.right, color=i_pos_col, style=i_ln_style, width=i_ln_width) - -else if primary_short_signal - line.delete(alert_break_line) - alert_break_line := line.new(x1=bar_index, y1=low, x2=bar_index+1, y2=low, extend=extend.right, color=i_neg_col, style=i_ln_style, width=i_ln_width) -//___________________________ Draw Alert Price Lines Start - -// Plot Historical Breaks -// Acknowledgement & Reference -// Title: "How can I get a value since a condition happen? (Pinescript)" -// Link: "https://stackoverflow.com/questions/73009687/how-can-i-get-a-value-since-a-condition-happen-pinescript" - -//_______________________ Get Symbols Start -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_001, out_001] = feed(i_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), -[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), -[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), -[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), -[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), -[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), -[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), -[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), -[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), -[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) -//_______________________ Get Symbols End - -// _____________________________ Screener Start -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Screener Conditions -bullish_cond = teritiary_long_signal -bearish_cond = teritiary_short_signal - -// Define Bull and Bear Conditions -bull = not(i_scr_direction == "Bearish") -bear = not(i_scr_direction == "Bullish") - -// Function for Screener Indicator Calculation -indicator_calculation() => - // Initialize variables - price = float(na) - _time = int(na) - indicator = "" - signal = int(na) - - if barstate.isconfirmed - // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) - if i_scr_show_bear_mc and bearish_cond and bear - indicator := "▼" - signal := -1 - - // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) - else if i_scr_show_bull_mc and bullish_cond and bull - indicator := "▲" - signal := 1 - - // Update price and time if signal is not null - if not na(signal) - price := math.round_to_mintick(close) - _time := time - - [_time, indicator, price, signal] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 5, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, indicator, price, signal) => - matrix.add_row(matrix, 0, array.from(symbol, _time, indicator, price, signal)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, indicator, price, signal] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if not na(signal) and _time == time - symbolName = symbol(s) - formattedTime = format_time(_time) - strPrice = str.tostring(price) - strSignal = str.tostring(signal) - - // Add data to the matrix - mtxFun(symbolName, formattedTime, indicator, strPrice, strSignal) - -// Call Screener function for multiple symbols -screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), -screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), -screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), -screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), -screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), -screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_tbl_disp_rows - while matrix.rows(matrix) > i_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table tbl = table.new(position=i_tbl_position, columns=4, rows=102, border_width=1) - -// Function to populate cells in the table -cell(col, row, txt, color) => - table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) - -// Check if it's the last bar -if barstate.islast - // Clear existing data in the table - table.clear(tbl, 0, 0, 3, 101) - - // Set headers for the table - cell(0, 0, "Symbol", i_neu_col) - cell(1, 0, "Time", i_neu_col) - cell(2, 0, "Dir" , i_neu_col) - cell(3, 0, "Price", i_neu_col) - - j = 1 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Determine color based on the signal - col = matrix.get(matrix, i, 4) == "1" ? i_pos_col : - matrix.get(matrix, i, 4) == "-1" ? i_neg_col : i_neu_col - - // Populate cells in the table - cell(0, j, matrix.get(matrix, i, 0), col) - cell(1, j, matrix.get(matrix, i, 1), col) - cell(2, j, matrix.get(matrix, i, 2), col) - cell(3, j, matrix.get(matrix, i, 3), col) - - j += 1 -// _____________________________ Screener End -// _____________________________ Code End - -// Read Me -// -// Title: Retracement to Order Block with Screener -// Date: Created on 14 January 2024 -// -// One-liner: -// # The indicator aims to identify the candle returning to the order block through a screener. -// -// Important Notes: -// # This inicator does not strictly adhere to the 100% rules of ICT order block. -// # Due to coding limitations, only the core ideas of ICT concepts are implemented. -// # The screener won't identify the trend, so it is essential to confirm the direction independently. -// # The screener and the indicator may display inaccurate results. -// # Avoid blindly following the signals. -// -// Order Block identification (For those who are unfamiliar): -// # Identifying the lowest or highest candle that breaks the old lowest low or highest high, respectively. -// # If a candle closes above or below it, the lowest or highest candle can be considered as an order block. -// # Afterward, the price should move 2 or 3 times away from the order block candle. -// # After that, when the price returns to the close of the order block, it can be considered as an entry. -// -// Multi-timeframe Analysis for Trend Confirmation (For those who are unfamiliar): -// # Utilize three different timeframes for a comprehensive approach and trend confirmation. -// # For Positional use Monthly, Weekly, and Daily. -// # For Intraday or Swings use 1 Hour, 15 Minutes, and 5 Minutes. -// -// Learning Resource (For those who are unfamiliar): -// # For a more in-depth understanding, study the order block concept by Michael Joe Huddleston, popularly known as 'ICT' or 'The Inner Circle Trader'. -// # Due to the interrelated nature of various topics and jargon, it is recommended to watch the associated lessons for a more comprehensive understanding of entry and exit rules. -// -// How to Use the Indicator for Long: -// # Signal 1: This identifies the order block candle. It is a candle above 66% of the body that breaks the low of the past 30 candles. -// # Signal 2: It occurs when a momentum candle closes above the high of Signal 1 candle (order block). -// # Signal 3: Occurs when, after Signal 2 candle, the price returns to the high of the order block (Signal 1 candle). -// -// How to Use the Indicator for Short: -// # Signal 1: This identifies the order block candle. It is a candle above 66% of the body that breaks the high of the past 30 candles. -// # Signal 2: It occurs when a momentum candle closes below the low of Signal 1 candle (order block). -// # Signal 3: Occurs when, after Signal 2 candle, the price returns to the low of the order block (Signal 1 candle). -// -// Timeframe Considerations: -// # Period is the count of candles used to determine the highest high & lowest low. -// # The default period is set to 30, which works for all timeframes, but it is mainly optimized for 15m and 1h. -// # Experiment with other values as for different timeframes as per your requirement. -// -// How to use Vertical Offset: -// # Vertical offset acts as a buffer in case the price doesn't precisely hit the order block. -// # The default is 0, indicating no buffer. The 3rd signal appears only on a precise touch to the order block. -// # Example: If 'Vertical Offset (%)' is set to 50: -// # For Long it calculates a price 50% higher than the 1st candle's high. -// # For Short it calculates a price 50% lower than the 1st candle's low. -// -// The Screener and Its Limitations: -// # You can only upto 40 symbols in this format EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B -// -// # Note: Always exercise caution and discretion, considering market conditions and other factors, while using this indicator. +// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +//@version=5 +indicator(title="ICT Retracement to Order Block with Screener", shorttitle="Retracement to OB", overlay=true) + +tt_p = "• Period is the count of candles used to determine the highest high & lowest low." + + "\n• Default period 30 works for all timeframes but is optimized for 15m & 1h." + + "\n• Experiment with other values as needed." +int i_period = input.int(defval=30, title="Period", minval=1, tooltip=tt_p) + +tt_vo = "• Vertical offset is like a buffer in case price doesn't hit the order block exactly." + + "\n• Default is 0, meaning no buffer. The 3rd signal appears only on precise touch to the order block." + + "\n• Example: If 'Vertical Offset (%)' is 50" + + "\n• For Long: Calculate a price 50% higher than the 1st candle's high." + + "\n• For Short: Calculate a price 50% lower than the 1st candle's low." +float i_vertical_offset = input.float(defval=0, title='Vertical Offset (%)', tooltip=tt_vo) / 100 + +//_____________________________ Menu Screener Start +g_tb = 'Screener' +tt_is = "• Input exactly 40 symbols, nothing more or less." + + "\n• Total characters cannot exceed 4096." + + "\n• Use comma as delimiter without any space." + + "\n• Eg: EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B" + +string i_symbols = input.text_area( + defval="NSE:ABCAPITAL,NSE:ANANTRAJ,NSE:ASTERDM,NSE:BANKINDIA,NSE:BIOCON,NSE:CAPACITE,NSE:CESC,NSE:CGPOWER,NSE:DCBBANK,NSE:DELHIVERY,NSE:ELECTCAST,NSE:EXIDEIND,NSE:FINPIPE,NSE:FSL,NSE:GAIL,NSE:GENUSPOWER,NSE:GEPIL,NSE:GMDCLTD,NSE:GREAVESCOT,NSE:HEMIPROP,NSE:HITECH,NSE:HPL,NSE:HSCL,NSE:IIFLSEC,NSE:INDUSTOWER,NSE:IPL,NSE:JAGRAN,NSE:JWL,NSE:KALYANKJIL,NSE:KCP,NSE:L_TFH,NSE:MANINDS,NSE:MOTHERSON,NSE:NAVKARCORP,NSE:NTPC,NSE:ONGC,NSE:PAISALO,NSE:PENIND,NSE:POONAWALLA,NSE:PPLPHARMA", + title="Paste Symbols", tooltip=tt_is, group=g_tb) + +string i_scr_direction = input.string(defval='Both', title='Direction', options=['Both', 'Bullish', 'Bearish'], inline='tb_1', group=g_tb) +bool i_scr_show_bull_mc = input.bool(defval=true, title='Only Bullish', inline='tb_2', group=g_tb) +bool i_scr_show_bear_mc = input.bool(defval=true, title='Only Bearish', inline='tb_2', group=g_tb) + +int i_tbl_disp_rows = input.int(defval=16, title='Display Rows', minval=0, maxval=100, group=g_tb) +string i_tbl_position = input.string(defval=position.bottom_left, title='Table Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) +string i_tbl_text_size = input.string(defval=size.small, title='Table Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) +//_____________________________ Menu Screener End + +//_______________________ Menu Line Start +g_ln = "Line Settings" +string i_ln_style = input.string(defval=line.style_solid, title="Style", options=[line.style_solid, line.style_dashed, line.style_dotted], group=g_ln) +int i_ln_width = input.int(defval=1, title="Width", minval=1, group=g_ln) +//_______________________ Menu Line End + +//_______________________ Menu Color Start +g_c = 'Colors' +color i_pos_col = input.color(defval=#22AB94, title='+', inline='c_1', group=g_c) +color i_neg_col = input.color(defval=#F7525F, title='-', inline='c_1', group=g_c) +color i_neu_col = input.color(defval=#B2B5BE, title='0', inline='c_1', group=g_c) +//_______________________ Menu Color End + +//_______________________ Momentum Candle Start +body = math.abs(close - open) +wick = high - low +momentum_candle = body / wick > 0.66 +//_______________________ Momentum Candle End + +//_______________________ ATR Start +atr_support = wick >= ta.atr(14) +//_______________________ ATR End + +//_______________________ Donchain Start +highest_high = ta.highest(high, i_period)[1] +lowest_low = ta.lowest(low, i_period)[1] + +plot(series=highest_high, title="Highest High", color=i_neg_col, display=display.none) +plot(series=lowest_low, title="Lowest Low", color=i_pos_col, display=display.none) +//_______________________ Donchain End + +//___________________________ Primary Signal Start +// Primary Signal Rules +primary_long_condition = barstate.isconfirmed and + open > close and + low < lowest_low and + momentum_candle and + atr_support + +primary_short_condition = barstate.isconfirmed and + open < close and + high > highest_high and + momentum_candle and + atr_support + +// Primary Signal Function +exrem(condition_1, condition_2) => + var entry_signal = 0 + entry_signal := condition_1 ? 1 : condition_2 ? -1 : entry_signal[1] + entry = entry_signal != entry_signal[1] + buy = entry and entry_signal == 1 + sell = entry and entry_signal == -1 + [buy, sell] + +// Primary Signals +[primary_long_signal, primary_short_signal] = exrem(primary_long_condition, primary_short_condition) +//___________________________ Primary Signal End + +//___________________________ Secondary Signal Start +// Acknowledgement & Reference +// Title: 'how to get high of a candle which crossover moving average' +// Link: "https://stackoverflow.com/questions/74894187/how-to-get-high-of-a-candle-which-crossover-moving-average" + +// Secondary Signal Function +trigger(primary_condition, secondary_condition) => + var current_state = 0 + previous_state = nz(current_state[1]) + current_state := previous_state == 2 ? 0 : previous_state + if primary_condition and current_state == 0 + current_state := 1 + if secondary_condition and current_state == 1 + current_state := 2 + trigger_condition = current_state == 2 ? true : false + [current_state, trigger_condition] + +var prev_high_when_crossover = float(na) +if primary_long_signal + prev_high_when_crossover := high + +var prev_low_when_crossunder = float(na) +if primary_short_signal + prev_low_when_crossunder := low + +// Secondary Signal Rules +secondary_long_condition = barstate.isconfirmed and + open < close and + close > prev_high_when_crossover and + //momentum_candle and + atr_support + +secondary_short_condition = barstate.isconfirmed and + open > close and + close < prev_low_when_crossunder and + //momentum_candle and + atr_support + +// Secondary Signal +[secondary_long, secondary_long_signal] = trigger(primary_long_signal, secondary_long_condition) +[secondary_short, secondary_short_signal] = trigger(primary_short_signal, secondary_short_condition) +//___________________________ Secondary Signal End + +//___________________________ Vertical Offset Start +vertical_offset(top_price, bottom_price, offset_value) => + diff = top_price - bottom_price + top_level = top_price + (diff * offset_value) + bottom_level = bottom_price - (diff * offset_value) + [top_level, bottom_level] + +[top_price, bottom_price] = vertical_offset(high, low, i_vertical_offset) +//___________________________ Vertical Offset End + +//___________________________ Teritiary Signal Start +var primary_long_candle_high = float(na) +if primary_long_signal + primary_long_candle_high := top_price + +var primary_short_candle_low = float(na) +if primary_short_signal + primary_short_candle_low := bottom_price + +// Teritiary Signal Rules +teritiary_long_condition = barstate.isconfirmed and + ta.crossunder(low, primary_long_candle_high) + +teritiary_short_condition = barstate.isconfirmed and + ta.crossover(high, primary_short_candle_low) + +// Teritiary Signal +[teritiary_long, teritiary_long_signal] = trigger(secondary_long_signal, teritiary_long_condition) +[teritiary_short, teritiary_short_signal] = trigger(secondary_short_signal, teritiary_short_condition) +//___________________________ Secondary Signal End + +//___________________________ Plot Alert & Break Start +// Plot Long Break & Break +plotshape( + series = primary_long_signal, + title = 'Long Break', + style = shape.circle, + location = location.belowbar, + color = i_pos_col, + text = "1", + textcolor = i_pos_col, + size = size.tiny + ) + +plot(series = primary_long_signal ? high : na, title = 'Past Long Break Line', color = i_pos_col, style = plot.style_stepline_diamond, display = display.none) + +plotshape( + series = secondary_long_signal, + title = 'Long Retrace', + style = shape.circle, + location = location.belowbar, + color = i_pos_col, + text = '2', + textcolor = i_pos_col, + size = size.tiny + ) + +plotshape( + series = teritiary_long_signal, + title = 'Long Retrace', + style = shape.circle, + location = location.belowbar, + color = i_pos_col, + text = '3', + textcolor = i_pos_col, + size = size.tiny + ) + +// Plot Short Break & Break +plotshape( + series = primary_short_signal, + title = "Short Break", + style = shape.circle, + location = location.abovebar, + color = i_neg_col, + text = "1", + textcolor = i_neg_col, + size = size.tiny + ) + +plot(series = primary_short_signal ? low : na, title = 'Past Short Break Line', color = i_neg_col, style = plot.style_stepline_diamond, display = display.none) + +plotshape( + series = secondary_short_signal, + title = 'Short Retrace', + style = shape.circle, + location = location.abovebar, + color = i_neg_col, + text = '2', + textcolor = i_neg_col, + size = size.tiny + ) + +plotshape( + series = teritiary_short_signal, + title = 'Short Retrace', + style = shape.circle, + location = location.abovebar, + color = i_neg_col, + text = '3', + textcolor = i_neg_col, + size = size.tiny + ) +//___________________________ Plot Alert & Break End + +//___________________________ Draw Alert Price Lines Start +// Acknowledgement & Reference +// Trader: "apozdnyakov" +// Indicator Title: "Three horizontal lines on condition" +// Indicator Link: "https://in.tradingview.com/script/hxogJn3E-Three-horizontal-lines-on-condition/" + +var line alert_break_line = na + +if primary_long_signal + line.delete(alert_break_line) + alert_break_line := line.new(x1=bar_index, y1=high, x2=bar_index+1, y2=high, extend=extend.right, color=i_pos_col, style=i_ln_style, width=i_ln_width) + +else if primary_short_signal + line.delete(alert_break_line) + alert_break_line := line.new(x1=bar_index, y1=low, x2=bar_index+1, y2=low, extend=extend.right, color=i_neg_col, style=i_ln_style, width=i_ln_width) +//___________________________ Draw Alert Price Lines Start + +// Plot Historical Breaks +// Acknowledgement & Reference +// Title: "How can I get a value since a condition happen? (Pinescript)" +// Link: "https://stackoverflow.com/questions/73009687/how-can-i-get-a-value-since-a-condition-happen-pinescript" + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_______________________ Get Symbols Start +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_001, out_001] = feed(effective_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), +[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), +[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), +[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), +[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), +[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), +[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), +[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), +[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), +[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) +//_______________________ Get Symbols End + +// _____________________________ Screener Start +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Screener Conditions +bullish_cond = teritiary_long_signal +bearish_cond = teritiary_short_signal + +// Define Bull and Bear Conditions +bull = not(i_scr_direction == "Bearish") +bear = not(i_scr_direction == "Bullish") + +// Function for Screener Indicator Calculation +indicator_calculation() => + // Initialize variables + price = float(na) + _time = int(na) + indicator = "" + signal = int(na) + + if barstate.isconfirmed + // Check for Bearish Momentum Candle and conditions (Modify here to customize indicators) + if i_scr_show_bear_mc and bearish_cond and bear + indicator := "▼" + signal := -1 + + // Check for Bullish Momentum Candle and conditions (Modify here to customize indicators) + else if i_scr_show_bull_mc and bullish_cond and bull + indicator := "▲" + signal := 1 + + // Update price and time if signal is not null + if not na(signal) + price := math.round_to_mintick(close) + _time := time + + [_time, indicator, price, signal] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 5, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, indicator, price, signal) => + matrix.add_row(matrix, 0, array.from(symbol, _time, indicator, price, signal)) + +// Screener function to collect data +screener(s) => + [_time, indicator, price, signal] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if not na(signal) and _time == time + symbolName = symbol(s) + formattedTime = format_time(_time) + strPrice = str.tostring(price) + strSignal = str.tostring(signal) + + // Add data to the matrix + mtxFun(symbolName, formattedTime, indicator, strPrice, strSignal) + +// Call Screener function for multiple symbols +screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), +screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), +screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), +screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), +screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), +screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_tbl_disp_rows + while matrix.rows(matrix) > i_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table tbl = table.new(position=i_tbl_position, columns=4, rows=102, border_width=1) + +// Function to populate cells in the table +cell(col, row, txt, color) => + table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 90), text_size=i_tbl_text_size) + +// Check if it's the last bar +if barstate.islast + // Clear existing data in the table + table.clear(tbl, 0, 0, 3, 101) + + // Set headers for the table + cell(0, 0, "Symbol", i_neu_col) + cell(1, 0, "Time", i_neu_col) + cell(2, 0, "Dir" , i_neu_col) + cell(3, 0, "Price", i_neu_col) + + j = 1 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Determine color based on the signal + col = matrix.get(matrix, i, 4) == "1" ? i_pos_col : + matrix.get(matrix, i, 4) == "-1" ? i_neg_col : i_neu_col + + // Populate cells in the table + cell(0, j, matrix.get(matrix, i, 0), col) + cell(1, j, matrix.get(matrix, i, 1), col) + cell(2, j, matrix.get(matrix, i, 2), col) + cell(3, j, matrix.get(matrix, i, 3), col) + + j += 1 +// _____________________________ Screener End +// _____________________________ Code End + +// Read Me +// +// Title: Retracement to Order Block with Screener +// Date: Created on 14 January 2024 +// +// One-liner: +// # The indicator aims to identify the candle returning to the order block through a screener. +// +// Important Notes: +// # This inicator does not strictly adhere to the 100% rules of ICT order block. +// # Due to coding limitations, only the core ideas of ICT concepts are implemented. +// # The screener won't identify the trend, so it is essential to confirm the direction independently. +// # The screener and the indicator may display inaccurate results. +// # Avoid blindly following the signals. +// +// Order Block identification (For those who are unfamiliar): +// # Identifying the lowest or highest candle that breaks the old lowest low or highest high, respectively. +// # If a candle closes above or below it, the lowest or highest candle can be considered as an order block. +// # Afterward, the price should move 2 or 3 times away from the order block candle. +// # After that, when the price returns to the close of the order block, it can be considered as an entry. +// +// Multi-timeframe Analysis for Trend Confirmation (For those who are unfamiliar): +// # Utilize three different timeframes for a comprehensive approach and trend confirmation. +// # For Positional use Monthly, Weekly, and Daily. +// # For Intraday or Swings use 1 Hour, 15 Minutes, and 5 Minutes. +// +// Learning Resource (For those who are unfamiliar): +// # For a more in-depth understanding, study the order block concept by Michael Joe Huddleston, popularly known as 'ICT' or 'The Inner Circle Trader'. +// # Due to the interrelated nature of various topics and jargon, it is recommended to watch the associated lessons for a more comprehensive understanding of entry and exit rules. +// +// How to Use the Indicator for Long: +// # Signal 1: This identifies the order block candle. It is a candle above 66% of the body that breaks the low of the past 30 candles. +// # Signal 2: It occurs when a momentum candle closes above the high of Signal 1 candle (order block). +// # Signal 3: Occurs when, after Signal 2 candle, the price returns to the high of the order block (Signal 1 candle). +// +// How to Use the Indicator for Short: +// # Signal 1: This identifies the order block candle. It is a candle above 66% of the body that breaks the high of the past 30 candles. +// # Signal 2: It occurs when a momentum candle closes below the low of Signal 1 candle (order block). +// # Signal 3: Occurs when, after Signal 2 candle, the price returns to the low of the order block (Signal 1 candle). +// +// Timeframe Considerations: +// # Period is the count of candles used to determine the highest high & lowest low. +// # The default period is set to 30, which works for all timeframes, but it is mainly optimized for 15m and 1h. +// # Experiment with other values as for different timeframes as per your requirement. +// +// How to use Vertical Offset: +// # Vertical offset acts as a buffer in case the price doesn't precisely hit the order block. +// # The default is 0, indicating no buffer. The 3rd signal appears only on a precise touch to the order block. +// # Example: If 'Vertical Offset (%)' is set to 50: +// # For Long it calculates a price 50% higher than the 1st candle's high. +// # For Short it calculates a price 50% lower than the 1st candle's low. +// +// The Screener and Its Limitations: +// # You can only upto 40 symbols in this format EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B +// +// # Note: Always exercise caution and discretion, considering market conditions and other factors, while using this indicator. diff --git a/[Screener] Market Profile with Screener (Based on [RS]Market Profile by RicardoSantos).txt b/[Screener] Market Profile with Screener (Based on [RS]Market Profile by RicardoSantos).txt index b18c7a8..29d629f 100644 --- a/[Screener] Market Profile with Screener (Based on [RS]Market Profile by RicardoSantos).txt +++ b/[Screener] Market Profile with Screener (Based on [RS]Market Profile by RicardoSantos).txt @@ -1,374 +1,597 @@ -// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ -// © Arun_K_Bhaskar - -// Acknowledgement & Reference -// Trader: 'RicardoSantos' -// Indicator Title: '[RS]Market Profile' -// Indicator Link: 'https://www.tradingview.com/script/uoysXxWM-RS-Market-Profile/' - -//@version=5 -indicator(title='Market Profile with Screener (Based on [RS]Market Profile by RicardoSantos)', shorttitle='Market Profile Screener', overlay=true, max_lines_count=300, max_boxes_count=300) - -//_____________________________ Market Profile Start - -// ||-- Inputs: -g_mp='Market Profile' -string i_session_timeframe = input.string(defval='5D', title='Timeframe', group=g_mp) -float i_percent_of_tpo = input.float(defval=0.7, title='TPO %', group=g_mp) -int i_sessions = input.int(defval=1, title='Show Last', minval=0, maxval=40, group=g_mp) -color i_poc_col = input.color(defval=#EA738D, title='Point of Control', group=g_mp) -color i_va_col = input.color(defval=#89ABE3, title='Value Area', group=g_mp) -color i_open_col = input.color(defval=color.silver, title='Open', group=g_mp) -int i_mp_transp = input.int(defval=100, title='Transparency', minval=0, maxval=100, group=g_mp) - -// ||-- Extra Functions: -f_line_stack(_array, _max_elements, _new_element) => - int _size = array.size(_array) - if _size >= _max_elements - line.delete(array.pop(_array)) - array.unshift(_array, _new_element) -f_open_session_line(_x1, _y1, _x2, _y2) => - line.new(_x1, _y1, _x2, _y2, xloc=xloc.bar_time, color=i_open_col, style=line.style_dashed) - -f_box_stack(_array, _max_elements, _new_element) => - int _size = array.size(_array) - if _size >= _max_elements - box.delete(array.pop(_array)) - array.unshift(_array, _new_element) - -f_poc_box(_x1, _y1, _x2, _y2) => - box.new(_x1, _y1, _x2, _y2, border_color=i_poc_col, xloc=xloc.bar_time, bgcolor=color.new(i_poc_col, i_mp_transp)) -f_vah_box(_x1, _y1, _x2, _y2) => - box.new(_x1, _y1, _x2, _y2, border_color=i_va_col, xloc=xloc.bar_time, bgcolor=color.new(i_va_col, i_mp_transp)) - -var line[] open_session_lines = array.new_line(0) -var box[] poc_boxes = array.new_box(0) -var box[] vah_boxes = array.new_box(0) - -float tf_high = high -float tf_low = low -float tf_close = close - -// ||-- Bars since session started: -isnewsession = ta.change(time(i_session_timeframe)) != 0 - -var int session_bar_counter = 0 -var int previous_session_start = na -var int previous_session_end = na -var int session_time_range = na - -if isnewsession - session_bar_counter := 0 - previous_session_start := previous_session_end - previous_session_end := time - session_time_range := previous_session_end - previous_session_start - session_time_range -else - session_bar_counter += 1 - session_bar_counter - -// ||-- session high, low, range: -var float session_high = tf_high -var float session_low = tf_low -var float session_range = tf_high - tf_low - -// ||-- recalculate session high, low and range: -if session_bar_counter == 0 - session_high := tf_high - session_low := tf_low - session_range := tf_high - tf_low - session_range -if tf_high > session_high[1] - session_high := tf_high - session_range := session_high - session_low - session_range -if tf_low < session_low[1] - session_low := tf_low - session_range := session_high - session_low - session_range - -// ||-- define tpo section range: -tpo_section_range = session_range / 20 - -// ||-- function to get the frequency a specified range is visited: -f_frequency_of_range(_src, _upper_range, _lower_range, _length) => - _adjusted_length = _length < 1 ? 1 : _length - _frequency = 0 - for _i = 0 to _adjusted_length - 1 by 1 - if _src[_i] >= _lower_range and _src[_i] < _upper_range - _frequency += 1 - _frequency - _return = nz(_frequency, 0) // _adjusted_length - _return - -// ||-- frequency the tpo range is visited: -tpo_00 = f_frequency_of_range(tf_close, session_high, session_high - tpo_section_range * 1, session_bar_counter) -tpo_01 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 1, session_high - tpo_section_range * 2, session_bar_counter) -tpo_02 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 2, session_high - tpo_section_range * 3, session_bar_counter) -tpo_03 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 3, session_high - tpo_section_range * 4, session_bar_counter) -tpo_04 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 4, session_high - tpo_section_range * 5, session_bar_counter) -tpo_05 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 5, session_high - tpo_section_range * 6, session_bar_counter) -tpo_06 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 6, session_high - tpo_section_range * 7, session_bar_counter) -tpo_07 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 7, session_high - tpo_section_range * 8, session_bar_counter) -tpo_08 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 8, session_high - tpo_section_range * 9, session_bar_counter) -tpo_09 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 9, session_high - tpo_section_range * 10, session_bar_counter) -tpo_10 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 10, session_high - tpo_section_range * 11, session_bar_counter) -tpo_11 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 11, session_high - tpo_section_range * 12, session_bar_counter) -tpo_12 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 12, session_high - tpo_section_range * 13, session_bar_counter) -tpo_13 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 13, session_high - tpo_section_range * 14, session_bar_counter) -tpo_14 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 14, session_high - tpo_section_range * 15, session_bar_counter) -tpo_15 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 15, session_high - tpo_section_range * 16, session_bar_counter) -tpo_16 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 16, session_high - tpo_section_range * 17, session_bar_counter) -tpo_17 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 17, session_high - tpo_section_range * 18, session_bar_counter) -tpo_18 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 18, session_high - tpo_section_range * 19, session_bar_counter) -tpo_19 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 19, session_high - tpo_section_range * 20, session_bar_counter) -tpo_20 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 20, session_high - tpo_section_range * 21, session_bar_counter) - -// ||-- function to retrieve a specific tpo value -f_get_tpo_count(_value) => - _return = switch (_value) - 0 => tpo_00 - 1 => tpo_01 - 2 => tpo_02 - 3 => tpo_03 - 4 => tpo_04 - 5 => tpo_05 - 6 => tpo_06 - 7 => tpo_07 - 8 => tpo_08 - 9 => tpo_09 - 10 => tpo_10 - 11 => tpo_11 - 12 => tpo_12 - 13 => tpo_13 - 14 => tpo_14 - 15 => tpo_15 - 16 => tpo_16 - 17 => tpo_17 - 18 => tpo_18 - 19 => tpo_19 - 20 => tpo_20 - => 0.0 - -tpo_sum = 0.0 -current_poc_position = 0.0 -current_poc_value = 0.0 - -for _i = 0 to 20 by 1 - _get_tpo_value = f_get_tpo_count(_i) - tpo_sum += _get_tpo_value - if _get_tpo_value >= current_poc_value - current_poc_position := _i - current_poc_value := _get_tpo_value - current_poc_value - -poc_upper = session_high - tpo_section_range * current_poc_position -poc_lower = session_high - tpo_section_range * (current_poc_position + 1) - -// ||-- get value area high/low -vah_position = current_poc_position -val_position = current_poc_position -current_sum = current_poc_value - -for _i = 0 to 20 by 1 - if current_sum < tpo_sum * i_percent_of_tpo - vah_position := math.max(0, vah_position - 1) - current_sum += f_get_tpo_count(math.round(vah_position)) - current_sum - if current_sum < tpo_sum * i_percent_of_tpo - val_position := math.min(20, val_position + 1) - current_sum += f_get_tpo_count(math.round(val_position)) - current_sum - -vah_value = session_high - tpo_section_range * vah_position -val_value = session_high - tpo_section_range * (val_position + 1) - -if isnewsession - f_box_stack(vah_boxes, i_sessions, f_vah_box(previous_session_end, vah_value[1], time_close(i_session_timeframe), val_value[1])) - f_box_stack(poc_boxes, i_sessions, f_poc_box(previous_session_end, poc_upper[1], time_close(i_session_timeframe), poc_lower[1])) - f_line_stack(open_session_lines, i_sessions, f_open_session_line(previous_session_end, open, time_close(i_session_timeframe), open)) - -// Function to get the pivot value -vahl_pivot_value(src) => - ta.valuewhen(session_bar_counter == 0, src[1], 0) - -// Get VAH and VAL pivots -vah_pivot = vahl_pivot_value(vah_value) -val_pivot = vahl_pivot_value(val_value) -poc_pivot = vahl_pivot_value(math.avg(poc_upper, poc_lower)) - -// Calculate percentage between VAH and VAL -va_percent = ((vah_pivot - val_pivot) / val_pivot) * 100 -poc_percent = ((close - poc_pivot) / poc_pivot) * 100 -//_____________________________ Market Profile End - - -//_____________________________ Screener Start - -// Note: -// - TradingView allows up to 40 requests per indicator, so keep the number of symbols below 40. -// - Too many requests and complex calculations may slow down the indicator. -// - You can combine multiple indicators in one script, like Close crossing above EMA 20, RSI crossing 60, etc. - -//_____________________________ Menu Screener Table Start - -g_tb = 'Screener : Table' -tt_is = //"• Input exactly 40 symbols, nothing more or less." + - "• Total characters cannot exceed 4096." + - "\n• Use comma as delimiter without any space." + - "\n• Eg: 'EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B'" - -string i_symbols = input.text_area( - defval='NSE:ADANIPOWER,NSE:ARVIND,NSE:ASHOKA,NSE:BANKINDIA,NSE:BLS,NSE:BOMDYEING,NSE:CUB,NSE:DBL,NSE:DELTACORP,NSE:ENGINERSIN,NSE:GIPCL,NSE:GMDCLTD,NSE:GPPL,NSE:HINDCOPPER,NSE:INDIACEM,NSE:INOXWIND,NSE:IPL,NSE:IRCON,NSE:ITI,NSE:JAMNAAUTO,NSE:JKTYRE,NSE:KESORAMIND,NSE:LEMONTREE,NSE:MOIL,NSE:MRPL,NSE:NLCINDIA,NSE:ONMOBILE,NSE:PFC,NSE:PPLPHARMA,NSE:PTC,NSE:RAILTEL,NSE:RCF,NSE:RVNL,NSE:SHRIRAMPPS,NSE:TI,NSE:WELCORP,NSE:L_TFH,NSE:WOCKPHARMA,NSE:ZOMATO', - title="Paste Symbols", tooltip=tt_is, group=g_tb) - -float i_va_above = input.float(defval=0, title='VA % Between', minval=0, maxval=100, inline='1', group=g_tb) -float i_va_below = input.float(defval=3, title='', minval=0, maxval=100, inline='1', group=g_tb) - -float i_ltp_above = input.float(defval=-10, title='LTP % Between', inline='2', group=g_tb) -float i_ltp_below = input.float(defval=10, title='', inline='2', group=g_tb) - - -int i_tbl_disp_rows = input.int(defval=15, title='Display Rows', minval=0, maxval=100, group=g_tb) -string i_tbl_position = input.string(defval=position.bottom_left, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) -string i_tbl_text_size = input.string(defval=size.small, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) - -color i_tbl_neu_col = input.color(defval=#B2B5BE, title='Color', group=g_tb) - -//_____________________________ Menu Screener Table End - -//_______________________ Get Symbols Start - -// Acknowledgement & Reference -// Trader: 'allanster' -// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' -// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' - -feed(back) => // extract tickerid and decrement list of ticker IDs - loop = back // declare string variable to hold content list - getT = string(na) // declare string variable to hold tickerid - if str.length(loop) == 0 // if list is empty - getT := string(na) // assign na to tickerid variable - loop := string(na) // assign na to list of ticker Ids variable - else // else extract first tickerid - getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character - getT := str.substring(loop, 0, getP) // get tickerid in first position of list - loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list - [getT, loop] // return tickerid in first position & truncated list - -[tid_001, out_001] = feed(i_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), -[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), -[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), -[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), -[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), -[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), -[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), -[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), -[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), -[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) - -//_______________________ Get Symbols End - -// _____________________________ Screener Start - -// Acknowledgement & Reference -// Trader: 'MUQWISHI' -// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' -// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' - -// Function for Screener Indicator Calculation - -screener_condition = va_percent > i_va_above and va_percent <= i_va_below and poc_percent <= i_ltp_below and poc_percent >= i_ltp_above - -truncate(number, decimals) => - factor = math.pow(10, decimals) - int(number * factor) / factor - -indicator_calculation() => - // Initialize variables - percent = float(na) - _time = int(na) - pchg = float(na) - - if screener_condition - percent := truncate(va_percent, 2) - _time := time - pchg := truncate(poc_percent, 2) - - [_time, percent, pchg] - -// Function to format time -format_time(x) => - timezone = syminfo.timezone - timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) - -// Function to extract symbol name -symbol(s) => - array.get(str.split(s, ":"), 1) - -// Matrix setup -var matrix = matrix.new(0, 4, na) - -// Function to add rows to the matrix -mtxFun(symbol, _time, percent, pchg) => - matrix.add_row(matrix, 0, array.from(symbol, _time, percent, pchg)) - -// Screener function to collect data -screener(s) => - sym = ticker.modify(s, syminfo.session) - [_time, percent, pchg] = request.security(sym, timeframe.period, indicator_calculation()) - - // Check if the signal is not na and the time matches - if _time == time - mtxFun(symbol(s), format_time(_time), str.tostring(percent), str.tostring(pchg)) - -// Call Screener function for multiple symbols -screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), -screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), -screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), -screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), -screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), -screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) - -// Trim excess rows in the matrix -if matrix.rows(matrix) > i_tbl_disp_rows - while matrix.rows(matrix) > i_tbl_disp_rows - matrix.remove_row(matrix, matrix.rows(matrix)-1) - -// Plot Table -// Create table with specified properties -var table tbl = table.new(position=i_tbl_position, columns=4, rows=102, border_width=1) - -tt_tbl = "Time: Signal generation time.\n" + - "% VAHL: Percentage between VAH & VAL.\n" + - "% LTP: Percentage change from POC mid to LTP." - -// Function to populate cells in the table -cell(col, row, txt, color) => - table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 80), text_size=i_tbl_text_size, tooltip=tt_tbl) - -// Check if it's the last bar -if barstate.islast - // Clear existing data in the table - table.clear(tbl, 0, 0, 3, 101) - - // Set headers for the table - cell(0, 0, "Symbol", i_tbl_neu_col) - cell(1, 0, "Time", i_tbl_neu_col) - cell(2, 0, "% VAHL" , i_tbl_neu_col) - cell(3, 0, "% LTP" , i_tbl_neu_col) - - j = 1 - // Populate table with matrix data - if matrix.rows(matrix) > 0 - for i = 0 to matrix.rows(matrix) - 1 - // Populate cells in the table - cell(0, j, matrix.get(matrix, i, 0), i_tbl_neu_col) - cell(1, j, matrix.get(matrix, i, 1), i_tbl_neu_col) - cell(2, j, matrix.get(matrix, i, 2), i_tbl_neu_col) - cell(3, j, matrix.get(matrix, i, 3), i_tbl_neu_col) - - j += 1 - -// _____________________________ Screener End -// _____________________________ Code End +// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ +// © Arun_K_Bhaskar + +// Acknowledgement & Reference +// Trader: 'RicardoSantos' +// Indicator Title: '[RS]Market Profile' +// Indicator Link: 'https://www.tradingview.com/script/uoysXxWM-RS-Market-Profile/' + +//@version=5 +indicator(title='Market Profile with Screener (Based on [RS]Market Profile by RicardoSantos)', shorttitle='Market Profile Screener', overlay=true, max_lines_count=300, max_boxes_count=300) + +//_____________________________ Market Profile Start + +// ||-- Inputs: +g_mp='Market Profile' +string i_session_timeframe = input.string(defval='5D', title='Timeframe', group=g_mp) +float i_percent_of_tpo = input.float(defval=0.7, title='TPO %', group=g_mp) +int i_sessions = input.int(defval=1, title='Show Last', minval=0, maxval=40, group=g_mp) +color i_poc_col = input.color(defval=#EA738D, title='Point of Control', group=g_mp) +color i_va_col = input.color(defval=#89ABE3, title='Value Area', group=g_mp) +color i_open_col = input.color(defval=color.silver, title='Open', group=g_mp) +int i_mp_transp = input.int(defval=100, title='Transparency', minval=0, maxval=100, group=g_mp) + +// ||-- Extra Functions: +f_line_stack(_array, _max_elements, _new_element) => + int _size = array.size(_array) + if _size >= _max_elements + line.delete(array.pop(_array)) + array.unshift(_array, _new_element) +f_open_session_line(_x1, _y1, _x2, _y2) => + line.new(_x1, _y1, _x2, _y2, xloc=xloc.bar_time, color=i_open_col, style=line.style_dashed) + +f_box_stack(_array, _max_elements, _new_element) => + int _size = array.size(_array) + if _size >= _max_elements + box.delete(array.pop(_array)) + array.unshift(_array, _new_element) + +f_poc_box(_x1, _y1, _x2, _y2) => + box.new(_x1, _y1, _x2, _y2, border_color=i_poc_col, xloc=xloc.bar_time, bgcolor=color.new(i_poc_col, i_mp_transp)) +f_vah_box(_x1, _y1, _x2, _y2) => + box.new(_x1, _y1, _x2, _y2, border_color=i_va_col, xloc=xloc.bar_time, bgcolor=color.new(i_va_col, i_mp_transp)) + +var line[] open_session_lines = array.new_line(0) +var box[] poc_boxes = array.new_box(0) +var box[] vah_boxes = array.new_box(0) + +float tf_high = high +float tf_low = low +float tf_close = close + +// ||-- Bars since session started: +isnewsession = ta.change(time(i_session_timeframe)) != 0 + +var int session_bar_counter = 0 +var int previous_session_start = na +var int previous_session_end = na +var int session_time_range = na + +if isnewsession + session_bar_counter := 0 + previous_session_start := previous_session_end + previous_session_end := time + session_time_range := previous_session_end - previous_session_start + session_time_range +else + session_bar_counter += 1 + session_bar_counter + +// ||-- session high, low, range: +var float session_high = tf_high +var float session_low = tf_low +var float session_range = tf_high - tf_low + +// ||-- recalculate session high, low and range: +if session_bar_counter == 0 + session_high := tf_high + session_low := tf_low + session_range := tf_high - tf_low + session_range +if tf_high > session_high[1] + session_high := tf_high + session_range := session_high - session_low + session_range +if tf_low < session_low[1] + session_low := tf_low + session_range := session_high - session_low + session_range + +// ||-- define tpo section range: +tpo_section_range = session_range / 20 + +// ||-- function to get the frequency a specified range is visited: +f_frequency_of_range(_src, _upper_range, _lower_range, _length) => + _adjusted_length = _length < 1 ? 1 : _length + _frequency = 0 + for _i = 0 to _adjusted_length - 1 by 1 + if _src[_i] >= _lower_range and _src[_i] < _upper_range + _frequency += 1 + _frequency + _return = nz(_frequency, 0) // _adjusted_length + _return + +// ||-- frequency the tpo range is visited: +tpo_00 = f_frequency_of_range(tf_close, session_high, session_high - tpo_section_range * 1, session_bar_counter) +tpo_01 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 1, session_high - tpo_section_range * 2, session_bar_counter) +tpo_02 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 2, session_high - tpo_section_range * 3, session_bar_counter) +tpo_03 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 3, session_high - tpo_section_range * 4, session_bar_counter) +tpo_04 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 4, session_high - tpo_section_range * 5, session_bar_counter) +tpo_05 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 5, session_high - tpo_section_range * 6, session_bar_counter) +tpo_06 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 6, session_high - tpo_section_range * 7, session_bar_counter) +tpo_07 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 7, session_high - tpo_section_range * 8, session_bar_counter) +tpo_08 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 8, session_high - tpo_section_range * 9, session_bar_counter) +tpo_09 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 9, session_high - tpo_section_range * 10, session_bar_counter) +tpo_10 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 10, session_high - tpo_section_range * 11, session_bar_counter) +tpo_11 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 11, session_high - tpo_section_range * 12, session_bar_counter) +tpo_12 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 12, session_high - tpo_section_range * 13, session_bar_counter) +tpo_13 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 13, session_high - tpo_section_range * 14, session_bar_counter) +tpo_14 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 14, session_high - tpo_section_range * 15, session_bar_counter) +tpo_15 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 15, session_high - tpo_section_range * 16, session_bar_counter) +tpo_16 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 16, session_high - tpo_section_range * 17, session_bar_counter) +tpo_17 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 17, session_high - tpo_section_range * 18, session_bar_counter) +tpo_18 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 18, session_high - tpo_section_range * 19, session_bar_counter) +tpo_19 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 19, session_high - tpo_section_range * 20, session_bar_counter) +tpo_20 = f_frequency_of_range(tf_close, session_high - tpo_section_range * 20, session_high - tpo_section_range * 21, session_bar_counter) + +// ||-- function to retrieve a specific tpo value +f_get_tpo_count(_value) => + _return = switch (_value) + 0 => tpo_00 + 1 => tpo_01 + 2 => tpo_02 + 3 => tpo_03 + 4 => tpo_04 + 5 => tpo_05 + 6 => tpo_06 + 7 => tpo_07 + 8 => tpo_08 + 9 => tpo_09 + 10 => tpo_10 + 11 => tpo_11 + 12 => tpo_12 + 13 => tpo_13 + 14 => tpo_14 + 15 => tpo_15 + 16 => tpo_16 + 17 => tpo_17 + 18 => tpo_18 + 19 => tpo_19 + 20 => tpo_20 + => 0.0 + +tpo_sum = 0.0 +current_poc_position = 0.0 +current_poc_value = 0.0 + +for _i = 0 to 20 by 1 + _get_tpo_value = f_get_tpo_count(_i) + tpo_sum += _get_tpo_value + if _get_tpo_value >= current_poc_value + current_poc_position := _i + current_poc_value := _get_tpo_value + current_poc_value + +poc_upper = session_high - tpo_section_range * current_poc_position +poc_lower = session_high - tpo_section_range * (current_poc_position + 1) + +// ||-- get value area high/low +vah_position = current_poc_position +val_position = current_poc_position +current_sum = current_poc_value + +for _i = 0 to 20 by 1 + if current_sum < tpo_sum * i_percent_of_tpo + vah_position := math.max(0, vah_position - 1) + current_sum += f_get_tpo_count(math.round(vah_position)) + current_sum + if current_sum < tpo_sum * i_percent_of_tpo + val_position := math.min(20, val_position + 1) + current_sum += f_get_tpo_count(math.round(val_position)) + current_sum + +vah_value = session_high - tpo_section_range * vah_position +val_value = session_high - tpo_section_range * (val_position + 1) + +if isnewsession + f_box_stack(vah_boxes, i_sessions, f_vah_box(previous_session_end, vah_value[1], time_close(i_session_timeframe), val_value[1])) + f_box_stack(poc_boxes, i_sessions, f_poc_box(previous_session_end, poc_upper[1], time_close(i_session_timeframe), poc_lower[1])) + f_line_stack(open_session_lines, i_sessions, f_open_session_line(previous_session_end, open, time_close(i_session_timeframe), open)) + +// Function to get the pivot value +vahl_pivot_value(src) => + ta.valuewhen(session_bar_counter == 0, src[1], 0) + +// Get VAH and VAL pivots +vah_pivot = vahl_pivot_value(vah_value) +val_pivot = vahl_pivot_value(val_value) +poc_pivot = vahl_pivot_value(math.avg(poc_upper, poc_lower)) + +// Calculate percentage between VAH and VAL +va_percent = ((vah_pivot - val_pivot) / val_pivot) * 100 +poc_percent = ((close - poc_pivot) / poc_pivot) * 100 +//_____________________________ Market Profile End + + +//_____________________________ Screener Start + +// Note: +// - TradingView allows up to 40 requests per indicator, so keep the number of symbols below 40. +// - Too many requests and complex calculations may slow down the indicator. +// - You can combine multiple indicators in one script, like Close crossing above EMA 20, RSI crossing 60, etc. + +//_____________________________ Menu Screener Table Start + +g_tb = 'Screener : Table' +tt_is = //"• Input exactly 40 symbols, nothing more or less." + + "• Total characters cannot exceed 4096." + + "\n• Use comma as delimiter without any space." + + "\n• Eg: 'EXCHANGE:SYMBOL_A,EXCHANGE:SYMBOL_B'" + +string i_symbols = input.text_area( + defval='NSE:ADANIPOWER,NSE:ARVIND,NSE:ASHOKA,NSE:BANKINDIA,NSE:BLS,NSE:BOMDYEING,NSE:CUB,NSE:DBL,NSE:DELTACORP,NSE:ENGINERSIN,NSE:GIPCL,NSE:GMDCLTD,NSE:GPPL,NSE:HINDCOPPER,NSE:INDIACEM,NSE:INOXWIND,NSE:IPL,NSE:IRCON,NSE:ITI,NSE:JAMNAAUTO,NSE:JKTYRE,NSE:KESORAMIND,NSE:LEMONTREE,NSE:MOIL,NSE:MRPL,NSE:NLCINDIA,NSE:ONMOBILE,NSE:PFC,NSE:PPLPHARMA,NSE:PTC,NSE:RAILTEL,NSE:RCF,NSE:RVNL,NSE:SHRIRAMPPS,NSE:TI,NSE:WELCORP,NSE:L_TFH,NSE:WOCKPHARMA,NSE:ETERNAL', + title="Paste Symbols", tooltip=tt_is, group=g_tb) + +float i_va_above = input.float(defval=0, title='VA % Between', minval=0, maxval=100, inline='1', group=g_tb) +float i_va_below = input.float(defval=3, title='', minval=0, maxval=100, inline='1', group=g_tb) + +float i_ltp_above = input.float(defval=-10, title='LTP % Between', inline='2', group=g_tb) +float i_ltp_below = input.float(defval=10, title='', inline='2', group=g_tb) + + +int i_tbl_disp_rows = input.int(defval=15, title='Display Rows', minval=0, maxval=100, group=g_tb) +string i_tbl_position = input.string(defval=position.bottom_left, title='Position', options=[position.top_left, position.top_center, position.top_right, position.middle_left, position.middle_center, position.middle_right, position.bottom_left, position.bottom_center, position.bottom_right], group=g_tb) +string i_tbl_text_size = input.string(defval=size.small, title='Size', options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge], group=g_tb) + +color i_tbl_neu_col = input.color(defval=#B2B5BE, title='Color', group=g_tb) + +//_____________________________ Menu Screener Table End + +//_____________________________ Menu Index Reference Lists Start + +// Selecting a list below scans ONLY that list's chosen page (max 40 symbols +// per request.security()'s hard call limit) and ignores the Notes input +// above entirely. Only one list can be active at a time — hover the ⓘ icon +// on the dropdown for details. Leave on 'None (use Notes)' to scan Notes. + +g_lists = 'Preset Index Lists' + +tt_list_select = "Selecting a list here scans ONLY that list's chosen Page below, and ignores the Notes symbols above entirely." + "\n• request.security() allows at most 40 calls per script, so each list is pre-split into 40-symbol pages." + "\n• Pick the matching ' — Page' dropdown for whichever list you choose here." + "\n• Set this back to 'None (use Notes)' to scan your own pasted Notes symbols again." + +string i_list_select = input.string(defval='None (use Notes)', title='Preset Index List', options=['None (use Notes)', 'Nifty 50', 'Nifty Next 50', 'Nifty 100', 'Nifty 200', 'Nifty 500', 'Nifty LargeMidcap 250', 'Nifty Midcap 50', 'Nifty Midcap 100', 'Nifty Midcap 150', 'Nifty Smallcap 50', 'Nifty Smallcap 100', 'Nifty Smallcap 250', 'Nifty Microcap 250', 'Nifty Bank', 'Nifty Private Bank', 'Nifty PSU Bank', 'Nifty Auto', 'Nifty Finance', 'Nifty FMCG', 'Nifty Metal', 'Nifty Pharma', 'Nifty Realty'], tooltip=tt_list_select, group=g_lists) + +string i_page_nifty50 = input.string(defval='Page 1 (1-40)', title='Nifty 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftynext50 = input.string(defval='Page 1 (1-40)', title='Nifty Next 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_nifty100 = input.string(defval='Page 1 (1-40)', title='Nifty 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_nifty200 = input.string(defval='Page 1 (1-40)', title='Nifty 200 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)'], group=g_lists) +string i_page_nifty500 = input.string(defval='Page 1 (1-40)', title='Nifty 500 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-280)', 'Page 8 (281-320)', 'Page 9 (321-360)', 'Page 10 (361-400)', 'Page 11 (401-440)', 'Page 12 (441-480)', 'Page 13 (481-500)'], group=g_lists) +string i_page_niftylargemidcap250 = input.string(defval='Page 1 (1-40)', title='Nifty LargeMidcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymidcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftymidcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftymidcap150 = input.string(defval='Page 1 (1-40)', title='Nifty Midcap 150 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-150)'], group=g_lists) +string i_page_niftysmallcap50 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 50 — Page', options=['Page 1 (1-40)', 'Page 2 (41-50)'], group=g_lists) +string i_page_niftysmallcap100 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 100 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-100)'], group=g_lists) +string i_page_niftysmallcap250 = input.string(defval='Page 1 (1-40)', title='Nifty Smallcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-250)'], group=g_lists) +string i_page_niftymicrocap250 = input.string(defval='Page 1 (1-40)', title='Nifty Microcap 250 — Page', options=['Page 1 (1-40)', 'Page 2 (41-80)', 'Page 3 (81-120)', 'Page 4 (121-160)', 'Page 5 (161-200)', 'Page 6 (201-240)', 'Page 7 (241-251)'], group=g_lists) +string i_page_niftybank = input.string(defval='Page 1 (1-14)', title='Nifty Bank — Page', options=['Page 1 (1-14)'], group=g_lists) +string i_page_niftyprivatebank = input.string(defval='Page 1 (1-10)', title='Nifty Private Bank — Page', options=['Page 1 (1-10)'], group=g_lists) +string i_page_niftypsubank = input.string(defval='Page 1 (1-12)', title='Nifty PSU Bank — Page', options=['Page 1 (1-12)'], group=g_lists) +string i_page_niftyauto = input.string(defval='Page 1 (1-15)', title='Nifty Auto — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftyfinance = input.string(defval='Page 1 (1-20)', title='Nifty Finance — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyfmcg = input.string(defval='Page 1 (1-15)', title='Nifty FMCG — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftymetal = input.string(defval='Page 1 (1-15)', title='Nifty Metal — Page', options=['Page 1 (1-15)'], group=g_lists) +string i_page_niftypharma = input.string(defval='Page 1 (1-20)', title='Nifty Pharma — Page', options=['Page 1 (1-20)'], group=g_lists) +string i_page_niftyrealty = input.string(defval='Page 1 (1-10)', title='Nifty Realty — Page', options=['Page 1 (1-10)'], group=g_lists) + +//_____________________________ Menu Index Reference Lists End + +//_____________________________ Preset Index List Pages Start + +page_nifty50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ADANIENT,NSE:ADANIPORTS,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BEL,NSE:BHARTIARTL,NSE:CIPLA,NSE:COALINDIA,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO,NSE:HINDUNILVR,NSE:ICICIBANK,NSE:ITC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LT,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:POWERGRID,NSE:RELIANCE,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + 'Page 2 (41-50)' => "NSE:SUNPHARMA,NSE:TCS,NSE:TATACONSUM,NSE:TMPV,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TRENT,NSE:ULTRACEMCO,NSE:WIPRO" + => '' + +page_niftynext50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIGREEN,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:DMART,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BPCL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:GAIL,NSE:GODREJCP,NSE:HDFCAMC,NSE:HAL,NSE:HINDZINC,NSE:HYUNDAI,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:JINDALSTEL,NSE:LTM,NSE:LODHA,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:PIDILITIND,NSE:PFC,NSE:PNB,NSE:RECLTD,NSE:MOTHERSON,NSE:SHREECEM,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS" + 'Page 2 (41-50)' => "NSE:TVSMOTOR,NSE:TATACAP,NSE:TMCV,NSE:TATAPOWER,NSE:TORNTPHARM,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:ZYDUSLIFE" + => '' + +page_nifty100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ABB,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASIANPAINT,NSE:DMART,NSE:AXISBANK,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:CUMMINSIND,NSE:DLF,NSE:DIVISLAB,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:GAIL,NSE:GODREJCP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HINDALCO" + 'Page 2 (41-80)' => "NSE:HAL,NSE:HINDUNILVR,NSE:HINDZINC,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ITC,NSE:INDHOTEL,NSE:IOC,NSE:IRFC,NSE:INFY,NSE:INDIGO,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LTM,NSE:LT,NSE:LODHA,NSE:M&M,NSE:MARUTI,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MUTHOOTFIN,NSE:NTPC,NSE:NESTLEIND,NSE:ONGC,NSE:PIDILITIND,NSE:PFC,NSE:POWERGRID,NSE:PNB,NSE:RECLTD,NSE:RELIANCE,NSE:SBILIFE,NSE:MOTHERSON,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN" + 'Page 3 (81-100)' => "NSE:SUNPHARMA,NSE:TVSMOTOR,NSE:TATACAP,NSE:TCS,NSE:TATACONSUM,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:WIPRO,NSE:ZYDUSLIFE" + => '' + +page_nifty200(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:ABB,NSE:APLAPOLLO,NSE:AUBANK,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:AMBUJACEM,NSE:APOLLOHOSP,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BANKBARODA,NSE:BANKINDIA,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CANBK" + 'Page 2 (41-80)' => "NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJPROP,NSE:GRASIM,NSE:HCLTECH,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA" + 'Page 3 (81-120)' => "NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:IDFCFIRSTB,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:JSWENERGY,NSE:JSWSTEEL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND" + 'Page 4 (121-160)' => "NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NMDC,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE,NSE:SRF,NSE:MOTHERSON" + 'Page 5 (161-200)' => "NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:TITAN,NSE:TORNTPHARM,NSE:TRENT,NSE:TIINDIA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_nifty500(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:ACMESOLAR,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ABBOTINDIA,NSE:ACE,NSE:ACUTAAS,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:AJANTPHARM,NSE:ALKEM,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:AMBUJACEM,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE" + 'Page 2 (41-80)' => "NSE:ANTHEM,NSE:ANURAS,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTERDM,NSE:ASTRAL,NSE:ATHERENERG,NSE:ATUL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BEML,NSE:BLS,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL" + 'Page 3 (81-120)' => "NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:BIKAJI,NSE:GROWW,NSE:BIOCON,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BLUESTARCO,NSE:BBTC,NSE:BOSCHLTD,NSE:FIRSTCRY,NSE:BRIGADE,NSE:BRITANNIA,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CGPOWER,NSE:CIEINDIA,NSE:CRISIL,NSE:CANFINHOME,NSE:CANBK,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CHOLAFIN,NSE:CIPLA,NSE:CUB" + 'Page 4 (121-160)' => "NSE:CLEAN,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COHANCE,NSE:COLPAL,NSE:CAMS,NSE:CONCORDBIO,NSE:CONCOR,NSE:COROMANDEL,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CUMMINSIND,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DLF,NSE:DOMS,NSE:DABUR,NSE:DALBHARAT,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:DIVISLAB,NSE:DIXON,NSE:LALPATHLAB,NSE:DRREDDY,NSE:EIDPARRY,NSE:EIHOTEL,NSE:EICHERMOT,NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENDURANCE,NSE:ENGINERSIN,NSE:ERIS" + 'Page 5 (161-200)' => "NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:FORTIS,NSE:GAIL,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GICRE,NSE:GILLETTE,NSE:GLAND,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODIGIT,NSE:GPIL,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRANULES,NSE:GRAPHITE,NSE:GRASIM,NSE:GRAVITA,NSE:GESHIP,NSE:FLUOROCHEM,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HCLTECH,NSE:HDBFS" + 'Page 6 (201-240)' => "NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HFCL,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HSCL,NSE:HINDALCO,NSE:HAL,NSE:HINDCOPPER,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HOMEFIRST,NSE:HONASA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDBI,NSE:IDFCFIRSTB,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITCHOTELS,NSE:ITC,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART,NSE:INDIANB,NSE:IEX,NSE:INDHOTEL,NSE:IOC" + 'Page 7 (241-280)' => "NSE:IOB,NSE:IRCTC,NSE:IRFC,NSE:IREDA,NSE:IGL,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INOXWIND,NSE:INTELLECT,NSE:INDIGO,NSE:IGIL,NSE:IKS,NSE:IPCALAB,NSE:JKCEMENT,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KAJARIACER" + 'Page 8 (281-320)' => "NSE:KPIL,NSE:KALYANKJIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KOTAKBANK,NSE:KIMS,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTFOODS,NSE:LTM,NSE:LT,NSE:LATENTVIEW,NSE:LAURUSLABS,NSE:THELEELA,NSE:LEMONTREE,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MMTC,NSE:MRF,NSE:MGL,NSE:M&MFIN,NSE:M&M,NSE:MANAPPURAM,NSE:MRPL,NSE:MANKIND,NSE:MARICO,NSE:MARUTI,NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MEESHO" + 'Page 9 (321-360)' => "NSE:MINDACORP,NSE:MSUMI,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NATCOPHARM,NSE:NBCC,NSE:NCC,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NSLNISP,NSE:NTPCGREEN,NSE:NTPC,NSE:NH,NSE:NATIONALUM,NSE:NAVA,NSE:NAVINFLUOR,NSE:NESTLEIND,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NAM-INDIA,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:OLAELEC,NSE:OLECTRA,NSE:PAYTM,NSE:ONESOURCE,NSE:OFSS,NSE:POLICYBZR,NSE:PCBL,NSE:PGEL,NSE:PIIND,NSE:PNBHOUSING" + 'Page 10 (361-400)' => "NSE:PTCIL,NSE:PVRINOX,NSE:PAGEIND,NSE:PARADEEP,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PFIZER,NSE:PHOENIXLTD,NSE:PWL,NSE:PIDILITIND,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POLYCAB,NSE:POONAWALLA,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PFOCUS,NSE:PNB,NSE:RRKABEL,NSE:RBLBANK,NSE:RECLTD,NSE:RHIM,NSE:RITES,NSE:RADICO,NSE:RVNL,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RELIANCE,NSE:RPOWER,NSE:SBFC,NSE:SBICARD,NSE:SBILIFE,NSE:SJVN" + 'Page 11 (401-440)' => "NSE:SRF,NSE:SAGILITY,NSE:SAILIFE,NSE:SAMMAANCAP,NSE:MOTHERSON,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHAEFFLER,NSE:SCHNEIDER,NSE:SCI,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:SHYAMMETL,NSE:ENRIN,NSE:SIEMENS,NSE:SIGNATURE,NSE:SOBHA,NSE:SOLARINDS,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SBIN,NSE:SAIL,NSE:SUMICHEM,NSE:SUNPHARMA,NSE:SUNTV,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SPLPETRO,NSE:SUZLON,NSE:SWANCORP,NSE:SWIGGY,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACHEM,NSE:TATACOMM" + 'Page 12 (441-480)' => "NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TATATECH,NSE:TTML,NSE:TECHM,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:NIACL,NSE:RAMCOCEM,NSE:THERMAX,NSE:TIMKEN,NSE:TITAGARH,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRENT,NSE:TRIDENT,NSE:TRITURBINE,NSE:TIINDIA,NSE:UCOBANK,NSE:UNOMINDA,NSE:UPL,NSE:UTIAMC,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL,NSE:UNITDSPR,NSE:URBANCO,NSE:USHAMART,NSE:VTL" + 'Page 13 (481-500)' => "NSE:VBL,NSE:VEDL,NSE:VIJAYA,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WIPRO,NSE:WOCKPHARMA,NSE:YESBANK,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSLIFE,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftylargemidcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ABB,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ADANIENSOL,NSE:ADANIENT,NSE:ADANIGREEN,NSE:ADANIPORTS,NSE:ADANIPOWER,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:AMBUJACEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOHOSP,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASIANPAINT,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:DMART,NSE:AXISBANK,NSE:BSE,NSE:BAJAJ-AUTO,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:BAJAJHLDNG,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK" + 'Page 2 (41-80)' => "NSE:BERGEPAINT,NSE:BDL,NSE:BEL,NSE:BHARATFORG,NSE:BHEL,NSE:BPCL,NSE:BHARTIARTL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:BOSCHLTD,NSE:BRITANNIA,NSE:CGPOWER,NSE:CRISIL,NSE:CANBK,NSE:CHOLAFIN,NSE:CIPLA,NSE:COALINDIA,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:CUMMINSIND,NSE:DLF,NSE:DABUR,NSE:DALBHARAT,NSE:DIVISLAB,NSE:DIXON,NSE:DRREDDY,NSE:EICHERMOT,NSE:ENDURANCE,NSE:ESCORTS,NSE:ETERNAL,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GAIL" + 'Page 3 (81-120)' => "NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJCP,NSE:GODREJIND,NSE:GODREJPROP,NSE:GRASIM,NSE:FLUOROCHEM,NSE:HCLTECH,NSE:HDBFS,NSE:HDFCAMC,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDALCO,NSE:HAL,NSE:HINDPETRO,NSE:HINDUNILVR,NSE:HINDZINC,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:HYUNDAI,NSE:ICICIBANK,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:ITC,NSE:INDIANB,NSE:INDHOTEL,NSE:IOC,NSE:IRCTC" + 'Page 4 (121-160)' => "NSE:IRFC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:INFY,NSE:INDIGO,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:JIOFIN,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:KOTAKBANK,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LTM,NSE:LT,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LODHA,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:M&M,NSE:MANKIND,NSE:MARICO,NSE:MARUTI" + 'Page 5 (161-200)' => "NSE:MFSL,NSE:MAXHEALTH,NSE:MAZDOCK,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:MUTHOOTFIN,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NTPC,NSE:NATIONALUM,NSE:NESTLEIND,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:ONGC,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET,NSE:PHOENIXLTD,NSE:PIDILITIND,NSE:POLYCAB,NSE:PFC,NSE:POWERGRID,NSE:PREMIERENE,NSE:PRESTIGE,NSE:PNB,NSE:RECLTD,NSE:RADICO,NSE:RVNL,NSE:RELIANCE,NSE:SBICARD,NSE:SBILIFE" + 'Page 6 (201-240)' => "NSE:SJVN,NSE:SRF,NSE:MOTHERSON,NSE:SCHAEFFLER,NSE:SHREECEM,NSE:SHRIRAMFIN,NSE:ENRIN,NSE:SIEMENS,NSE:SOLARINDS,NSE:SBIN,NSE:SAIL,NSE:SUNPHARMA,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TVSMOTOR,NSE:TATACAP,NSE:TATACOMM,NSE:TCS,NSE:TATACONSUM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TMCV,NSE:TMPV,NSE:TATAPOWER,NSE:TATASTEEL,NSE:TECHM,NSE:NIACL,NSE:THERMAX,NSE:TITAN,NSE:TORNTPHARM,NSE:TORNTPOWER,NSE:TRENT,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:ULTRACEMCO,NSE:UNIONBANK,NSE:UBL" + 'Page 7 (241-250)' => "NSE:UNITDSPR,NSE:VBL,NSE:VEDL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:WIPRO,NSE:YESBANK,NSE:ZYDUSLIFE" + => '' + +page_niftymidcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:APLAPOLLO,NSE:AUBANK,NSE:ALKEM,NSE:ASHOKLEY,NSE:AUROPHARMA,NSE:BSE,NSE:BHARATFORG,NSE:BHEL,NSE:COFORGE,NSE:COLPAL,NSE:DABUR,NSE:DIXON,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GMRAIRPORT,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:ICICIGI,NSE:IDFCFIRSTB,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:OIL,NSE:PAYTM,NSE:POLICYBZR,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 2 (41-50)' => "NSE:PRESTIGE,NSE:SBICARD,NSE:SRF,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TIINDIA,NSE:UPL,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:APLAPOLLO,NSE:AUBANK,NSE:ATGL,NSE:ABCAPITAL,NSE:ALKEM,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:BSE,NSE:BANKINDIA,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DIXON,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GLENMARK,NSE:GODFRYPHLP,NSE:GODREJPROP,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC" + 'Page 2 (41-80)' => "NSE:IDFCFIRSTB,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:JSWENERGY,NSE:JUBLFOOD,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NMDC,NSE:NATIONALUM,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PHOENIXLTD,NSE:POLYCAB" + 'Page 3 (81-100)' => "NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SRF,NSE:SAIL,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:TIINDIA,NSE:UPL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftymidcap150(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:360ONE,NSE:3MINDIA,NSE:ACC,NSE:AIAENG,NSE:APLAPOLLO,NSE:AUBANK,NSE:AWL,NSE:ABBOTINDIA,NSE:ATGL,NSE:ABCAPITAL,NSE:AJANTPHARM,NSE:ALKEM,NSE:ANTHEM,NSE:APARINDS,NSE:APOLLOTYRE,NSE:ASHOKLEY,NSE:ASTRAL,NSE:AUROPHARMA,NSE:AIIL,NSE:BSE,NSE:BAJAJHFL,NSE:BALKRISIND,NSE:BANKINDIA,NSE:MAHABANK,NSE:BERGEPAINT,NSE:BDL,NSE:BHARATFORG,NSE:BHEL,NSE:BHARTIHEXA,NSE:GROWW,NSE:BIOCON,NSE:BLUESTARCO,NSE:CRISIL,NSE:COCHINSHIP,NSE:COFORGE,NSE:COLPAL,NSE:CONCOR,NSE:COROMANDEL,NSE:DABUR,NSE:DALBHARAT" + 'Page 2 (41-80)' => "NSE:DIXON,NSE:ENDURANCE,NSE:ESCORTS,NSE:EXIDEIND,NSE:NYKAA,NSE:FEDERALBNK,NSE:FORTIS,NSE:GVT&D,NSE:GMRAIRPORT,NSE:GICRE,NSE:GLAXO,NSE:GLENMARK,NSE:MEDANTA,NSE:GODFRYPHLP,NSE:GODREJIND,NSE:GODREJPROP,NSE:FLUOROCHEM,NSE:HDBFS,NSE:HAVELLS,NSE:HEROMOTOCO,NSE:HEXT,NSE:HINDPETRO,NSE:POWERINDIA,NSE:HONAUT,NSE:HUDCO,NSE:ICICIGI,NSE:ICICIAMC,NSE:ICICIPRULI,NSE:IDFCFIRSTB,NSE:ITCHOTELS,NSE:INDIANB,NSE:IRCTC,NSE:IREDA,NSE:INDUSTOWER,NSE:INDUSINDBK,NSE:NAUKRI,NSE:IPCALAB,NSE:JKCEMENT,NSE:JSWENERGY,NSE:JSWINFRA" + 'Page 3 (81-120)' => "NSE:JSL,NSE:JUBLFOOD,NSE:KPRMILL,NSE:KEI,NSE:KPITTECH,NSE:KALYANKJIL,NSE:LTF,NSE:LTTS,NSE:LGEINDIA,NSE:LICHSGFIN,NSE:LAURUSLABS,NSE:LENSKART,NSE:LICI,NSE:LINDEINDIA,NSE:LLOYDSME,NSE:LUPIN,NSE:MRF,NSE:M&MFIN,NSE:MANKIND,NSE:MARICO,NSE:MFSL,NSE:MOTILALOFS,NSE:MPHASIS,NSE:MCX,NSE:NHPC,NSE:NLCINDIA,NSE:NMDC,NSE:NTPCGREEN,NSE:NATIONALUM,NSE:NAM-INDIA,NSE:OBEROIRLTY,NSE:OIL,NSE:PAYTM,NSE:OFSS,NSE:POLICYBZR,NSE:PIIND,NSE:PAGEIND,NSE:PATANJALI,NSE:PERSISTENT,NSE:PETRONET" + 'Page 4 (121-150)' => "NSE:PHOENIXLTD,NSE:POLYCAB,NSE:PREMIERENE,NSE:PRESTIGE,NSE:RADICO,NSE:RVNL,NSE:SBICARD,NSE:SJVN,NSE:SRF,NSE:SCHAEFFLER,NSE:SAIL,NSE:SUNDARMFIN,NSE:SUPREMEIND,NSE:SUZLON,NSE:SWIGGY,NSE:TATACOMM,NSE:TATAELXSI,NSE:TATAINVEST,NSE:NIACL,NSE:THERMAX,NSE:TORNTPOWER,NSE:TIINDIA,NSE:UNOMINDA,NSE:UPL,NSE:UBL,NSE:VMM,NSE:IDEA,NSE:VOLTAS,NSE:WAAREEENER,NSE:YESBANK" + => '' + +page_niftysmallcap50(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AEGISLOG,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANGELONE,NSE:ASTERDM,NSE:BANDHANBNK,NSE:CESC,NSE:CASTROLIND,NSE:CDSL,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CROMPTON,NSE:DELHIVERY,NSE:LALPATHLAB,NSE:FIVESTAR,NSE:GLAND,NSE:HSCL,NSE:HINDCOPPER,NSE:IIFL,NSE:IGL,NSE:INOXWIND,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NEULANDLAB,NSE:PGEL,NSE:PNBHOUSING,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA" + 'Page 2 (41-50)' => "NSE:RBLBANK,NSE:REDINGTON,NSE:RPOWER,NSE:SAILIFE,NSE:SONACOMS,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:WELCORP,NSE:WOCKPHARMA" + => '' + +page_niftysmallcap100(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:AARTIIND,NSE:ABREL,NSE:AEGISLOG,NSE:AFCONS,NSE:AFFLE,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:APTUS,NSE:ASTERDM,NSE:ATHERENERG,NSE:BEML,NSE:BLS,NSE:BANDHANBNK,NSE:FIRSTCRY,NSE:BRIGADE,NSE:CESC,NSE:CGCL,NSE:CASTROLIND,NSE:CDSL,NSE:CHAMBLFERT,NSE:CHOLAHLDNG,NSE:CUB,NSE:COHANCE,NSE:CAMS,NSE:CREDITACC,NSE:CROMPTON,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GRSE,NSE:GLAND,NSE:GPIL" + 'Page 2 (41-80)' => "NSE:GESHIP,NSE:GMDCLTD,NSE:HBLENGINE,NSE:HSCL,NSE:HINDCOPPER,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRCON,NSE:ITI,NSE:IGL,NSE:INOXWIND,NSE:IKS,NSE:JBMA,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JYOTICNC,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:NATCOPHARM,NSE:NBCC,NSE:NH,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NUVAMA,NSE:OLAELEC,NSE:PGEL,NSE:PNBHOUSING,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POONAWALLA,NSE:RBLBANK" + 'Page 3 (81-100)' => "NSE:REDINGTON,NSE:RPOWER,NSE:SAGILITY,NSE:SAILIFE,NSE:SARDAEN,NSE:SIGNATURE,NSE:SONACOMS,NSE:STARHEALTH,NSE:SWANCORP,NSE:SYNGENE,NSE:TATACHEM,NSE:TATATECH,NSE:TENNIND,NSE:RAMCOCEM,NSE:TRITURBINE,NSE:URBANCO,NSE:WELCORP,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZENSARTECH" + => '' + +page_niftysmallcap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ACMESOLAR,NSE:AADHARHFC,NSE:AARTIIND,NSE:AAVAS,NSE:ACE,NSE:ACUTAAS,NSE:ABFRL,NSE:ABLBL,NSE:ABREL,NSE:ABSLAMC,NSE:CPPLUS,NSE:AEGISLOG,NSE:AEGISVOPAK,NSE:AFCONS,NSE:AFFLE,NSE:ABDL,NSE:ARE&M,NSE:AMBER,NSE:ANANDRATHI,NSE:ANANTRAJ,NSE:ANGELONE,NSE:ANURAS,NSE:APTUS,NSE:ASAHIINDIA,NSE:ASTERDM,NSE:ATHERENERG,NSE:ATUL,NSE:BEML,NSE:BLS,NSE:BALRAMCHIN,NSE:BANDHANBNK,NSE:BATAINDIA,NSE:BAYERCROP,NSE:BELRISE,NSE:BIKAJI,NSE:BSOFT,NSE:BLUEDART,NSE:BLUEJET,NSE:BBTC,NSE:FIRSTCRY" + 'Page 2 (41-80)' => "NSE:BRIGADE,NSE:MAPMYINDIA,NSE:CCL,NSE:CESC,NSE:CIEINDIA,NSE:CANFINHOME,NSE:CANHLIFE,NSE:CAPLIPOINT,NSE:CGCL,NSE:CARBORUNIV,NSE:CARTRADE,NSE:CASTROLIND,NSE:CEATLTD,NSE:CEMPRO,NSE:CENTRALBK,NSE:CDSL,NSE:CHALET,NSE:CHAMBLFERT,NSE:CHENNPETRO,NSE:CHOICEIN,NSE:CHOLAHLDNG,NSE:CUB,NSE:CLEAN,NSE:COHANCE,NSE:CAMS,NSE:CONCORDBIO,NSE:CRAFTSMAN,NSE:CREDITACC,NSE:CROMPTON,NSE:CYIENT,NSE:DCMSHRIRAM,NSE:DOMS,NSE:DATAPATTNS,NSE:DEEPAKFERT,NSE:DEEPAKNTR,NSE:DELHIVERY,NSE:DEVYANI,NSE:LALPATHLAB,NSE:EIDPARRY,NSE:EIHOTEL" + 'Page 3 (81-120)' => "NSE:ELECON,NSE:ELGIEQUIP,NSE:EMAMILTD,NSE:EMCURE,NSE:EMMVEE,NSE:ENGINERSIN,NSE:ERIS,NSE:FACT,NSE:FINCABLES,NSE:FSL,NSE:FIVESTAR,NSE:FORCEMOT,NSE:GABRIEL,NSE:GALLANTT,NSE:GRSE,NSE:GILLETTE,NSE:GLAND,NSE:GODIGIT,NSE:GPIL,NSE:GRANULES,NSE:GRAPHITE,NSE:GRAVITA,NSE:GESHIP,NSE:GMDCLTD,NSE:HEG,NSE:HBLENGINE,NSE:HFCL,NSE:HSCL,NSE:HINDCOPPER,NSE:HOMEFIRST,NSE:HONASA,NSE:IDBI,NSE:IFCI,NSE:IIFL,NSE:IRB,NSE:IRCON,NSE:ITI,NSE:INDGN,NSE:INDIACEM,NSE:INDIAMART" + 'Page 4 (121-160)' => "NSE:IEX,NSE:IOB,NSE:IGL,NSE:INOXWIND,NSE:INTELLECT,NSE:IGIL,NSE:IKS,NSE:JBMA,NSE:JKTYRE,NSE:JMFINANCIL,NSE:JSWCEMENT,NSE:JSWDULUX,NSE:JAINREC,NSE:JPPOWER,NSE:J&KBANK,NSE:JINDALSAW,NSE:JUBLINGREA,NSE:JUBLPHARMA,NSE:JWL,NSE:JYOTICNC,NSE:KAJARIACER,NSE:KPIL,NSE:KARURVYSYA,NSE:KAYNES,NSE:KEC,NSE:KFINTECH,NSE:KIRLOSENG,NSE:KIMS,NSE:LTFOODS,NSE:LATENTVIEW,NSE:THELEELA,NSE:LEMONTREE,NSE:MMTC,NSE:MGL,NSE:MANAPPURAM,NSE:MRPL,NSE:MEESHO,NSE:MINDACORP,NSE:MSUMI,NSE:NATCOPHARM" + 'Page 5 (161-200)' => "NSE:NBCC,NSE:NCC,NSE:NSLNISP,NSE:NH,NSE:NAVA,NSE:NAVINFLUOR,NSE:NETWEB,NSE:NEULANDLAB,NSE:NEWGEN,NSE:NIVABUPA,NSE:NUVAMA,NSE:NUVOCO,NSE:OLAELEC,NSE:OLECTRA,NSE:ONESOURCE,NSE:PCBL,NSE:PGEL,NSE:PNBHOUSING,NSE:PTCIL,NSE:PVRINOX,NSE:PARADEEP,NSE:PFIZER,NSE:PWL,NSE:PINELABS,NSE:PIRAMALFIN,NSE:PPLPHARMA,NSE:POLYMED,NSE:POONAWALLA,NSE:PFOCUS,NSE:RRKABEL,NSE:RBLBANK,NSE:RHIM,NSE:RITES,NSE:RAILTEL,NSE:RAINBOW,NSE:RKFORGE,NSE:REDINGTON,NSE:RPOWER,NSE:SBFC,NSE:SAGILITY" + 'Page 6 (201-240)' => "NSE:SAILIFE,NSE:SAMMAANCAP,NSE:SAPPHIRE,NSE:SARDAEN,NSE:SAREGAMA,NSE:SCHNEIDER,NSE:SCI,NSE:SHYAMMETL,NSE:SIGNATURE,NSE:SOBHA,NSE:SONACOMS,NSE:SONATSOFTW,NSE:STARHEALTH,NSE:SUMICHEM,NSE:SUNTV,NSE:SPLPETRO,NSE:SWANCORP,NSE:SYNGENE,NSE:SYRMA,NSE:TBOTEK,NSE:TATACHEM,NSE:TATATECH,NSE:TTML,NSE:TECHNOE,NSE:TEGA,NSE:TEJASNET,NSE:TENNIND,NSE:RAMCOCEM,NSE:TIMKEN,NSE:TITAGARH,NSE:TARIL,NSE:TRAVELFOOD,NSE:TRIDENT,NSE:TRITURBINE,NSE:UCOBANK,NSE:UTIAMC,NSE:URBANCO,NSE:USHAMART,NSE:VTL,NSE:VIJAYA" + 'Page 7 (241-250)' => "NSE:WELCORP,NSE:WELSPUNLIV,NSE:WHIRLPOOL,NSE:WOCKPHARMA,NSE:ZFCVINDIA,NSE:ZEEL,NSE:ZENTEC,NSE:ZENSARTECH,NSE:ZYDUSWELL,NSE:ECLERX" + => '' + +page_niftymicrocap250(sel) => + switch sel + 'Page 1 (1-40)' => "NSE:ASKAUTOLTD,NSE:AXISCADES,NSE:AARTIDRUGS,NSE:AARTIPHARM,NSE:AVL,NSE:ADVENZYMES,NSE:AEQUS,NSE:AETHER,NSE:AHLUCONT,NSE:AKUMS,NSE:APLLTD,NSE:ALIVUS,NSE:ALKYLAMINE,NSE:AGL,NSE:ALOKINDS,NSE:APOLLO,NSE:ACI,NSE:ARVINDFASN,NSE:ARVIND,NSE:ASHAPURMIN,NSE:ASHOKA,NSE:ASTRAMICRO,NSE:ATLANTAELE,NSE:AURIONPRO,NSE:AVALON,NSE:AVANTIFEED,NSE:CCAVENUE,NSE:AWFIS,NSE:AZAD,NSE:BAJAJELEC,NSE:BALAMINES,NSE:BALUFORGE,NSE:BANCOINDIA,NSE:BIRLACORPN,NSE:BBOX,NSE:BLACKBUCK,NSE:BLUESTONE,NSE:BORORENEW,NSE:CMSINFO,NSE:CORONA" + 'Page 2 (41-80)' => "NSE:CSBBANK,NSE:CAMPUS,NSE:CRAMC,NSE:CAPILLARY,NSE:CELLO,NSE:CENTURYPLY,NSE:CERA,NSE:CRIZAC,NSE:CUPID,NSE:DCBBANK,NSE:DATAMATICS,NSE:DIACABS,NSE:DBL,NSE:AGARWALEYE,NSE:DYNAMATECH,NSE:EPL,NSE:EDELWEISS,NSE:EMIL,NSE:ELECTCAST,NSE:ELLEN,NSE:EMBDL,NSE:ENTERO,NSE:EIEL,NSE:EQUITASBNK,NSE:ETHOSLTD,NSE:EUREKAFORB,NSE:FEDFINA,NSE:FIEMIND,NSE:FINPIPE,NSE:UTLSOLAR,NSE:GHCL,NSE:GMMPFAUDLR,NSE:GMRP&UI,NSE:GRWRHITECH,NSE:GODREJAGRO,NSE:GOKEX,NSE:GOKULAGRO,NSE:GREAVESCOT,NSE:GRINDWELL,NSE:GAEL" + 'Page 3 (81-120)' => "NSE:GNFC,NSE:GPPL,NSE:GSFC,NSE:HGINFRA,NSE:HAPPSTMNDS,NSE:HCG,NSE:HEMIPROP,NSE:HERITGFOOD,NSE:HCC,NSE:IFBIND,NSE:IIFLCAPS,NSE:INOXINDIA,NSE:INDIAGLYCO,NSE:INDIASHLTR,NSE:IMFA,NSE:INDIGOPNTS,NSE:ICIL,NSE:INOXGREEN,NSE:IONEXCHANG,NSE:JKLAKSHMI,NSE:JKPAPER,NSE:JAIBALAJI,NSE:JAMNAAUTO,NSE:JSFB,NSE:JAYNECOIND,NSE:JSLL,NSE:JLHL,NSE:JUSTDIAL,NSE:JYOTHYLAB,NSE:KNRCON,NSE:KPIGREEN,NSE:KRBL,NSE:KRN,NSE:KSB,NSE:KANSAINER,NSE:KTKBANK,NSE:KSCL,NSE:KIRLOSBROS,NSE:KIRLPNU,NSE:KITEX" + 'Page 4 (121-160)' => "NSE:LXCHEM,NSE:IXIGO,NSE:LLOYDSENGG,NSE:LLOYDSENT,NSE:LUMAXTECH,NSE:MOIL,NSE:MSTCLTD,NSE:MTARTECH,NSE:MAHSCOOTER,NSE:MAHSEAMLES,NSE:MANORAMA,NSE:MARKSANS,NSE:MASTEK,NSE:MEDPLUS,NSE:METROPOLIS,NSE:MIDHANI,NSE:BECTORFOOD,NSE:NEOGEN,NSE:NESCO,NSE:NFL,NSE:NAZARA,NSE:NETWORK18,NSE:OPTIEMUS,NSE:ORIENTCEM,NSE:ORKLAINDIA,NSE:OSWALPUMPS,NSE:PNGJL,NSE:PCJEWELLER,NSE:PNCINFRA,NSE:PTC,NSE:PARAS,NSE:PARKHOSPS,NSE:PGIL,NSE:PICCADIL,NSE:POWERMECH,NSE:PRAJIND,NSE:PRICOLLTD,NSE:PRSMJOHNSN,NSE:PRIVISCL,NSE:PRUDENT" + 'Page 5 (161-200)' => "NSE:PURVA,NSE:QPOWER,NSE:QUESS,NSE:RAIN,NSE:RALLIS,NSE:RCF,NSE:RATEGAIN,NSE:RATNAMANI,NSE:RTNINDIA,NSE:RTNPOWER,NSE:RAYMONDLSL,NSE:REDTAPE,NSE:REFEX,NSE:RELAXO,NSE:RELIGARE,NSE:RBA,NSE:ROUTE,NSE:RUBICON,NSE:SKFINDUS,NSE:SKFINDIA,NSE:SKYGOLD,NSE:SMLMAH,NSE:SHRIPISTON,NSE:SAATVIKGL,NSE:SAFARI,NSE:SAMHI,NSE:SANDUMA,NSE:SANOFICONR,NSE:SANSERA,NSE:SENCO,NSE:STYL,NSE:SHAILY,NSE:SHAKTIPUMP,NSE:SHARDACROP,NSE:SHAREINDIA,NSE:SFL,NSE:SHILPAMED,NSE:RENUKA,NSE:SKIPPER,NSE:SMARTWORKS" + 'Page 6 (201-240)' => "NSE:SOUTHBANK,NSE:LOTUSDEV,NSE:STARCEMENT,NSE:SWSOLAR,NSE:STLTECH,NSE:STAR,NSE:STYRENIX,NSE:SUBROS,NSE:SUDARSCHEM,NSE:SUDEEPPHRM,NSE:SPARC,NSE:SUNTECK,NSE:SUPRIYA,NSE:SURYAROSNI,NSE:TARC,NSE:TDPOWERSYS,NSE:TSFINV,NSE:TVSSCS,NSE:TMB,NSE:TANLA,NSE:TEXRAIL,NSE:THANGAMAYL,NSE:ANUP,NSE:THOMASCOOK,NSE:THYROCARE,NSE:TI,NSE:TIMETECHNO,NSE:TIPSMUSIC,NSE:TRANSRAILL,NSE:TRIVENI,NSE:UJJIVANSFB,NSE:VGUARD,NSE:VMART,NSE:VIPIND,NSE:V2RETAIL,NSE:WABAG,NSE:VAIBHAVGBL,NSE:DBREALTY,NSE:VARROC,NSE:MANYAVAR" + 'Page 7 (241-251)' => "NSE:VIKRAMSOLR,NSE:VIYASH,NSE:VOLTAMP,NSE:WAAREERTL,NSE:WAKEFIT,NSE:WEWORK,NSE:WEBELSOLAR,NSE:WELENT,NSE:WESTLIFE,NSE:YATHARTH,NSE:ZAGGLE" + => '' + +page_niftybank(sel) => + switch sel + 'Page 1 (1-14)' => "NSE:AUBANK,NSE:AXISBANK,NSE:BANKBARODA,NSE:CANBK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:PNB,NSE:SBIN,NSE:UNIONBANK,NSE:YESBANK" + => '' + +page_niftyprivatebank(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:AXISBANK,NSE:BANDHANBNK,NSE:FEDERALBNK,NSE:HDFCBANK,NSE:ICICIBANK,NSE:IDFCFIRSTB,NSE:INDUSINDBK,NSE:KOTAKBANK,NSE:RBLBANK,NSE:YESBANK" + => '' + +page_niftypsubank(sel) => + switch sel + 'Page 1 (1-12)' => "NSE:BANKBARODA,NSE:BANKINDIA,NSE:MAHABANK,NSE:CANBK,NSE:CENTRALBK,NSE:INDIANB,NSE:IOB,NSE:PSB,NSE:PNB,NSE:SBIN,NSE:UCOBANK,NSE:UNIONBANK" + => '' + +page_niftyauto(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:ASHOKLEY,NSE:BAJAJ-AUTO,NSE:BHARATFORG,NSE:BOSCHLTD,NSE:EICHERMOT,NSE:EXIDEIND,NSE:HEROMOTOCO,NSE:M&M,NSE:MARUTI,NSE:MOTHERSON,NSE:SONACOMS,NSE:TVSMOTOR,NSE:TMPV,NSE:TIINDIA,NSE:UNOMINDA" + => '' + +page_niftyfinance(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:AXISBANK,NSE:BSE,NSE:BAJFINANCE,NSE:BAJAJFINSV,NSE:CHOLAFIN,NSE:HDFCBANK,NSE:HDFCLIFE,NSE:ICICIBANK,NSE:ICICIGI,NSE:JIOFIN,NSE:KOTAKBANK,NSE:LICHSGFIN,NSE:MFSL,NSE:MUTHOOTFIN,NSE:PFC,NSE:RECLTD,NSE:SBICARD,NSE:SBILIFE,NSE:SHRIRAMFIN,NSE:SBIN" + => '' + +page_niftyfmcg(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:BRITANNIA,NSE:COLPAL,NSE:DABUR,NSE:EMAMILTD,NSE:GODREJCP,NSE:HINDUNILVR,NSE:ITC,NSE:MARICO,NSE:NESTLEIND,NSE:PATANJALI,NSE:RADICO,NSE:TATACONSUM,NSE:UBL,NSE:UNITDSPR,NSE:VBL" + => '' + +page_niftymetal(sel) => + switch sel + 'Page 1 (1-15)' => "NSE:APLAPOLLO,NSE:ADANIENT,NSE:HINDALCO,NSE:HINDCOPPER,NSE:HINDZINC,NSE:JSWSTEEL,NSE:JSL,NSE:JINDALSTEL,NSE:LLOYDSME,NSE:NMDC,NSE:NATIONALUM,NSE:SAIL,NSE:TATASTEEL,NSE:VEDL,NSE:WELCORP" + => '' + +page_niftypharma(sel) => + switch sel + 'Page 1 (1-20)' => "NSE:ABBOTINDIA,NSE:AJANTPHARM,NSE:ALKEM,NSE:AUROPHARMA,NSE:BIOCON,NSE:CIPLA,NSE:DIVISLAB,NSE:DRREDDY,NSE:GLAND,NSE:GLENMARK,NSE:IPCALAB,NSE:LAURUSLABS,NSE:LUPIN,NSE:MANKIND,NSE:PPLPHARMA,NSE:SAILIFE,NSE:SUNPHARMA,NSE:TORNTPHARM,NSE:WOCKPHARMA,NSE:ZYDUSLIFE" + => '' + +page_niftyrealty(sel) => + switch sel + 'Page 1 (1-10)' => "NSE:ABREL,NSE:ANANTRAJ,NSE:BRIGADE,NSE:DLF,NSE:GODREJPROP,NSE:LODHA,NSE:OBEROIRLTY,NSE:PHOENIXLTD,NSE:PRESTIGE,NSE:SOBHA" + => '' + +effective_symbols = switch i_list_select + 'Nifty 50' => page_nifty50(i_page_nifty50) + 'Nifty Next 50' => page_niftynext50(i_page_niftynext50) + 'Nifty 100' => page_nifty100(i_page_nifty100) + 'Nifty 200' => page_nifty200(i_page_nifty200) + 'Nifty 500' => page_nifty500(i_page_nifty500) + 'Nifty LargeMidcap 250' => page_niftylargemidcap250(i_page_niftylargemidcap250) + 'Nifty Midcap 50' => page_niftymidcap50(i_page_niftymidcap50) + 'Nifty Midcap 100' => page_niftymidcap100(i_page_niftymidcap100) + 'Nifty Midcap 150' => page_niftymidcap150(i_page_niftymidcap150) + 'Nifty Smallcap 50' => page_niftysmallcap50(i_page_niftysmallcap50) + 'Nifty Smallcap 100' => page_niftysmallcap100(i_page_niftysmallcap100) + 'Nifty Smallcap 250' => page_niftysmallcap250(i_page_niftysmallcap250) + 'Nifty Microcap 250' => page_niftymicrocap250(i_page_niftymicrocap250) + 'Nifty Bank' => page_niftybank(i_page_niftybank) + 'Nifty Private Bank' => page_niftyprivatebank(i_page_niftyprivatebank) + 'Nifty PSU Bank' => page_niftypsubank(i_page_niftypsubank) + 'Nifty Auto' => page_niftyauto(i_page_niftyauto) + 'Nifty Finance' => page_niftyfinance(i_page_niftyfinance) + 'Nifty FMCG' => page_niftyfmcg(i_page_niftyfmcg) + 'Nifty Metal' => page_niftymetal(i_page_niftymetal) + 'Nifty Pharma' => page_niftypharma(i_page_niftypharma) + 'Nifty Realty' => page_niftyrealty(i_page_niftyrealty) + => i_symbols + +//_____________________________ Preset Index List Pages End + +//_______________________ Get Symbols Start + +// Acknowledgement & Reference +// Trader: 'allanster' +// Indicator Title: 'How To Input CSV List Of Symbol Data Used For Screener' +// Indicator Link: 'https://www.tradingview.com/script/KfqHqHUH-How-To-Input-CSV-List-Of-Symbol-Data-Used-For-Screener/' + +feed(back) => // extract tickerid and decrement list of ticker IDs + loop = back // declare string variable to hold content list + getT = string(na) // declare string variable to hold tickerid + if str.length(loop) == 0 // if list is empty + getT := string(na) // assign na to tickerid variable + loop := string(na) // assign na to list of ticker Ids variable + else // else extract first tickerid + getP = nz(str.pos(loop, ','), str.length(loop)) // get position of first comma or last character + getT := str.substring(loop, 0, getP) // get tickerid in first position of list + loop := str.replace(loop, getT + ',', '') // clear tickerid + delimiter character from list + [getT, loop] // return tickerid in first position & truncated list + +[tid_001, out_001] = feed(effective_symbols), [tid_002, out_002] = feed(out_001), [tid_003, out_003] = feed(out_002), [tid_004, out_004] = feed(out_003), +[tid_005, out_005] = feed(out_004), [tid_006, out_006] = feed(out_005), [tid_007, out_007] = feed(out_006), [tid_008, out_008] = feed(out_007), +[tid_009, out_009] = feed(out_008), [tid_010, out_010] = feed(out_009), [tid_011, out_011] = feed(out_010), [tid_012, out_012] = feed(out_011), +[tid_013, out_013] = feed(out_012), [tid_014, out_014] = feed(out_013), [tid_015, out_015] = feed(out_014), [tid_016, out_016] = feed(out_015), +[tid_017, out_017] = feed(out_016), [tid_018, out_018] = feed(out_017), [tid_019, out_019] = feed(out_018), [tid_020, out_020] = feed(out_019), +[tid_021, out_021] = feed(out_020), [tid_022, out_022] = feed(out_021), [tid_023, out_023] = feed(out_022), [tid_024, out_024] = feed(out_023), +[tid_025, out_025] = feed(out_024), [tid_026, out_026] = feed(out_025), [tid_027, out_027] = feed(out_026), [tid_028, out_028] = feed(out_027), +[tid_029, out_029] = feed(out_028), [tid_030, out_030] = feed(out_029), [tid_031, out_031] = feed(out_030), [tid_032, out_032] = feed(out_031), +[tid_033, out_033] = feed(out_032), [tid_034, out_034] = feed(out_033), [tid_035, out_035] = feed(out_034), [tid_036, out_036] = feed(out_035), +[tid_037, out_037] = feed(out_036), [tid_038, out_038] = feed(out_037), [tid_039, out_039] = feed(out_038), [tid_040, out_040] = feed(out_039) + +//_______________________ Get Symbols End + +// _____________________________ Screener Start + +// Acknowledgement & Reference +// Trader: 'MUQWISHI' +// Indicator Title: 'Candlestick Patterns Screener [By MUQWISHI]' +// Indicator Link: 'https://www.tradingview.com/script/xiWQuGOq-Candlestick-Patterns-Screener-By-MUQWISHI/' + +// Function for Screener Indicator Calculation + +screener_condition = va_percent > i_va_above and va_percent <= i_va_below and poc_percent <= i_ltp_below and poc_percent >= i_ltp_above + +truncate(number, decimals) => + factor = math.pow(10, decimals) + int(number * factor) / factor + +indicator_calculation() => + // Initialize variables + percent = float(na) + _time = int(na) + pchg = float(na) + + if screener_condition + percent := truncate(va_percent, 2) + _time := time + pchg := truncate(poc_percent, 2) + + [_time, percent, pchg] + +// Function to format time +format_time(x) => + timezone = syminfo.timezone + timeframe.isintraday ? str.format_time(x, "HH:mm dd-MM-yyyy", timezone) : str.format_time(x, "dd-MM-yyyy", timezone) + +// Function to extract symbol name +symbol(s) => + array.get(str.split(s, ":"), 1) + +// Matrix setup +var matrix = matrix.new(0, 4, na) + +// Function to add rows to the matrix +mtxFun(symbol, _time, percent, pchg) => + matrix.add_row(matrix, 0, array.from(symbol, _time, percent, pchg)) + +// Screener function to collect data +screener(s) => + [_time, percent, pchg] = request.security(s, timeframe.period, indicator_calculation()) + + // Check if the signal is not na and the time matches + if _time == time + mtxFun(symbol(s), format_time(_time), str.tostring(percent), str.tostring(pchg)) + +// Call Screener function for multiple symbols +screener(tid_001), screener(tid_002), screener(tid_003), screener(tid_004), screener(tid_005), screener(tid_006), screener(tid_007), +screener(tid_008), screener(tid_009), screener(tid_010), screener(tid_011), screener(tid_012), screener(tid_013), screener(tid_014), +screener(tid_015), screener(tid_016), screener(tid_017), screener(tid_018), screener(tid_019), screener(tid_020), screener(tid_021), +screener(tid_022), screener(tid_023), screener(tid_024), screener(tid_025), screener(tid_026), screener(tid_027), screener(tid_028), +screener(tid_029), screener(tid_030), screener(tid_031), screener(tid_032), screener(tid_033), screener(tid_034), screener(tid_035), +screener(tid_036), screener(tid_037), screener(tid_038), screener(tid_039), screener(tid_040) + +// Trim excess rows in the matrix +if matrix.rows(matrix) > i_tbl_disp_rows + while matrix.rows(matrix) > i_tbl_disp_rows + matrix.remove_row(matrix, matrix.rows(matrix)-1) + +// Plot Table +// Create table with specified properties +var table tbl = table.new(position=i_tbl_position, columns=4, rows=102, border_width=1) + +tt_tbl = "Time: Signal generation time.\n" + + "% VAHL: Percentage between VAH & VAL.\n" + + "% LTP: Percentage change from POC mid to LTP." + +// Function to populate cells in the table +cell(col, row, txt, color) => + table.cell(tbl, col, row, text = txt, text_color = color, text_halign=text.align_left, bgcolor = color.new(color, 80), text_size=i_tbl_text_size, tooltip=tt_tbl) + +// Check if it's the last bar +if barstate.islast + // Clear existing data in the table + table.clear(tbl, 0, 0, 3, 101) + + // Set headers for the table + cell(0, 0, "Symbol", i_tbl_neu_col) + cell(1, 0, "Time", i_tbl_neu_col) + cell(2, 0, "% VAHL" , i_tbl_neu_col) + cell(3, 0, "% LTP" , i_tbl_neu_col) + + j = 1 + // Populate table with matrix data + if matrix.rows(matrix) > 0 + for i = 0 to matrix.rows(matrix) - 1 + // Populate cells in the table + cell(0, j, matrix.get(matrix, i, 0), i_tbl_neu_col) + cell(1, j, matrix.get(matrix, i, 1), i_tbl_neu_col) + cell(2, j, matrix.get(matrix, i, 2), i_tbl_neu_col) + cell(3, j, matrix.get(matrix, i, 3), i_tbl_neu_col) + + j += 1 + +// _____________________________ Screener End +// _____________________________ Code End