Ticker Industry and Competitor LookupThe Ticker Industry and Competitor Lookup is a comprehensive indicator that provides instant access to industry classification data and competitive intelligence for any ticker symbol. Built using the advanced SIC_TICKER_DATA library, this tool delivers professional-grade sector analysis with enterprise-level performance. It's a simple yet great tool for competitor research, sector studies, portfolio diversification, and investment decision-making.
This indicator is a simple tool built on based on our SIC_TICKER_DATA library to demonstrate the use cases of the library. In this case, you enter a ticker and it displays the sector, SIC or Standard Industrial Classification which is a SEC identifier, and more importantly, the competitors that are listed to be in the exact same SIC by SEC.
There isn't much to say about the indicator itself but we strongly recommend checking out the SIC_TICKER_DATA library we just published to learn more about the types of indicators you can build using it.
Industrygroups
SIC_TICKER_DATAThe SIC Ticker Data is an advanced and efficient library for ticker-to-industry classification and sector analysis. Built with enterprise-grade performance optimizations, this library provides instant access to SIC codes, industry classifications, and peer company data for comprehensive market analysis.
Perfect for: Sector rotation strategies, peer analysis, portfolio diversification, market screening, and financial research tools.
The simple idea behind this library is to pull any data related to SIC number of any US stock market ticker provided by SEC in order to see the industry and also see the exact competitors of the ticker.
The library stores 3 types of data: SIC number, Ticker, and Industry name. What makes it very useful is that you can pull any one of this data using the other. For example, if you would like to know which tickers are inside a certain SIC, or what's the SIC number of a specific ticker, or even which tickers are inside a certain industry, you can use this library to pull this data. The idea for data inside this library is to be accessible in any direction possible as long as they're related to each other.
We've also published a simple indicator that uses this library in order to demonstrate the inner workings of this library.
The library stores thousands of tickers and their relevant SIC code and industry for your use and is constantly updated with new data when available. This is a large library but it is optimized to run as fast as possible. The previous unpublished versions would take over 40 seconds to load any data but the final public version here loads the data in less than 5 seconds.
🔍 Primary Lookup Functions
createDataStore()
Initialize the library with all pre-loaded data.
store = data.createDataStore()
getSicByTicker(store, ticker)
Get SIC code for any ticker symbol.
sic = data.getSicByTicker(store, "AAPL") // Returns: "3571"
getIndustryByTicker(store, ticker)
Get industry classification for any ticker.
industry = data.getIndustryByTicker(store, "AAPL") // Returns: "Computer Hardware"
getTickersBySic(store, sic)
Get all companies in a specific SIC code.
software = data.getTickersBySic(store, "7372") // Returns: "MSFT,GOOGL,META,V,MA,CRM,ADBE,ORCL,NOW,INTU"
getTickersByIndustry(store, industry)
Get all companies in an industry.
retail = data.getTickersByIndustry(store, "Retail") // Returns: "AMZN,HD,WMT,TGT,COST,LOW"
📊 Array & Analysis Functions
getTickerArrayBySic(store, sic)
Get tickers as array for processing.
techArray = data.getTickerArrayBySic(store, "7372")
for i = 0 to array.size(techArray) - 1
ticker = array.get(techArray, i)
// Process each tech company
getTickerCountBySic(store, sic)
Count companies in a sector (ultra-fast).
pinescripttechCount = data.getTickerCountBySic(store, "7372") // Returns: 10
🎯 Utility Functions
tickerExists(store, ticker)
Check if ticker exists in database.
exists = data.tickerExists(store, "AAPL") // Returns: true
tickerInSic(store, ticker, sic)
Check if ticker belongs to specific sector.
isInTech = data.tickerInSic(store, "AAPL", "3571") // Returns: true
💡 Usage Examples
Example 1: Basic Ticker Lookup
// @version=6
import EdgeTerminal/SIC_TICKER_DATA/1 as data
indicator("Ticker Analysis", overlay=true)
store = data.createDataStore()
currentSic = data.getSicByTicker(store, syminfo.ticker)
currentIndustry = data.getIndustryByTicker(store, syminfo.ticker)
if barstate.islast and currentSic != "NOT_FOUND"
label.new(bar_index, high, syminfo.ticker + " SIC: " + currentSic + " Industry: " + currentIndustry)
Example 2: Sector Analysis
// @version=6
import EdgeTerminal/SIC_TICKER_DATA/1 as data
indicator("Sector Comparison", overlay=false)
store = data.createDataStore()
// Compare sector sizes
techCount = data.getTickerCountBySic(store, "7372") // Software
financeCount = data.getTickerCountBySic(store, "6199") // Finance
healthCount = data.getTickerCountBySic(store, "2834") // Pharmaceutical
plot(techCount, title="Tech Companies", color=color.blue)
plot(financeCount, title="Finance Companies", color=color.green)
plot(healthCount, title="Health Companies", color=color.red)
Example 3: Peer Analysis
// @version=6
import EdgeTerminal/SIC_TICKER_DATA/1 as data
indicator("Find Competitors", overlay=true)
store = data.createDataStore()
currentSic = data.getSicByTicker(store, syminfo.ticker)
if currentSic != "NOT_FOUND"
competitors = data.getTickersBySic(store, currentSic)
peerCount = data.getTickerCountBySic(store, currentSic)
if barstate.islast
label.new(bar_index, high, "Competitors (" + str.tostring(peerCount) + "): " + competitors)
Example 4: Portfolio Sector Allocation
// @version=6
import EdgeTerminal/SIC_TICKER_DATA/1 as data
indicator("Portfolio Analysis", overlay=false)
store = data.createDataStore()
// Analyze your portfolio's sector distribution
portfolioTickers = array.from("AAPL", "MSFT", "GOOGL", "JPM", "JNJ")
sectorCount = map.new()
for i = 0 to array.size(portfolioTickers) - 1
ticker = array.get(portfolioTickers, i)
industry = data.getIndustryByTicker(store, ticker)
if industry != "NOT_FOUND"
currentCount = map.get(sectorCount, industry)
newCount = na(currentCount) ? 1 : currentCount + 1
map.put(sectorCount, industry, newCount)
🔧 Advanced Feature
You can also bulk load data for large data sets like this:
// Pre-format your data as pipe-separated string
bulkData = "AAPL:3571:Computer Hardware|MSFT:7372:Software|GOOGL:7372:Software"
store = data.createDataStoreFromBulk(bulkData)
Industry Group Strength - IndiaPresenting the Industry Group Strength Indicator for India market, designed to help traders identify top-performing stocks within specific industry groups that are predefined.
⦿ Identifies Leading Stocks in Industry Groups
⦿ Analyses the following metrics
YTD Return : Measures stock performance from the start of the year.
RS Rating : Relative Strength rating for user-selected periods.
% Return : Percentage return over a user-selected lookback period.
Features
This indicator dynamically recognises the industry group of the current stock on the chart and ranks stocks within that group based on predefined data points. Traders can add this indicator to focus on top-performing stocks relative to their industry.
⦿ Color-coded for Easy Visualisation
You can choose from the following key metrics to rank stocks:
YTD Return
RS Rating
% Return
⦿ Table Format with Performance Metrics Compact mode
Vertical View
Horizontal View
All of the three metrics are shown in the compact mode and the current stock that is viewed is highlighted!
Vertical view
Horizontal view
Stock Ranking
Stocks are ranked based on their performance within industry groups, enabling traders to easily spot leaders and laggards in each sector. Color-coded gradients visually represent the stocks’ performance rankings, with higher percentile rankings indicating better performance.
Relative Strength (RS)
Relative Strength (RS) compares a stock’s performance against the benchmark index. The RS value is normalized from 1 to 99, making it easier to compare across different stocks. A rising RS value indicates that the stock is outperforming the market, helping traders quickly gauge relative performance within industry groups.
Limitations
At the time of developing this indicator, Pine requests are limited to 40 per script so the predefined symbols had to be filtered to 40 per Industry group
Stocks Filters
Filters that are used to filter the stocks in an Industry group to have maximum of 40 stocks
⦿ Auto, Chemical, Engineering, Finance, Pharma
Market Cap >= 1000 Crores and Market Cap <= 60000 Crores
Price >= 30 and Price <= 6000
50 Days Average ( Price * Volume ) >= 6 Crores
⦿ For rest of the Industry groups
Market Cap >= 1000 Crores and Market Cap <= 100000 Crores
Price >= 20 and Price <= 10000
50 Days Average ( Price * Volume ) >= 3 Crores
Credits
This indicator is forked from the Script for US market by @Amphibiantrading Thanks Brandon for the beginning of this indicator.
This indicator is built on TradingView’s new dynamic requests feature, thanks to @PineCoders for making this possible!