Strategies & Tips

How to Add Custom Indicators to TradingView Charts

By Christopher Downie6 min read
How to Add Custom Indicators to TradingView Charts

To add a custom indicator to TradingView, open Indicators, search for the script, and click its name. For code you own or can edit, open the Pine Editor, save the script, and select Add to chart. You can then configure the available inputs, display settings, and alerts.

If you want to build an indicator from an idea, LuxAlgo’s native charting workspace offers another route: describe the study to Quant, our coding agent, and review it on the active chart. This guide covers the TradingView installation process first, then explains how Quant Charts and Quant fit into that workflow.

Step 1: Find and Add the Right TradingView Script

Open a TradingView Superchart and select your market and timeframe. Click Indicators in the upper toolbar to open the indicator dialog. Search by name or keyword, check the author and description, then click the chosen indicator once to load it. TradingView’s indicator setup guide covers this menu.

A search for “RSI,” for example, may return the standard oscillator and several custom variations. Check what each variation changes before choosing one: a familiar name does not mean identical calculations or signals.

LocationWhat to look forUseful check
TechnicalsTradingView’s built-in indicators and other studiesChoose the intended script type
CommunityPublished scripts from other authorsRead the description and release notes
PersonalScripts saved through your Pine EditorConfirm you are adding the correct saved version
FavoritesScripts you have starredKeep frequently used studies easy to find
TradingView indicator dialog showing search, Personal, Technicals, Community, and Favorites categories
Indicator selection in TradingView’s current Pine Script® documentation. Source: TradingView.

Indicators, strategies, and libraries are different

An indicator calculates and displays a study. A strategy includes simulated order logic and can produce a Strategy Tester report. A Pine Script® library supplies functions that another script imports; you do not add the library directly to a chart. See TradingView’s script-type explanation.

Adding an indicator therefore does not automatically backtest a trading method. Colored candles, arrows, or a visually convincing historical chart are not a record of executed trades.

Step 2: Add Your Own Code or Modify an Open-Source Indicator

  1. Open the Pine Editor from the chart interface.
  2. Use the script menu’s Create new → Indicator option, or open an existing script you own.
  3. Enter the complete Pine Script® code, including its version declaration. Use code you are permitted to copy or modify.
  4. Save it with a recognizable name, then choose Add to chart.
  5. If compilation fails, address the reported error before judging the indicator’s output.

Saving a script to your account does not require publishing it to the community. TradingView’s first-indicator tutorial walks through creating, saving, and adding a script.

For available built-in source, open Source code, create a working copy, edit, and add the copy separately. Open-source scripts expose their code; protected scripts remain closed. See Pine Script® first steps for source access and working-copy instructions.

Video: Modifying a Public TradingView Indicator

This third-party tutorial from Pine Script Strategy demonstrates modifying an existing public indicator. It uses an older TradingView interface and Pine version; follow the current documentation above for menu locations and language details.

Step 3: Configure Inputs and Keep the Chart Readable

Open the indicator’s Settings from its name on the chart. Inputs contains the controls its author made editable; Style controls supported visuals; Visibility controls which chart intervals display the study. Not every script exposes every calculation, color, or plot type.

Record the initial settings before changing them. For a moving average, distinguish the length, price source, and calculation method: a 20-period SMA of closing prices is a different study from a 20-period EMA of high/low midpoints. Twenty bars also represent different amounts of time on a five-minute and a daily chart.

  • Length: shorter settings may react sooner while producing more fluctuations; longer settings may respond later. Test the tradeoff rather than choosing whichever looks best on one chart.
  • Source: close, high, low, and HL2 are different inputs. HL2 is the midpoint of the bar’s high and low.
  • Thresholds: RSI levels such as 70 and 30 describe oscillator readings, not guaranteed reversal prices.
  • Display: use distinct colors and restrained opacity, and label the settings so another chart can reproduce them.

Moving averages and price bands commonly overlay candles. RSI and MACD commonly use separate panes because their numerical scales differ from price. A volume profile displays volume by price, so it should not be treated as interchangeable with an ordinary volume histogram below the chart.

Combine indicators with distinct jobs

Start with one study you understand. Add another only when it answers a separate question: a moving average for a trend condition, RSI for momentum, or volume for activity. Several indicators derived from the same closing prices can repeat the same information.

Define the combination precisely. “Price above the 20-period EMA and RSI above 50 at the completed candle close” is a reproducible screening condition. It still needs entry timing, exits, costs, and position sizing before it becomes a testable trading strategy. More indicators do not automatically improve it.

Step 4: Set Alerts That Match the Rules

Open Create Alert, select the intended symbol or script under Condition, and configure the event, frequency, message, and delivery options. Adding alert code to a script only makes events available; you must still create the running alert through TradingView’s interface.

Once Per Bar is not the same as Once Per Bar Close. The former can notify during an unfinished candle. If your rule depends on a completed close, use the corresponding close-based behavior and check how the script generates its events.

TradingView stores a snapshot of a script alert’s code, inputs, symbol, and timeframe when you create it. Changing your chart afterward does not update that running alert: delete and recreate it when those changes should apply. These behaviors are documented in TradingView’s Pine alert guide.

For supported studies, multi-condition alerts on Plus and higher plans can combine up to five conditions. They use the same symbol and require all conditions to be true together. Strategies and scripts using alert() are not supported by this multi-condition feature. Use the dialog’s Add condition option and check its current eligibility rules.

Be careful with wording: “RSI crosses above 70” describes an event; “RSI is above 70” describes a state. Requiring several crossing events on the same candle can produce far fewer notifications than requiring several states. An alert is a notification, not confirmation of a broker fill.

Step 5: Build and Refine Indicators on LuxAlgo’s Native Charts

You can work directly in LuxAlgo when you want charting and custom indicator development together. Open the Quant workspace, select the market and timeframe, and tell Quant what the study should calculate and where it should appear.

Create a 20-period EMA of closing prices as an overlay. Make the plot blue and expose the length as an input. Do not add trade entries or exits.

Review the generated code and plotted result, then request one change at a time. Compare values with an equivalent reference study using the same data and inputs. A script that runs successfully still needs its logic checked.

Quant also accepts an image or a selected chart region as context. That helps explain a desired visual change, but a screenshot cannot establish an unseen indicator’s exact formula. State any calculation rules you need preserved. See making indicators with Quant.

Current LuxAlgo chart-area capture: select the relevant region and describe the change you want Quant to make. The selection provides visual context for the request.

Add Existing Studies in the Native Indicator Picker

For an existing study, use the native Indicators picker to browse built-in, order-flow, and LuxAlgo Library tools. Check the active chart before adding a study in a multi-chart layout.

Official LuxAlgo demonstration of adding studies on the native charting platform. This is a separate interface from TradingView’s indicator menu.

If you want to test a trading method, ask Quant to convert the indicator into a strategy with explicit orders and risk rules, then review the native backtest workflow. Set costs and execution assumptions and inspect individual trades. An indicator alone does not produce a meaningful profitability test.

If you take Pine Script® code to TradingView, compile and compare it there. Verify supported functions, data feeds, symbols, timeframes, and settings; do not assume identical behavior across platforms or automatic synchronization of later edits.

Using LuxAlgo Tools on Quant Charts

LuxAlgo’s own tools live in the Library and open on a Quant Chart in one click, built into Quant Charts, free to start: market-structure and price-action tools, trend and reversal tools, and momentum and money-flow tools. Choose the features relevant to your analysis instead of enabling everything.

Quant, our coding agent, writes and repairs Pine Script® and runs it on LuxAlgo through PineTS, so a custom indicator can be checked there before you take the code anywhere else.

Troubleshoot Before Adding More Complexity

ProblemFirst check
Script is missing or lockedConfirm its name, author, account, and any required access grant
Code does not compileRead the error and confirm the Pine version and complete code were copied
Script runs but nothing appearsCheck visibility, scale, available history, and whether its plotting conditions occur
Values differ between chartsMatch the venue, symbol, timeframe, session, price source, and inputs
Alerts use old settingsRecreate the script alert with the intended configuration
Chart becomes slowRemove unnecessary studies, isolate the expensive script, and review its documented limits

Neither a built-in label nor custom source code establishes reliability by itself. Keep a record of the script version and settings, check its behavior on new candles, and test any trading rules separately. A small, understandable setup is easier to maintain than a collection of signals whose calculations you cannot explain.

Learn to trade smarter.

Market analysis and techniques that build your edge, one email a week.

Don’t worry, no spam here. See our privacy policy for more info.

Christopher Downie
Christopher Downie

Content & Product Strategist at LuxAlgo || Background in Computer Science || 7 years experience in retail CFD trading.

Read next