ETFFinderLib
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//Made for:                                                                                                                                                               
//                                        ((                                      
//                                      (((((                                     
//                                    (((((((((                                   
//                                  (((((((((((((                                 
//                                 ((((((((((((((((                               
//                               ((((((((((((((((((((                             
//                             (((((     (((((((((((((                            
//                            ((((        ((((((((((((((                          
//                               #########   ((   (((                             
//                           ################       ####                          
//                          ##################    #######                         
//                        #################################                       
//                      #####################################                                          
//                      _____ _                     _     _   
//                      |  _  |_|___ ___ ___ ___ ___|_|___| |_ 
//                      |   __| |   | -_|_ -|  _|  _| | . |  _|
//                      |__|  |_|_|_|___|___|___|_| |_|  _|_|  
//                                                    |_|   


// LAST UPDATE: November 2023 
// NEXT SCHEDULED UPDATE: May 2024 


// Compendium to the ETFHoldingsLibrary.
// This Library permits you to search the ETFHoldingsLibrary by specific tickers and by sectors. 
// The two main functions provided by this library  are to search for a ticker within various ETFs (using the etf_search_ticker) and the 
// ability to search a breakdown of sectors that each etf in the database contains using the etf_search_sectors function. 
// You can use this library standalone if you want to search for an ETF of interest in the ETFHoldingsLibrary by ticker. 
// You will need to export the etf_search_sectors function if you want to search the ETFs by sectors. 

// © Steversteves

//@version=5

// @description TODO: add library description here
library("ETFFinderLib")

// @function searches the entire ETF library by ticker and identifies which ETFs hold a specific tickers. 
// @param input string as displayed by the syminfo.ticker function in pinescript. 
// @returns returns 2 arrays, holding_array (string array) and compo_array(float array) 
export etf_search_ticker(string ticker) => 
	string[] holding_array = array.new<string>() 
	float[] compo_array = array.new<float>() 
	int inter = 0 
	spy_holdings = array.from("MSFT", "AAPL", "AMZN", "NVDA", "GOOG", "META", "GOOGL", "BRK.B", "TSLA", "UHN"), spy_comp = array.from(7.14, 7.14, 3.44, 2.86, 2.09, 1.90, 1.80, 1.77, 1.58, 1.41)
	qqq_holdings = array.from("AAPL", "MSFT", "AMZN", "NVDA", "META", "AVGO", "GOOGL", "GOOG", "TSLA","COST"), qqq_comp = array.from(11.01, 10.36, 5.66, 4.15, 3.87, 3.07, 3.04, 3.00, 2.63, 2.17)
	arkk_holdings = array.from("COIN", "TSLA", "ZM", "ROKU", "PATH", "SQ", "RBLX", "DKNG", "TWLO", "U"), arkk_comp = array.from(9.07, 8.68, 7.96, 7.80, 7.06, 5.02, 4.48, 4.22, 4.07, 3.46)
	xle_holdings = array.from("XOM", "CVX", "EOG", "COP", "MPC", "SLB", "PXD", "PSX", "VLO", "WMB"), xle_comp = array.from(22.40, 17.07, 4.85, 4.63, 4.54, 4.43, 4.18, 3.81, 3.37, 3.14)
	brk_holdings = array.from("HPQ","ATVI", "MCO", "KHC", "OXY", "CVX", "KO", "AXP", "BAC", "AAPL" ), brk_comp = array.from(1.1, 1.3, 2.3, 3.9, 4.1, 6.7, 7.6, 7.7, 9.1, 46.4)
	ita_holdings = array.from("RTX", "BA", "LMT", "NOC", "GD", "LHX", "TXT", "AXON", "TDG", "HWM"), ita_comp = array.from(18.59, 16.63, 8.38, 5.15, 5.12, 4.88, 4.63, 4.43, 4.34, 4.22)
	iwm_holdings = array.from("SMCI", "MTDR", "CHRD", "MUR", "XTSLA", "LNW", "WFRD", "FIX", "SIGI", "CHX"), iwm_comp = array.from(0.53, 0.33, 0.33, 0.32, 0.32, 0.32, 0.32, 0.31, 0.30, 0.29)
	xlf_holdings = array.from("BRK.B", "JPM", "V", "MA", "BAC", "WFC", "SPGI", "GS", "MMC", "PGR"), xlf_comp = array.from(13.85, 8.99, 8.41, 6.97, 4.05, 3.24, 2.53, 2.23, 2.09, 2.06)
	xlv_holdings = array.from("UNH", "LLY", "JNJ", "MRK", "ABBV", "PFE", "TMO", "ABT", "AMGN", "DHR"), xlv_comp = array.from(10.73, 9.56, 7.73, 5.64, 5.39, 3.73, 3.71, 3.55, 2.96, 2.73)
	vnq_holdings = array.from("VRTPX", "PLD", "AMT", "EQIX", "PSA", "CCI", "WELL", "SPG", "O", "DLR"), vnq_comp = array.from(12.67, 7.50, 5.55, 4.92, 3.02, 2.89, 2.84, 2.48, 2.43, 2.42)
	xbi_holdings = array.from("MRTX", "APLS", "BPMC", "IMVT", "IONS", "VRTX", "SGEN", "GILD", "BHVN", "NBIX"), xbi_comp = array.from(2.26, 1.70, 1.60, 1.60, 1.56, 1.53, 1.51, 1.50, 1.47, 1.47)
	blcr_holdings = array.from("MSFT", "AMZN", "AAPL", "GOOGL", "BRK.B", "META", "CMCSA", "UNH", "AMAT", "NVO"), blcr_comp = array.from(8.28, 5.43, 3.97, 2.89, 2.86, 2.85, 2.54, 2.32, 2.29, 2.20)
	vgt_holdings = array.from("AAPL", "MSFT", "NVDA", "AVGO", "ADBE", "CSCO", "CRM", "ACN", "ORCL", "AMD"), vgt_comp = array.from(21.23, 17.04, 6.16, 3.18, 2.16, 2.03, 1.87, 1.79, 1.59, 1.53)
	vwo_holdings = array.from("2330.TW", "0700.HK", "9988.HK", "RELIANCE.NS", "3690.HK", "HDFCBANK.NS", "INFY.NS", "PDD", "00939", "VALE3.SA"), vwo_comp = array.from(4.77, 3.36, 2.56, 1.31, 1.07, 0.97, 0.84, 0.82, 0.73, 0.71)
	vig_holdings = array.from("MSFT", "AAPL", "XOM", "UNH", "JPM", "JNJ", "V", "PG", "AVGO", "MA"), vig_comp = array.from(4.85, 4.32, 3.39, 3.36, 3.03, 2.70, 2.55, 2.49, 2.39, 2.38)
	vug_holdings = array.from("AAPL", "MSFT", "AMZN", "NVDA", "GOOGL", "TSLA", "META", "GOOG", "LLY", "V"), vug_comp = array.from(12.78, 11.79, 5.93, 5.13, 3.90, 3.39, 3.35, 3.27, 2.31, 1.80)
	vtv_holdings = array.from("BRK.B", "XOM", "UNH", "JPM", "JNJ", "PG", "AVGO", "CVX", "ABBV", "MRK"), vtv_comp = array.from(3.81, 2.80, 2.78, 2.51, 2.23, 2.05, 2.04, 1.78, 1.57, 1.56) 
	vea_holdings = array.from("Nestle SA", "Novo Nordisk Class B", "Samsung Electronics Co Ltd", "ASML Holding NV", "Toyota Motor Corp", "Shell PLC", "Novartis AG Registered Shares", "AstraZeneca PLC", "Roche Holding AG", "LVMH Moet Hennessy Louis Vuitton SE"), vea_comp = array.from(1.49, 1.41, 1.18, 1.15, 1.06, 1.05, 1.04, 0.98, 0.93, 0.92) 
	dia_holdings = array.from("UHN", "MSFT", "GS", "HD", "MCD", "AMGN", "V", "CAT", "CRM", "BA"), dia_comp = array.from(10.67, 6.74, 6.05, 5.67, 5.22, 5.09, 4.68, 4.50, 4.00, 3.72) 
	fngg_holdings = array.from("MSFT", "NFLX", "META", "AVGO", "AAPL", "AMZN", "GOOGL", "NVDA", "SNOW"), fngg_comp = array.from(5.76, 5.71, 5.65, 5.64, 5.61, 5.26, 5.19, 5.13, 5.02) 
	fngu_holdings = array.from("META", "TSLA", "NVDA", "AMD", "NFLX", "AAPL", "AMZN", "SNOW", "MSFT", "GOOGL"), fngu_comp = array.from(12.53, 11.71, 10.66, 10.03, 9.65, 9.39, 9.35, 9.10, 8.84, 8.74)
	bnge_holdings = array.from("NFLX", "NTES", "INTC", "NTDOY", "SONY", "DIS", "PDYPF", "YY", "EA", "TME"), bnge_comp = array.from(5.38, 4.71, 4.68, 4.60, 4.58, 4.57, 4.48, 4.45, 4.45, 4.29) 
	ixp_holdings = array.from("META", "GOOGL", "GOOG", "DIS", "VZ", "NFLX", "CMCSA", "TME", "T", "DTEA"), ixp_comp = array.from(19.12, 11.85, 10.18, 4.64, 4.59, 4.40, 4.38, 4.30, 3.42, 2.35) 
	fcom_holdings = array.from("META", "GOOGL", "GOOG", "VZ", "NFLX", "DIS", "CMCSA", "T", "TMUS", "CHTR"), fcom_comp = array.from(21.46, 12.64, 10.45, 4.91, 4.77, 4.46, 4.19, 3.80, 3.17, 1.74) 
	pnqi_holdings = array.from("MSFT", "META", "AMZN", "ADBE", "GOOG", "DIS", "NFLX", "UBER", "CRM", "BKNG"), pnqi_comp = array.from(8.93, 8.81, 8.34, 8.23, 7.89, 4.22, 4.11, 3.96, 3.92, 3.89)
	chps_holdings = array.from("INTC", "AVGO", "NVDA", "QCOM", "AMAT", "LRCX", "SMH", "AMD", "MU", "ASML"), chps_comp = array.from(5.69, 4.96, 4.88, 4.72, 4.71, 4.67, 4.42, 4.38, 4.33, 4.22)
	soxx_holdings = array.from("AMD", "AVGO", "NVDA", "INTC", "TXN", "MU", "QCOM", "KLAC", "MCHP", "AMAT"), soxx_comp = array.from(8.55, 8.37, 7.59, 7.42, 6.04, 4.39, 4.37, 4.30, 4.00, 3.98)
	xlk_holdings = array.from("MSFT", "AAPL", "AVGO", "NVDA", "ADBE", "CSCO", "CRM", "ACN", "ORCL", "AMD"), xlk_comp = array.from(24.43, 23.15, 4.35, 4.23, 3.04, 2.66, 2.45, 2.35, 2.04, 1.99) 
	jets_holdings = array.from("AAL", "DAL", "LUV", "UAL", "SKYW", "SNCY", "ALK", "ALGT", "AC", "GD"), jets_comp = array.from(9.87, 9.47, 9.15, 9.14, 3.66, 3.32, 2.97, 2.89, 2.78, 2.74)
	moon_holdings = array.from("NKLA", "COIN", "EH", "S", "DBX", "NNDM", "SNAP", "HOOD", "SQSP", "BIGC"), moon_comp = array.from(5.25, 4.18, 3.74, 3.30, 3.25, 3.21, 2.84, 2.81, 2.75, 2.75)
	ufo_holdings = array.from("SIRI", "GRMN", "GSAT", "SKPJY", "TRMB", "SES", "DISH", "SATS", "IRDM", "VSAT"), ufo_comp = array.from(5.67, 5.56, 5.31, 5.28, 5.05, 4.69, 4.54, 4.41, 4.33, 4.22) 
	vdc_holdings = array.from("PG", "COST", "WMT", "PEP", "KO", "PM", "MDLZ", "MO", "CL", "STZ"), vdc_comp = array.from(12.42, 8.73, 8.23, 8.14, 8.04, 4.57, 3.78, 3.02, 2.27, 1.72) 
	iedi_holdings = array.from("AMZN", "HD", "COST", "WMT", "TJX", "LOW", "CMG", "ORLY", "ROST", "TGT"), iedi_comp = array.from(14.43, 10.12, 8.01, 6.30, 3.89, 3.81, 2.87, 2.71, 2.14, 1.98) 
	virs_holdings = array.from("AMZN", "WMT", "NVDA", "NFLX", "HD", "ABT", "MRK", "JNJ", "LOW", "SNY"), virs_comp = array.from(5.62, 5.56, 5.49, 5.11, 4.99, 4.85, 4.84, 4.83, 4.64, 4.61)
	ftxg_holdings = array.from("KHC", "KO", "MDLZ", "PEP", "ADM", "GIS", "USFD", "TAP", "KDP", "STZ"), ftxg_comp = array.from(8.32, 8.26, 8.13, 8.03, 7.90, 4.22, 4.21, 3.98, 3.94, 3.93)
	iyj_holdings = array.from("V", "MA", "ACN", "UNP", "HON", "RTX", "GE", "CAT", "BA", "LMT"), iyj_comp = array.from(7.86, 6.52, 3.88, 2.61, 2.52, 2.46, 2.43, 2.41, 2.15, 2.12) 
	fxr_holdings = array.from("BWXT", "EME", "KNX", "AGCO", "GPK", "SON", "MDU", "GTES", "TT", "SYF"), fxr_comp = array.from(1.35, 1.34, 1.33, 1.32, 1.31, 1.30, 1.29, 1.28, 1.28, 1.25) 
	iyc_holdings = array.from("AMZN", "TSLA", "COST", "WMT", "HD", "MCD", "NFLX", "DIS", "NKE", "LOW"), iyc_comp = array.from(14.92, 7.60, 4.49, 4.43, 4.31, 4.00, 3.86, 3.28, 2.69, 2.46) 
	xly_holdings = array.from("AMZN", "TSLA", "MCD", "NKE", "HD", "LOW", "SBUX", "TJX", "BKNG", "ORLY"), xly_comp = array.from(24.23, 16.79, 4.62, 4.32, 4.26, 3.83, 3.63, 3.47, 3.42, 1.93)
	iyk_holdings = array.from("PG", "PEP", "KO", "PM", "MDLZ", "CVS", "MO", "MCK", "CL", "KMB"), iyk_comp = array.from(16.93, 10.85, 10.62, 6.75, 4.46, 4.40, 3.59, 3.14, 3.13, 2.05)
	fdis_holdings = array.from("AMZN", "TSLA", "HD", "MCD", "NKE", "LOW", "SBUX", "BKNG", "TJX", "ORLY"), fdis_comp = array.from(24.10, 12.93, 6.51, 4.37, 2.89, 2.58, 2.47, 2.42, 2.35, 1.32)
	pej_holdings = array.from("CMG", "ABNB", "MAR", "BKNG", "LVS", "RCL", "WBD", "DAL", "LGF.A", "SKYW"), pej_comp = array.from(5.80, 5.21, 5.18, 5.07, 4.97, 4.78, 4.44, 4.21, 3.38, 3.20)
	iyt_holdings =  array.from("UNP", "UPS", "UBER", "CSX", "NSC", "FDX", "ODFL", "DAL", "EXPD", "JBHT"), iyt_comp = array.from(18.64, 15.05, 12.72, 4.81, 4.80, 4.72, 4.43, 3.74, 3.19, 2.77) 
	ftxr_holdings = array.from("UNP", "GM", "UPS", "F", "TSLA", "CSX", "PCAR", "NSC", "FDX", "URI"), ftxr_comp = array.from(7.95, 7.70, 7.63, 7.36, 7.12, 4.52, 4.33, 4.26, 4.21, 3.90)
	xtn_holdings = array.from("ARCB", "XPO", "MATX", "R", "CSX", "RXO", "SKYW", "UNP", "NSC", "EXPD"), xtn_comp = array.from(3.05, 2.89, 2.79, 2.72, 2.71, 2.71, 2.70, 2.67, 2.65, 2.59)
	sea_holdings = array.from("TNK", "TRMD", "CICOF", "OROVY", "HAFNF", "AMKBY", "NPNYY", "MSLOY", "SITIF", "EVGOF"), sea_comp = array.from(5.21, 5.00, 4.95, 4.81, 4.75, 4.68, 4.45, 4.44, 4.24, 3.92) 
	if array.includes(spy_holdings, ticker) 
		array.push(holding_array, "SPY") 
		inter := array.indexof(spy_holdings, ticker) 
		array.push(compo_array, array.get(spy_comp, inter))
	if array.includes(qqq_holdings, ticker) 
		array.push(holding_array, "QQQ") 
		inter := array.indexof(qqq_holdings, ticker) 
		array.push(compo_array, array.get(qqq_comp, inter))
	if array.includes(arkk_holdings, ticker) 
		array.push(holding_array, "ARKK") 
		inter := array.indexof(arkk_holdings, ticker) 
		array.push(compo_array, array.get(arkk_comp, inter))
	if array.includes(xle_holdings, ticker) 
		array.push(holding_array, "XLE") 
		inter := array.indexof(xle_holdings, ticker) 
		array.push(compo_array, array.get(xle_comp, inter))
	if array.includes(brk_holdings, ticker) 
		array.push(holding_array, "BRK.B") 
		inter := array.indexof(brk_holdings, ticker) 
		array.push(compo_array, array.get(brk_comp, inter))
	if array.includes(ita_holdings, ticker) 
		array.push(holding_array, "ITA") 
		inter := array.indexof(ita_holdings, ticker) 
		array.push(compo_array, array.get(ita_comp, inter))
	if array.includes(iwm_holdings, ticker) 
		array.push(holding_array, "IWM") 
		inter := array.indexof(iwm_holdings, ticker) 
		array.push(compo_array, array.get(iwm_comp, inter))
	if array.includes(xlf_holdings, ticker) 
		array.push(holding_array, "XLF") 
		inter := array.indexof(xlf_holdings, ticker) 
		array.push(compo_array, array.get(xlf_comp, inter))
	if array.includes(xlv_holdings, ticker) 
		array.push(holding_array, "XLV") 
		inter := array.indexof(xlv_holdings, ticker) 
		array.push(compo_array, array.get(xlv_comp, inter))
	if array.includes(vnq_holdings, ticker) 
		array.push(holding_array, "VNQ") 
		inter := array.indexof(vnq_holdings, ticker) 
		array.push(compo_array, array.get(vnq_comp, inter))
	if array.includes(xbi_holdings, ticker) 
		array.push(holding_array, "XBI") 
		inter := array.indexof(xbi_holdings, ticker) 
		array.push(compo_array, array.get(xbi_comp, inter))
	if array.includes(blcr_holdings, ticker) 
		array.push(holding_array, "BLCR") 
		inter := array.indexof(blcr_holdings, ticker) 
		array.push(compo_array, array.get(blcr_comp, inter))
	if array.includes(vgt_holdings, ticker) 
		array.push(holding_array, "VGT") 
		inter := array.indexof(vgt_holdings, ticker) 
		array.push(compo_array, array.get(vgt_comp, inter))
	if array.includes(vwo_holdings, ticker) 
		array.push(holding_array, "VWO") 
		inter := array.indexof(vwo_holdings, ticker) 
		array.push(compo_array, array.get(vwo_comp, inter))
	if array.includes(vig_holdings, ticker) 
		array.push(holding_array, "VIG") 
		inter := array.indexof(vig_holdings, ticker) 
		array.push(compo_array, array.get(vig_comp, inter))
	if array.includes(vug_holdings, ticker) 
		array.push(holding_array, "VUG") 
		inter := array.indexof(vug_holdings, ticker) 
		array.push(compo_array, array.get(vug_comp, inter))
	if array.includes(vtv_holdings, ticker) 
		array.push(holding_array, "VTV") 
		inter := array.indexof(vtv_holdings, ticker) 
		array.push(compo_array, array.get(vtv_comp, inter))
	if array.includes(vea_holdings, ticker) 
		array.push(holding_array, "VEA") 
		inter := array.indexof(vea_holdings, ticker) 
		array.push(compo_array, array.get(vea_comp, inter))
	if array.includes(dia_holdings, ticker) 
		array.push(holding_array, "DIA") 
		inter := array.indexof(dia_holdings, ticker) 
		array.push(compo_array, array.get(dia_comp, inter))
	if array.includes(fngg_holdings, ticker) 
		array.push(holding_array, "FNGG") 
		inter := array.indexof(fngg_holdings, ticker) 
		array.push(compo_array, array.get(fngg_comp, inter))
	if array.includes(fngu_holdings, ticker) 
		array.push(holding_array, "FNGU") 
		inter := array.indexof(fngu_holdings, ticker) 
		array.push(compo_array, array.get(fngu_comp, inter))
	if array.includes(bnge_holdings, ticker) 
		array.push(holding_array, "BNGE") 
		inter := array.indexof(bnge_holdings, ticker) 
		array.push(compo_array, array.get(bnge_comp, inter))
	if array.includes(ixp_holdings, ticker) 
		array.push(holding_array, "IXP") 
		inter := array.indexof(ixp_holdings, ticker) 
		array.push(compo_array, array.get(ixp_comp, inter))
	if array.includes(fcom_holdings, ticker) 
		array.push(holding_array, "FCOM") 
		inter := array.indexof(fcom_holdings, ticker) 
		array.push(compo_array, array.get(fcom_comp, inter))
	if array.includes(pnqi_holdings, ticker) 
		array.push(holding_array, "PNQI") 
		inter := array.indexof(pnqi_holdings, ticker) 
		array.push(compo_array, array.get(pnqi_comp, inter))
	if array.includes(chps_holdings, ticker) 
		array.push(holding_array, "CHPS") 
		inter := array.indexof(chps_holdings, ticker) 
		array.push(compo_array, array.get(chps_comp, inter))
	if array.includes(soxx_holdings, ticker) 
		array.push(holding_array, "SOXX") 
		inter := array.indexof(soxx_holdings, ticker) 
		array.push(compo_array, array.get(soxx_comp, inter))
	if array.includes(xlk_holdings, ticker) 
		array.push(holding_array, "XLK") 
		inter := array.indexof(xlk_holdings, ticker) 
		array.push(compo_array, array.get(xlk_comp, inter))
	if array.includes(moon_holdings, ticker) 
		array.push(holding_array, "MOON") 
		inter := array.indexof(moon_holdings, ticker) 
		array.push(compo_array, array.get(moon_comp, inter))
	if array.includes(ufo_holdings, ticker) 
		array.push(holding_array, "UFO") 
		inter := array.indexof(ufo_holdings, ticker) 
		array.push(compo_array, array.get(ufo_comp, inter))
	if array.includes(vdc_holdings, ticker) 
		array.push(holding_array, "VDC") 
		inter := array.indexof(vdc_holdings, ticker) 
		array.push(compo_array, array.get(vdc_comp, inter))
	if array.includes(iedi_holdings, ticker) 
		array.push(holding_array, "IEDI") 
		inter := array.indexof(iedi_holdings, ticker) 
		array.push(compo_array, array.get(iedi_comp, inter))
	if array.includes(virs_holdings, ticker) 
		array.push(holding_array, "VIRS") 
		inter := array.indexof(virs_holdings, ticker) 
		array.push(compo_array, array.get(virs_comp, inter))
	if array.includes(ftxg_holdings, ticker) 
		array.push(holding_array, "FTXG") 
		inter := array.indexof(ftxg_holdings, ticker) 
		array.push(compo_array, array.get(ftxg_comp, inter))
	if array.includes(jets_holdings, ticker) 
		array.push(holding_array, "JETS") 
		inter := array.indexof(jets_holdings, ticker) 
		array.push(compo_array, array.get(jets_comp, inter))
	if array.includes(iyj_holdings, ticker) 
		array.push(holding_array, "IYJ") 
		inter := array.indexof(iyj_holdings, ticker) 
		array.push(compo_array, array.get(iyj_comp, inter))
	if array.includes(fxr_holdings, ticker) 
		array.push(holding_array, "FXR") 
		inter := array.indexof(fxr_holdings, ticker) 
		array.push(compo_array, array.get(fxr_comp, inter))
	if array.includes(iyc_holdings, ticker) 
		array.push(holding_array, "IYC") 
		inter := array.indexof(iyc_holdings, ticker) 
		array.push(compo_array, array.get(iyc_comp, inter))
	if array.includes(xly_holdings, ticker) 
		array.push(holding_array, "XLY") 
		inter := array.indexof(xly_holdings, ticker) 
		array.push(compo_array, array.get(xly_comp, inter))
	if array.includes(iyk_holdings, ticker) 
		array.push(holding_array, "IYK") 
		inter := array.indexof(iyk_holdings, ticker) 
		array.push(compo_array, array.get(iyk_comp, inter))
	if array.includes(fdis_holdings, ticker) 
		array.push(holding_array, "FDIS") 
		inter := array.indexof(fdis_holdings, ticker) 
		array.push(compo_array, array.get(fdis_comp, inter))
	if array.includes(pej_holdings, ticker) 
		array.push(holding_array, "PEJ") 
		inter := array.indexof(pej_holdings, ticker) 
		array.push(compo_array, array.get(pej_comp, inter))
	if array.includes(iyt_holdings, ticker) 
		array.push(holding_array, "IYT") 
		inter := array.indexof(iyt_holdings, ticker) 
		array.push(compo_array, array.get(iyt_comp, inter))
	if array.includes(ftxr_holdings, ticker) 
		array.push(holding_array, "FTXR") 
		inter := array.indexof(ftxr_holdings, ticker) 
		array.push(compo_array, array.get(ftxr_comp, inter))
	if array.includes(xtn_holdings, ticker) 
		array.push(holding_array, "XTN") 
		inter := array.indexof(xtn_holdings, ticker) 
		array.push(compo_array, array.get(xtn_comp, inter))
	if array.includes(sea_holdings, ticker) 
		array.push(holding_array, "SEA") 
		inter := array.indexof(sea_holdings, ticker) 
		array.push(compo_array, array.get(sea_comp, inter))
	[holding_array, compo_array]

// @function searches the entire ETF library by sector and pulls by desired sector  
// @param input string variable for sector, must be one of the following strings "Basic Materials", "Consumer Cyclical", "Financial Services", "Real Estate", "Consumer Defensive", "Healthcare", "Utilities", "Communication Services", "Energy", "Industrials", "Technology"
// @returns returns 2 arrays, sector_array (string array) and composition array (float array) 
export etf_search_sectors(string sector) => 
	string[] sector_array = array.new<string>() 
	float[] composition_array = array.new<float>() 
	int i = 0 
	spy_sectors = array.from(2.19, 10.74, 12.32, 2.35, 6.58, 13.19, 2.50, 8.71, 4.54, 8.19, 28.69)
	qqq_sectors = array.from(0, 13.83, 0.50, 0.27, 6.36, 7.00, 1.30, 15.72, 0.56, 4.92, 49.53)
	arkk_sectors = array.from(0, 12.90, 9.07, 0, 0.23, 24.57, 0, 17.40, 0, 1.07, 34.77)
	xle_sectors = array.from(0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 100, 0.00, 0.00)
	brk_sectors = array.from(0.18, 1.01, 21.86, 0, 10.94, 1.06, 0, 2.16, 9.34, 0.15, 53.25)
	ita_sectors = array.from(0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 100.0, 0.00)
	iwm_sectors = array.from(4.71, 10.16, 14.43, 7.32, 4.43, 14.37, 2.97, 2.18, 8.47, 15.46, 15.50) 
	xlf_sectors = array.from(0.00, 0.00, 96.59, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.62, 2.80)
	xlv_sectors = array.from(0.00, 0.00, 0.00, 0.00, 0.00, 100.0, 0.00, 0.00, 0.00, 0.00, 0.00)
	vnq_sectors = array.from(0.00, 0.00, 0.00, 99.17, 0.00, 0.00, 0.00, 0.82, 0.00, 0.00, 0.00)
	xbi_sectors = array.from(0.00, 0.00, 0.00, 0.00, 0.00, 100.00, 0.00, 0.00, 0.00, 0.00, 0.00)
	blcr_sectors = array.from(4.24, 11.88, 13.43, 0.00, 6.30, 15.10, 0.00, 13.56, 5.04, 3.44, 27.01)
	vgt_sectors = array.from(0.02, 0.00, 0.10, 00.00, 0.00, 0.01, 0.00, 0.19, 0.00, 0.33, 99.35)
	vwo_sectors = array.from(8.68, 13.39, 21.13, 2.82, 6.38, 4.64, 3.34, 9.04, 5.69, 8.21, 16.67)
	vig_sectors = array.from(4.15, 7.17, 18.23, 0.00, 12.07, 15.47, 2.67, 1.37, 3.53, 12.97, 22.36)
	vug_sectors = array.from(1.73, 16.88, 5.99, 1.71, 2.22, 8.76, 0.00, 13.72, 1.36, 3.36, 44.27)
	vtv_sectors = array.from(2.72, 3.19, 19.92, 3.07, 11.26, 18.99, 5.06, 3.23, 8.45, 13.55, 10.54) 
	vea_sectors = array.from(7.79, 10.85, 19.03, 3.32, 8.08, 11.09, 2.91, 3.97, 5.91, 16.90, 10.14)
	dia_sectors = array.from(0.96, 12.95, 19.77, 0.00, 7.38, 21.20, 0.00, 2.33, 2.91, 13.70, 18.80)
	fngg_sectors = array.from(0.00, 17.84, 0.00, 0.00, 0.00, 0.00, 0.00, 31.11, 0.00, 0.00, 51.04)
	fngu_sectors = array.from(0.00, 21.06, 0.00, 0.00, 0.00, 0.00, 0.00, 30.92, 0.00, 0.00, 48.02)
	bnge_sectors = array.from(0.00, 21.23, 0.00, 0.00, 0.00, 0.00, 0.00, 59.44, 0.00, 0.00, 19.33) 
	ixp_sectors = array.from(0.00, 0.21, 0.00, 0.54, 0.00, 0.00, 0.00, 99.25, 0.00, 0.00, 0.00) 
	fcom_sectors = array.from(0.00, 0.63, 0.00, 0.00, 0.00, 0.00, 0.00, 96.97, 0.00, 0.09, 2.31)
	pnqi_sectors = array.from(0.00, 26.74, 3.53, 1.50, 0.05, 0.16, 0.00, 32.38, 0.00, 0.00, 35.64)  
	chps_sectors = array.from(0.30, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.51, 98.19)
	soxx_sectors = array.from(0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 100.00) 
	xlk_sectors = array.from(0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 100.00) 
	moon_sectors = array.from(0.00, 8.87, 6.63, 0.00, 0.00, 22.66, 0.00, 5.32, 0.00, 16.45, 40.07)
	ufo_sectors = array.from(0.00, 0.67, 0.00, 0.00, 0.00, 0.00, 0.00, 34.59, 0.00, 31.75, 32.99) 
	vdc_sectors = array.from(0.20, 0.72, 0.00, 0.00, 98.21, 0.71, 0.00, 0.00, 0.00, 0.16, 0.00) 
	iedi_sectors = array.from(0.00, 67.59, 1.16, 0.40, 23.16, 0.48, 0.00, 1.67, 0.08, 3.71, 1.75)
	virs_sectors = array.from(2.06, 15.28, 0.00, 0.00, 11.37, 52.82, 0.00, 5.12, 0.00, 4.43, 8.92) 
	ftxg_sectors = array.from(0.00, 0.00, 0.00, 0.00, 100.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00)
	jets_sectors = array.from(0.00, 9.67, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 90.33, 0.00) 
	// Search for sector  
	if sector == "Basic Materials"
		i := 0 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Consumer Cyclical" 
		i := 1 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Financial Services"
		i := 2
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Real Estate" 
		i := 3
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Consumer Defensive" 
		i := 4
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Healthcare" 
		i := 5 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Utilities"
		i := 6 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Communication Services" 
		i := 7 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Energy" 
		i := 8 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Industrials"
		i := 10 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	if sector == "Technology"
		i := 10 
		if array.get(spy_sectors, i) > 0 
			array.push(sector_array, "SPY")
			array.push(composition_array, array.get(spy_sectors, i))
		if array.get(qqq_sectors, i) > 0 
			array.push(sector_array, "QQQ")
			array.push(composition_array, array.get(qqq_sectors, i))
		if array.get(arkk_sectors, i) > 0 
			array.push(sector_array, "ARKK")
			array.push(composition_array, array.get(arkk_sectors, i))
		if array.get(xle_sectors, i) > 0 
			array.push(sector_array, "XLE")
			array.push(composition_array, array.get(xle_sectors, i))
		if array.get(brk_sectors, i) > 0 
			array.push(sector_array, "BRK.B")
			array.push(composition_array, array.get(brk_sectors, i))	
		if array.get(ita_sectors, i) > 0 
			array.push(sector_array, "ITA")
			array.push(composition_array, array.get(ita_sectors, i))	
		if array.get(iwm_sectors, i) > 0 
			array.push(sector_array, "IWM")
			array.push(composition_array, array.get(iwm_sectors, i))	
		if array.get(xlf_sectors, i) > 0 
			array.push(sector_array, "XLF")
			array.push(composition_array, array.get(xlf_sectors, i))
		if array.get(xlv_sectors, i) > 0 
			array.push(sector_array, "XLV")
			array.push(composition_array, array.get(xlv_sectors, i))
		if array.get(vnq_sectors, i) > 0 
			array.push(sector_array, "VNQ")
			array.push(composition_array, array.get(vnq_sectors, i))
		if array.get(xbi_sectors, i) > 0 
			array.push(sector_array, "XBI")
			array.push(composition_array, array.get(xbi_sectors, i))
		if array.get(blcr_sectors, i) > 0 
			array.push(sector_array, "BLCR")
			array.push(composition_array, array.get(blcr_sectors, i))
		if array.get(vgt_sectors, i) > 0 
			array.push(sector_array, "VGT")
			array.push(composition_array, array.get(vgt_sectors, i))
		if array.get(vwo_sectors, i) > 0 
			array.push(sector_array, "VWO")
			array.push(composition_array, array.get(vwo_sectors, i))
		if array.get(vig_sectors, i) > 0 
			array.push(sector_array, "VIG")
			array.push(composition_array, array.get(vig_sectors, i))
		if array.get(vug_sectors, i) > 0 
			array.push(sector_array, "VUG")
			array.push(composition_array, array.get(vug_sectors, i))
		if array.get(vtv_sectors, i) > 0 
			array.push(sector_array, "VTV")
			array.push(composition_array, array.get(vtv_sectors, i))
		if array.get(vea_sectors, i) > 0 
			array.push(sector_array, "VEA")
			array.push(composition_array, array.get(vea_sectors, i))
		if array.get(dia_sectors, i) > 0 
			array.push(sector_array, "DIA")
			array.push(composition_array, array.get(dia_sectors, i))
		if array.get(fngg_sectors, i) > 0 
			array.push(sector_array, "FNGG")
			array.push(composition_array, array.get(fngg_sectors, i))
		if array.get(fngu_sectors, i) > 0 
			array.push(sector_array, "FNGU")
			array.push(composition_array, array.get(fngu_sectors, i))
		if array.get(bnge_sectors, i) > 0 
			array.push(sector_array, "BNGE")
			array.push(composition_array, array.get(bnge_sectors, i))
		if array.get(ixp_sectors, i) > 0 
			array.push(sector_array, "IXP")
			array.push(composition_array, array.get(ixp_sectors, i))
		if array.get(fcom_sectors, i) > 0 
			array.push(sector_array, "FCOM")
			array.push(composition_array, array.get(fcom_sectors, i))
		if array.get(pnqi_sectors, i) > 0 
			array.push(sector_array, "PNQI")
			array.push(composition_array, array.get(pnqi_sectors, i))
		if array.get(chps_sectors, i) > 0 
			array.push(sector_array, "CHPS")
			array.push(composition_array, array.get(chps_sectors, i))
		if array.get(soxx_sectors, i) > 0 
			array.push(sector_array, "SOXX")
			array.push(composition_array, array.get(soxx_sectors, i))
		if array.get(xlk_sectors, i) > 0 
			array.push(sector_array, "XLK")
			array.push(composition_array, array.get(xlk_sectors, i))
		if array.get(moon_sectors, i) > 0 
			array.push(sector_array, "MOON")
			array.push(composition_array, array.get(moon_sectors, i))
		if array.get(ufo_sectors, i) > 0 
			array.push(sector_array, "UFO")
			array.push(composition_array, array.get(ufo_sectors, i))
		if array.get(vdc_sectors, i) > 0 
			array.push(sector_array, "VDC")
			array.push(composition_array, array.get(vdc_sectors, i))
		if array.get(iedi_sectors, i) > 0 
			array.push(sector_array, "IEDI")
			array.push(composition_array, array.get(iedi_sectors, i))
		if array.get(virs_sectors, i) > 0 
			array.push(sector_array, "VIRS")
			array.push(composition_array, array.get(virs_sectors, i))
		if array.get(ftxg_sectors, i) > 0 
			array.push(sector_array, "FTXG")
			array.push(composition_array, array.get(ftxg_sectors, i))
		if array.get(jets_sectors, i) > 0 
			array.push(sector_array, "JETS")
			array.push(composition_array, array.get(jets_sectors, i))
	[sector_array, composition_array]


// Use as Standalone 

search_for_ticker = input.bool(true, "Search for Current Ticker in ETFs") 

current = syminfo.ticker 

if search_for_ticker 
	[sector, compo] = etf_search_ticker(current) 
	var table results = table.new(position.middle_center, 3, 50, bgcolor = color.black, frame_color = color.white, frame_width = 2)
	if array.size(sector) > 0  
		table.cell(results, 1, 1, text = "ETF", bgcolor = color.black, text_color = color.white) 
		table.cell(results, 2, 1, text = "Composition", bgcolor = color.black, text_color = color.white) 

		for i = 0 to array.size(sector) - 1 
			table.cell(results, 1, 2 + i, text = str.tostring(array.get(sector, i)), bgcolor = color.black, text_color = color.white) 
			table.cell(results, 2, 2 + i, text = str.tostring(array.get(compo, i)), bgcolor = color.black, text_color = color.white) 
