TradingView FAQ 2026: 300 Real Questions Answered on Pine Script, Webhooks, Alerts & Backtesting
Your complete TradingView help reference — Pine Script v5/v6 errors, webhook setup for brokers, alert limits and timeouts, backtest vs live discrepancies, the strategy tester, plan comparisons (Essential, Plus, Premium, Ultimate), broker integrations, charts and indicators, and the mobile app. Read it once and skip the subreddit, the Discord, and three hours of stale forum threads.
Table of Contents
Account, Plans & Pricing
20 answersHow much does TradingView cost in 2026?
Is TradingView Premium worth it?
What is the difference between TradingView Essential, Plus, Premium, and Ultimate?
Is the TradingView free plan good enough for beginners?
How many alerts does each TradingView plan allow?
How many indicators can I add per chart on each plan?
How do I get a refund on TradingView?
How do I cancel my TradingView subscription?
Does TradingView offer a free trial?
Will I be charged if I cancel during the TradingView free trial?
Is monthly or annual TradingView cheaper, and what's the discount?
When is the TradingView Black Friday sale and how much off?
Why are TradingView prices different in the iOS app vs the website?
Is TradingView cheaper in some countries, and can I use a VPN to get a better price?
Can I use TradingView on multiple devices at the same time?
How do I upgrade my TradingView plan, and is the upgrade prorated?
How do I delete my TradingView account?
Does TradingView auto-renew my subscription?
Why does TradingView think I'm a professional user?
What does the Ultimate plan include that Premium doesn't?
Charts, Layouts & UI
25 answersHow many charts can I see at once on TradingView?
How do I open a multi-chart layout on TradingView?
How do I sync the charts in a multi-chart layout?
Why aren't my drawings showing on the other charts in my layout?
What's the difference between a chart layout and an indicator template?
How do I save a chart layout so it loads next time?
Where is the full list of TradingView keyboard shortcuts?
What are the most useful TradingView hotkeys?
How do I switch to log scale (and back) on a TradingView chart?
When should I use log scale vs linear on a chart?
How do I switch chart types — Heikin Ashi, Renko, Range, Point & Figure?
What is bar magnifier and how do I turn it on?
How do I change the time zone on my TradingView chart?
How do I show "Exchange time" instead of my local time?
How do I enable or disable dark mode in TradingView?
How do I customize candle body, border, and wick colors?
How do I remove or hide gridlines on the chart?
How do I invert the price scale (flip the chart upside down)?
How do I switch the price scale to percent view?
How do I overlay a second symbol on the same chart?
How do I use multiple monitors with TradingView?
How do I get fullscreen / chart-only mode?
How do I show extended hours (pre-market and after-hours)?
How do I move the volume indicator to its own pane below the chart?
Why did my chart drawings disappear when I switched layouts or symbols?
Indicators & Built-ins
20 answersHow do I add an indicator to a TradingView chart?
How many indicators can I add to one chart?
How do I remove an indicator from my chart?
How do I temporarily hide an indicator without deleting it?
How do I add indicators to my favorites for quick access?
Can I add the same indicator twice with different settings (e.g. fast and slow RSI)?
How do I save my custom indicator settings as the default?
What are indicator templates and how do I save one?
Why does my indicator show in a separate pane below the chart?
How do I move an indicator between panes?
How do I customize indicator colors and line styles?
How do I hide indicator values from the status line and price scale?
What are the default Bollinger Bands settings on TradingView?
SMA vs EMA on TradingView — which should I use?
What is the Anchored VWAP and how do I use it?
What are the default Supertrend settings, and what does the multiplier do?
What are the default Ichimoku Cloud settings?
What's the Source setting (close, hlc3, ohlc4) on indicators?
How do I make a built-in indicator use a higher timeframe?
Can I create a price alert directly from a built-in indicator like RSI?
Pine Script Basics
30 answersWhat is Pine Script and what can I build with it?
How do I open the Pine Editor and create my first script?
What does //@version=6 do and why is it on line 1?
What's the simplest possible Pine Script (Pine "hello world")?
//@version=6, indicator("My Script"), plot(close). Save and add to chart and you get a blue line tracing the close price. That is the canonical starting point used in every Pine tutorial.What's the difference between Pine v5 and v6?
if myInt errors — you have to write if myInt != 0), bool variables can no longer be na, the transp parameter was removed everywhere (use color.new(c, transparency) instead), and the when argument on strategy orders was removed. The wins: dynamic request.security arguments, lazy boolean evaluation, larger string limits, footprint data, and the new input.enum type.Do I have to migrate my v5 scripts to v6?
Why does 5/2 equal 2.5 instead of 2 in Pine v6?
int(): int(5/2) returns 2. This bites people upgrading old scripts that index arrays with integer math.Why does if myInt no longer work in v6?
if myInt errors with "cannot use int as bool." Write if myInt != 0 or if bool(myInt). This single change is the most common compile failure when upgrading v5 scripts.Was study() removed? What replaces it?
indicator() all the way back in Pine v5. Anyone copy-pasting v3/v4 code from old forum posts hits this. Rename to indicator() and add //@version=6 at the top.Why does transp= no longer work?
transp parameter was deprecated in v5 and fully removed in v6. Use color.new(myColor, transparency) wherever you used to pass transp. So plot(close, color=color.blue, transp=80) becomes plot(close, color=color.new(color.blue, 80)). Transparency is 0 (opaque) to 100 (invisible).What's the difference between indicator() and strategy()?
strategy.entry, strategy.exit, etc., and unlock the Strategy Tester tab. You cannot mix the two — a script is either an indicator or a strategy. Calling strategy.entry from inside an indicator is the most common "function does not exist" error.What does overlay=true do?
overlay=true for moving averages, VWAP, support/resistance — anything in price units. Leave it false (the default) for RSI, MACD, oscillators — anything with its own value range.How do I plot a buy/sell arrow on a bar?
plotshape(longCondition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small) draws a green up-triangle below every bar where longCondition is true. location.belowbar, location.abovebar, and location.absolute are the common placements. For text labels instead of shapes, use label.new().How do I change a plot's color based on a condition?
plot(close, color = close > open ? color.green : color.red). Pine accepts series color in plot() so it re-evaluates each bar. Same trick works for bgcolor(), plotshape(), and most plotting functions.How do I shade the background when a condition is true?
bgcolor(myCondition ? color.new(color.orange, 80) : na). The na on the false branch tells TradingView to skip painting that bar entirely. Always wrap colors in color.new() with high transparency (80-90) when shading large regions, otherwise the chart becomes unreadable.How do I let the user change a number in my script?
length = input.int(14, "Length", minval=1) creates an integer input box that shows up in the script's settings dialog. v6 has a full input family: input.int, input.float, input.bool, input.string, input.color, input.source, input.timeframe, input.symbol, input.session, input.time, input.price, input.text_area, and the new input.enum. Use group= and inline= to organise them visually.How do I let the user pick a higher timeframe in my script?
tf = input.timeframe("D", "Higher TF") renders TradingView's standard timeframe dropdown. Then use it: htfClose = request.security(syminfo.tickerid, tf, close). Pair with lookahead=barmerge.lookahead_off to avoid future-leak repaint.What's the difference between = and := in Pine Script?
= declares a new variable. := reassigns an existing variable. x = x + 1 errors because = wants a new declaration; you need x := x + 1. This is the second most common Pine compile error after the v5/v6 type casting issue.What does var do in front of a variable?
var x = 0 initialises x only on the first bar of the script and persists the value across all subsequent bars. Without var, x resets to its initial value every bar. Use var for counters, accumulators, and any state you want to carry forward (e.g., counting how many bars since the last entry).How do I write an if/else statement?
if cond \n body \n else if cond2 \n body2 \n else \n body3. Mixing tabs and spaces is the #1 silent cause of "end of line without line continuation" errors. The Pine Editor inserts spaces by default; if you paste code from another editor, watch for tabs.How do I check if a value is missing (na)?
na(x) returns true when x is na. nz(x) replaces na with 0; nz(x, y) replaces na with y. Common on early bars where a 200-period SMA hasn't filled yet — guard with if not na(myMa) before using the value. In v6, nz() cannot be used on bool variables because bool can't be na.How do I refer to the previous bar's close (or any prior bar)?
close[1] = previous bar's close. close[2] = two bars ago. close[0] is the same as close. You cannot reference the future — close[-1] is invalid. In v6 you also cannot apply [] directly to literals; assign to a variable first.How do I calculate a simple moving average (SMA)?
ta.sma(close, 20). To plot it: plot(ta.sma(close, 20), "20 SMA", color.blue). v5 renamed sma() to ta.sma() (everything moved into the ta. namespace) and v6 kept it that way.How do I detect a moving-average crossover?
ta.crossover(fast, slow) returns true on the bar where fast crosses above slow, and false on every other bar. ta.crossunder() for the opposite. ta.cross() for either direction. Big gotcha: these only return true on the crossing bar — they do not stay true while fast remains above slow. If you want continuous "fast above slow," just use fast > slow.What does "Mismatched input" mean?
What does "Undeclared identifier" mean?
fastMA is not the same as fastMa, Pine is strictly case-sensitive; (2) you used the variable before declaring it; (3) you declared it inside an if block and tried to use it outside (variables declared in a block are scoped to that block). Built-ins are also lowercase only — Close is undeclared, close is the built-in.What does "Cannot use 'series' in 'simple' argument" mean?
request.security, and max_bars_back. Passing a value computed from close (which is a series) fails because series flows up the qualifier hierarchy: const ⊂ input ⊂ simple ⊂ series. To fix, derive the value from input.int() or use a hardcoded literal.Why doesn't print() work in Pine Script?
print() function in Pine. To inspect values visually, use label.new(bar_index, high, str.tostring(myValue)) which puts a text label on the chart, or log.info("RSI is " + str.tostring(rsi)) which writes to the Pine Logs panel (introduced 2023). Logs are the cleaner debugging path and don't clutter the chart.How do I get the current bar's day-of-week or time?
year, month, dayofmonth, dayofweek, hour, minute, second — all in the exchange's timezone. dayofweek returns 1 (Sunday) through 7 (Saturday); the constants dayofweek.monday through dayofweek.friday exist for readability. time and timenow return UTC milliseconds since epoch.Can Pine Script place real broker trades?
Pine Script Advanced
25 answersWhy does my Pine Script repaint when I use request.security?
request.security with lookahead_off on a not-yet-closed higher-timeframe bar returns the developing value — not the confirmed close. On the realtime bar that value flickers as new ticks come in. After the chart bar closes (or you refresh), Pine recalculates using the now-confirmed HTF data and the historical bar paints differently than it did in real time. That mismatch is repaint. The fix depends on whether you can tolerate one bar of latency: either request.security(syminfo.tickerid, htf, close[1], lookahead=barmerge.lookahead_on) (the canonical "non-repainting HTF" pattern, which gives you the previous closed HTF bar's value) or just gate your logic with barstate.isconfirmed. The TradingView official docs have a whole "Repainting" section worth reading; r/algotrading users complain about this more than any other Pine issue.What's the difference between barmerge.lookahead_on and lookahead_off?
lookahead_off (the default) is safe — the function never returns data that wouldn't have been known on the chart bar. lookahead_on tells Pine "you are allowed to fetch values from a higher-timeframe bar before it closes." On its own, lookahead_on creates future leak — your historical chart will show HTF closes before they happened, which is hindsight bias and ruins backtests. Lookahead_on is only safe when paired with an offset like close[1] on the higher TF, because that offsets you back by one bar so you are still asking for confirmed past data. Use the combination, never lookahead_on alone.How do I get a non-repainting higher-timeframe value (the [1] + lookahead_on trick)?
request.security(syminfo.tickerid, htf, close[1], lookahead=barmerge.lookahead_on). The close[1] shifts the lookup back by one HTF bar so you always get the most recent CONFIRMED HTF close, and lookahead_on ensures historical bars also see that confirmed value at the right moment. The cost is a one-bar delay — you don't see the freshest HTF close until the next HTF bar opens. Pattern B (latest-bar mode): use lookahead_off and gate your logic with barstate.isconfirmed, so you ignore the live developing bar and only act on confirmed bars. Pattern A is more common in production indicators; Pattern B is cleaner when you are inside a strategy and want process_orders_on_close behaviour. Both are non-repainting; pick whichever maps to your latency tolerance.What does barmerge.gaps_on vs gaps_off do?
gaps_off (default) fills the result with the last non-na value when the higher TF has no new bar yet — so an HTF EMA stays "hot" on every chart bar. gaps_on returns na on chart bars where the HTF hasn't produced a new bar — so the value only updates at HTF bar opens. The Pine Scripters Network forum has a long thread where someone's HTF EMA looked stale for ten bars; the cause was gaps_off doing exactly what it is supposed to.How do I request data from a lower timeframe (intrabar)?
request.security_lower_tf(). It returns an array — one element per intrabar bar inside each chart bar. So on a 1H chart asking for 1m data, you get up to 60 elements per chart bar. The total is capped at around 100,000 intrabar bars per chart at most plan tiers. Use array.get() to read individual intrabars or array.avg() / array iteration to aggregate. PineCoders' lower_tf library wraps the most common patterns.How many request.security calls am I allowed per script?
How do I make a multi-symbol scanner in Pine Script?
request.security on each, then output results in a table. v6's dynamic_requests=true (the default) lets you pass series ticker arguments, which simplifies the loop pattern, but the 40-call cap still binds — you cannot scan 100 symbols from one script. For more than 40 symbols, the right tool is the Pine Screener (Premium feature). Community scripts like QuantNomad's "Ultimate Custom Screener" max out exactly 40 because of this hard limit.How do I create and loop through an array in Pine Script?
myArr = array.new<float>() creates an empty array. array.push(myArr, close) appends. array.size(myArr) for length, array.get(myArr, i) to read by index, array.set(myArr, i, x) to write. To loop: for i = 0 to array.size(myArr) - 1. The v6 typed-array syntax (array<float>, array<line>) is preferred over the legacy array.new_float() form.What's the maximum size of an array, matrix, or map in Pine Script?
When should I use a matrix vs nested arrays?
matrix when you actually need 2D math — multiplication, inversion, determinants, pseudo-inverse. matrix.mult, matrix.inv, matrix.det, matrix.pinv are all built-in. For loose 2D data where you do not need linear algebra, an array of arrays works fine and is sometimes more flexible because each row can be a different length.How do Pine Script maps work and when should I prefer them?
m = map.new<string, float>(), map.put(m, "AAPL", 192.5), map.get(m, "AAPL"). Prefer maps over arrays when you keep needing to find an element by name or ID — looping an array is O(n), map lookup is O(1). Cap is 50,000 pairs.What is a User-Defined Type (UDT) in Pine Script?
type keyword. Example: type Trade \n float entry \n float stop \n int barIdx. Then t = Trade.new(close, low, bar_index) creates an instance. Field access is dot-notation: t.entry. Critically, UDTs are reference types — if you put a UDT into an array and modify the field on the array element, you have modified the "original" object, because the array stores a reference, not a copy. This bites people once. Field history uses parentheses: (myObj[10]).field, not myObj.field[10].How do I write a method function (the method keyword)?
method foo(MyType this, int x) => this.field + x. Methods enable dot-call syntax on instances: myObj.foo(5). Methods can be exported from a library with export method. Useful for keeping related logic close to the type definition and for chaining method calls fluently.Are arrays, maps, and UDTs passed by reference or by value?
array.copy(), build a new UDT with the fields you want, or rebuild a map from scratch. This trips up developers coming from C-family languages where structs are value types.How do I create and import a Pine Script library?
library("MyLib") instead of indicator()/strategy(), then mark each shareable function with export: export myFunc(int x) => x * 2. Save and publish (the Publish button in the editor — public libraries are visible to all, private libraries are visible only to you). Then in any other script: import yourUsername/MyLib/1 as ml and call ml.myFunc(5). The "/1" pins to library version 1 — TradingView won't auto-upgrade you to a future breaking version. UDTs used in any exported function signature must also be marked export.Can I export a UDT or method from a library?
export in the library and any UDT used in an exported function signature must itself be exported. Methods export with export method. The consumer script imports the library and can use the UDT type directly via the alias.What's the token / compile-size limit for libraries?
What are the default and maximum max_lines_count, max_labels_count, max_boxes_count?
indicator("X", max_lines_count=500, max_labels_count=500). The argument must be a constant int — you cannot drive it from an input.Why do I get "too many drawings, cannot clean oldest"?
max_bars_back in awkward ways (e.g., very long history references inside drawings), Pine sometimes can't safely garbage-collect and throws this error. The fix is usually to raise max_*_count toward 500 and/or reduce how many drawings you create. QuantNomad has the canonical write-up on this.How do I draw a floating dashboard / table on the chart?
var t = table.new(position.top_right, 2, 5, bgcolor=color.gray) creates a 2-column, 5-row table anchored to the top-right of the chart. Then table.cell(t, 0, 0, "Label", text_color=color.white) for each cell. Tables float — they are not anchored to bars, so they do not move when you scroll. Position constants: position.top_left, top_center, top_right, middle_left, etc. Wrap the table.new in var so it is created once, not on every bar.What does "study/strategy code is too complex" mean?
[] history references on many series, which inflate the auto-detected lookback buffer; (2) growing arrays/maps that never trim; (3) too many request.security calls; (4) too many drawing objects (lines, labels, boxes). Mitigations, in order of impact: explicitly set max_bars_back=500 on the variables that need it; trim your arrays; cache request.security results in var instead of recomputing; use calc_bars_count to limit how far back the script even runs. r/algotrading users hit this most often when porting C++ or Python algos that assume cheap memory.What are the historical lookback limits in Pine?
[] referenceability. The core OHLCV built-ins (open, high, low, close, volume, time) go up to 10,000. So close[2000] works on long histories, but a derived myMa[2000] may fail unless you raise max_bars_back.What's the difference between var and varip?
var persists across bars but resets on intra-bar updates to the value committed at the last bar close. varip persists across bars AND across intra-bar ticks — every tick on the realtime bar can mutate it and that mutation sticks. varip only diverges from var on the realtime bar; on historical bars they behave identically. The trap: varip state in live trading has no equivalent in the backtest, so a strategy that relies on tick-level varip counters will look great in backtest and behave differently live. Use var by default; use varip only when you genuinely need tick-by-tick state.How do I get earnings, EPS, or revenue in Pine?
request.financial(syminfo.tickerid, "TOTAL_REVENUE", "TTM") fetches trailing-twelve-month revenue. Other periods: "FY" (fiscal year), "FQ" (fiscal quarter), "FH" (fiscal half). Field names like "EARNINGS_PER_SHARE_BASIC", "GROSS_PROFIT", "NET_INCOME" — the full list is in the Pine reference. Data is sourced from FactSet so coverage is broad but not universal; small-cap and emerging-market tickers often return na.What are dynamic requests in Pine v6 and why do they matter?
request.* functions accept series arguments — meaning the ticker or timeframe you ask for can change per bar, or be derived from a variable. In v5 these arguments had to be constants known at compile time and the function had to be called from global scope. The practical win: you can build a multi-symbol scanner where the ticker rotates per bar based on inputs, and you can call request.security from inside an if block conditionally. This dramatically cleans up code that used to need ugly workarounds.Strategies & Strategy Tester
25 answersWhat's the difference between strategy() and indicator()?
strategy() can call all the strategy.* order functions (entry, exit, close, cancel) and unlocks the Strategy Tester tab with backtest metrics. A script declared with indicator() can plot and fire alerts but cannot place simulated orders. The two are mutually exclusive — copy a strategy template into an indicator and strategy.entry will throw "function does not exist." This is the most common Pine error in r/algotrading "why doesn't my code work" posts.Why isn't my strategy.entry firing any trades?
plotshape() and verify it lights up where you expect — that finds 80% of these.What's the difference between strategy.entry, strategy.order, and strategy.close?
strategy.entry respects pyramiding limits and reverses opposite positions automatically. strategy.order ignores both — it just submits another order regardless of pyramiding or current position. Use strategy.order for grid/martingale strategies that need to bypass pyramiding. strategy.close(id) market-closes a named entry by ID. strategy.cancel(id) cancels a pending limit/stop order by ID. strategy.close_all() flattens everything.Why does my strategy enter on the next bar's open instead of the same bar?
process_orders_on_close=true in the strategy declaration. The trade-off: process-on-close uses the bar's close price as the fill price, which is less realistic for intraday because you cannot really transact at the close.When should I use process_orders_on_close?
What does calc_on_every_tick=true do, and does it cause repaint?
What does calc_on_order_fills=true do?
strategy.position_avg_price) to be set within the same bar. Without it, the avg-price-based exit gets placed one bar late.Why isn't my stop loss / take profit triggering on the entry bar?
strategy.position_avg_price is na until the entry bar closes, so a SL/TP based on it can't be placed until the next bar by default. Enable calc_on_order_fills=true to fix that. Second, if you pass both a stop and a loss to strategy.exit, Pine uses stop; if you pass both limit and profit, it uses limit. Be explicit about which pair you want.How do default_qty_value and default_qty_type control position size?
strategy.fixed (qty in contracts/shares), strategy.cash (qty in account currency), strategy.percent_of_equity (% of current equity). The default is strategy.fixed with default_qty_value=1 — one contract per trade. That is why a brand-new strategy backtest on a $100k account barely moves the equity line; you are trading one contract.What's initial_capital and what's the default?
How does the currency argument interact with the symbol's currency?
currency=currency.USD on the strategy, Pine auto-converts the equity curve into USD using the prevailing FX rate. Mismatched currency settings are a common source of "why is my P&L wrong" complaints — if you are testing on a non-USD instrument, double-check the currency arg.What commission types are available?
strategy.commission.percent (default — % of cash volume), strategy.commission.cash_per_contract, and strategy.commission.cash_per_order. The default commission_value is 0%. A backtest with zero commission can show 30-50% better net profit than live, especially on high-frequency strategies — set this to your real broker's rate before you trust any equity curve.What slippage value should I use?
What does pyramiding control?
pyramiding=3 and you can stack up to 3 long entries before the engine refuses more. Only strategy.entry respects pyramiding; strategy.order ignores it (which is why grid strategies use strategy.order).How do I create bracket orders (entry + SL + TP)?
strategy.exit("Bracket", "EntryID", stop=slPrice, limit=tpPrice). The from_entry argument is the link — it must match the entry's id string exactly, otherwise the exit attaches to nothing. The exit creates an OCO pair: when one side fires, the other cancels automatically.What is Deep Backtesting and which plan do I need?
How do I read the Strategy Tester's Performance Summary?
How is Max Drawdown calculated?
How do I export the List of Trades to CSV?
Why are my backtest results so different from live trading?
request.security with lookahead_on leaks future data; non-standard chart types (Heikin Ashi, Renko) backtest at synthetic prices that do not exist; calc_on_every_tick diverges historical from live. The widely cited rule of thumb on r/algotrading is that live results land at 60-70% of the backtest equity curve once you set realistic costs.Can I backtest on Heikin Ashi or Renko? Why are the results "too good"?
Can TradingView do walk-forward analysis or parameter optimization?
How do I size positions correctly for futures?
syminfo.pointvalue and syminfo.mintick give you these in Pine. With strategy.cash sizing you have to factor point value into your math, otherwise a $5,000 cash size on ES would buy 100 contracts, which is not what you mean. strategy.percent_of_equity is generally safer for futures because it sizes to risk capacity rather than dollar amount.Can I cancel a pending limit order from inside Pine?
strategy.cancel("MyOrderID") cancels a single named pending order. strategy.cancel_all() cancels every pending order. The id string must match the entry's id exactly — it is case-sensitive and a typo silently does nothing.My backtest looks great — how do I take this strategy live with a real broker?
strategy.entry/strategy.exit calls into alert() messages that emit a JSON payload, attach a single TradingView alert to the strategy with a webhook URL, and let a bridge translate the alert into a real broker order. PickMyTrade is one of the bridges that handles this for futures (Tradovate, Rithmic, TradeStation, ProjectX), forex/CFDs (TradeLocker, Match-Trader), stocks/options (IBKR, Tradier), and crypto (Binance, Bybit) — the alert fires on bar close, the bridge routes it, the broker fills it. Make sure to use "Once per bar close" alert frequency and to match your strategy's process_orders_on_close behaviour to avoid backtest-vs-live drift.Alerts (Creation & Logic)
25 answersDo TradingView alerts work when my computer is off?
alertcondition(), alert() from any script) are server-side and show a small cloud icon in the alert dialog. A handful of custom client-side alerts only run while a TradingView tab is open. The cloud icon is the tell.What's the difference between server-side and client-side alerts?
What notification options can I attach to a TradingView alert?
How do I get TradingView alerts on my phone?
What's the difference between "Once Per Bar" and "Once Per Bar Close"?
What does "Only Once" do — does the alert delete itself?
What does "Once Per Minute" actually mean?
Why does my alert keep firing multiple times on the same bar?
alert() in Pine, also check the freq argument — alert.freq_all fires on every tick, alert.freq_once_per_bar on the first true tick, alert.freq_once_per_bar_close only at confirmed close.My alert fired during the bar but the signal disappeared after close — why?
How do I make my live alerts match my strategy backtest exactly?
request.security with default lookahead (use the [1] + lookahead_on pattern or Once Per Bar Close gating). Avoid calc_on_every_tick=true. In strategies, set process_orders_on_close=true so the simulated fill matches the bar where the alert actually fires. Doing all four eliminates the most common backtest-vs-live drift.How many active alerts can I have on each TradingView plan?
Why do my TradingView alerts expire after 2 months?
My Premium alerts are still expiring — why?
My alert was triggered too often and got disabled — what happened?
What's the difference between a price-crossing alert and an indicator alert?
What are the comparison operators in the alert dialog?
How do I set an alert on RSI without writing Pine?
How do I set an alert on a trendline or other drawing?
Can I combine multiple conditions in one alert (RSI < 30 AND price > 200MA)?
alertcondition(myCombinedBool) or alert("..."), then create an alert on that indicator. This is one of the main reasons people start writing their first Pine script.What's the difference between alert() and alertcondition() in Pine?
alertcondition() is indicators-only and takes a constant string message — it registers a static alert template that the user wires up via the alert dialog. alert() works in indicators AND strategies, takes a series string (you can build the message dynamically with current bar values), and fires programmatically when the script's execution hits that line. alert() is the modern, more flexible API; alertcondition() is older but still supported. Almost all webhook automation built today uses alert() with JSON payloads.What does "Any alert() function call" mean in the dialog?
alert() calls, this option in the Condition dropdown creates a single alert that fires whenever any of those alert() lines execute. The frequency and message come from your Pine code (the freq argument and the message string), not from the dialog's frequency dropdown.How do I include indicator values in the alert message (placeholders)?
alertcondition(), embed placeholders in the message: {{ticker}}, {{close}}, {{plot_0}} through {{plot_19}}, {{plot("Name")}}. With alert(), build the message dynamically: alert("RSI is " + str.tostring(rsiValue) + " on " + syminfo.ticker). The dynamic version is more flexible and is what most webhook-bound alerts use.What are the standard alert message placeholders?
{{ticker}}, {{exchange}}, {{open}}, {{high}}, {{low}}, {{close}}, {{volume}}, {{time}} (UTC bar open), {{timenow}} (UTC alert fire time), {{interval}}, {{syminfo.currency}}, {{syminfo.basecurrency}}, {{plot_0}} through {{plot_19}}, and {{plot("Name")}} for plots referenced by title. Strategy scripts add a whole strategy.* placeholder family for order data.What are the strategy-specific placeholders for alerts?
{{strategy.position_size}}, {{strategy.order.action}} ("buy" or "sell"), {{strategy.order.contracts}}, {{strategy.order.price}}, {{strategy.order.id}}, {{strategy.order.comment}}, {{strategy.order.alert_message}}, {{strategy.market_position}} ("long"/"short"/"flat"), {{strategy.market_position_size}}, {{strategy.prev_market_position}}, {{strategy.prev_market_position_size}}. These are exactly what bridges like PickMyTrade consume to translate the alert into a broker order — see PickMyTrade's plot-placeholder docs for example JSON payloads.Can I get an alert when a stock first appears on a screener result?
Alerts (Webhooks & Automation)
20 answersWhat is a TradingView webhook in plain English?
Which TradingView plan do I need to use webhooks?
What does the JSON payload from a TradingView webhook look like?
Content-Type: application/json; otherwise it is sent as text/plain. So a typical PickMyTrade-compatible message field looks like {"action":"buy","symbol":"{{ticker}}","quantity":1,"price":{{close}}}. You design the schema yourself; the receiving bridge tells you what format to use.How do I send a custom JSON payload from a TradingView alert?
{{close}} and {{strategy.order.contracts}} go unquoted. String placeholders like {{ticker}} need double quotes around them. A working PickMyTrade payload: {"action":"{{strategy.order.action}}","symbol":"{{ticker}}","quantity":{{strategy.order.contracts}},"price":{{close}}}. PickMyTrade documents the full set of supported fields in its plot-placeholder docs at docs.pickmytrade.io.What are TradingView's webhook source IPs (for firewall whitelisting)?
Does TradingView support HTTP webhooks or HTTPS only?
Why does TradingView only allow port 80 and 443?
Does TradingView retry failed webhook deliveries?
Why did my webhook stop firing without any error?
What's the 3-second webhook timeout and why does it matter?
How much latency does a TradingView webhook actually have?
How do I test a TradingView webhook before going live?
How do I debug a webhook that's not arriving at my server?
How do I secure my TradingView webhook?
/webhook/abc123randomstring) that your receiver validates, plus IP allowlisting at the firewall layer to only accept connections from TradingView's four source IPs. PickMyTrade auto-generates and rotates a per-user webhook URL with the secret embedded, so you cannot accidentally leak a guessable URL.Does TradingView sign webhook payloads with HMAC or any signature?
X-Signature header, no HMAC, and no JWT. TradingView relies on SSL certificate verification (only over HTTPS) and the user-defined secret-in-URL pattern. Stripe and GitHub webhook devs migrating to TradingView find this surprising; the workaround is a strong random secret and IP allowlisting.Why is 2FA required for TradingView webhooks?
Can I send the same TradingView alert to multiple webhooks?
What third-party bridges connect TradingView webhooks to a broker?
PickMyTrade vs PineConnector vs TradersPost — which fits which trader?
Are TradingView webhooks reliable enough for live trading with real money?
Backtesting & Replay
20 answersWhat is Bar Replay and how do I turn it on?
How far back does Bar Replay go on each plan?
Why does Bar Replay say "Data point unavailable" on a 1-minute chart?
What are the keyboard shortcuts for Bar Replay?
Can I forward-test (paper trade) inside Bar Replay?
Bar Replay vs Strategy Tester — when do I use each?
How much historical data does the standard Strategy Tester use?
What is Deep Backtesting and how is it different?
Why are Deep Backtest results different on continuous futures vs a fixed contract?
Why does my TradingView backtest look great but lose money live?
request.security with lookahead_on leaks future data into history; non-standard chart types (Heikin Ashi, Renko) backtest at synthetic prices that do not exist; calc_on_every_tick diverges historical from live. The widely cited rule of thumb on r/algotrading is that live results land at roughly 60-70% of the backtest's net profit once you set realistic costs and run on standard candles. If you cannot stomach a 30-40% degradation, the strategy is not ready.How does TradingView simulate intrabar order fills?
What is Bar Magnifier mode and when should I enable it?
Does repainting affect my backtest results?
calc_on_every_tick=true "invalidates backtesting results" because historical bars run on close while realtime bars run on every tick — so the backtest equity curve and live behaviour diverge by design. Same trap with request.security using lookahead_on without an offset: historical bars see HTF closes before they would have been knowable, which is hindsight bias. Both make the backtest look better than reality. Audit any "great" backtest for these two flags before trusting it.How do I add commission and slippage to a TradingView backtest?
strategy("X", commission_type=strategy.commission.cash_per_contract, commission_value=1.5, slippage=2). Slippage applies only to market and stop orders — limit and stop-limit fills ignore it. The "verify price for limit orders" setting controls how aggressively limits fill (default 0 ticks means a touch fills; raise it for honesty).Does TradingView backtest non-standard charts (Heikin Ashi, Renko) accurately?
Can I do walk-forward analysis on TradingView?
Can I run Monte Carlo analysis on a TradingView strategy?
How does TradingView's paper trading account work?
How do I forward-test a TradingView strategy live without risking capital?
Can I backtest options strategies on TradingView?
Screener, Watchlist & Scanner
15 answersHow do I use the TradingView screener?
How do I save a custom screener setup?
How do I share my screener setup with someone else?
What is the Pine Screener and who can use it?
plot() or alertcondition(), calculations only run on the last 500 bars, and the script can have at most 5 request.* calls.Why won't my Pine script work in the Pine Screener?
request.* calls — Pine Screener caps it at 5 vs the 40 limit on a regular indicator. Your script has no plot() or alertcondition() output — Pine Screener needs something to show in the result column. Your script depends on more than 500 bars of history — Pine Screener only runs the last 500. Trim accordingly and it will load.How many symbols can I have in a TradingView watchlist?
How many watchlists can I create on each plan?
How do I import a CSV or text file into a watchlist?
NASDAQ:AAPL,NASDAQ:MSFT,NYSE:JPM, comma-separated. Section dividers are lines starting with ### (e.g. ###Tech). Without the exchange prefix the import either fails or maps to whatever default exchange TradingView guesses, which is rarely what you want.How do I export a watchlist to CSV?
How do I organize a watchlist with sections?
### (e.g. ###Crypto) and TradingView treats it as a divider on import.What are the colored flags on watchlist symbols?
Why isn't my watchlist syncing between desktop and mobile?
How do I scan only my watchlist with the screener?
How do I set up alerts on my entire watchlist?
How do I screen for premarket gainers and losers?
Drawing Tools & Annotations
12 answersHow do I draw a trendline that doesn't extend forever?
How do I draw a Fibonacci retracement correctly — low to high or high to low?
What's the difference between Fib retracement, Fib extension, and trend-based Fib extension?
How do I enable Magnet Mode so my drawings snap to OHLC?
How do I sync drawings across charts in a multi-chart layout?
Why do my drawings disappear or get deleted?
Are drawings saved to the chart, the symbol, or the layout?
How do I set an alert on a trendline or horizontal line?
How do I lock a drawing so I don't accidentally drag it?
How do I hide all drawings at once?
How do I save my drawing settings as the default?
How do I clone or copy a drawing to another timeframe?
Mobile & Desktop App
12 answersIs the TradingView desktop app different from the website?
Does TradingView Desktop support multiple monitors?
How do I sync watchlists, layouts, and drawings between phone, desktop, and browser?
Why am I not getting push notifications from TradingView on my phone?
Can I edit Pine Script on the TradingView mobile app?
Is the screener available on the TradingView mobile app?
Does TradingView have an iOS lock-screen widget or Apple Watch app?
How do I place a trade order from the mobile app?
Does TradingView Desktop run on Mac and Linux?
Why is the TradingView mobile app slow or freezing?
Are mobile alerts fast enough for scalping?
How do I link tabs across multiple monitors on the desktop app?
Data, Symbols & Exchanges
18 answersWhy is my TradingView futures data delayed by 10 minutes?
How much does real-time CME futures data cost on TradingView?
What's the difference between professional and non-professional data subscriptions?
Is US stock market data really free on TradingView?
What does ES1! mean — is it a real contract I can trade?
ES1! continuous vs ESM2025 specific contract — which should I chart?
When does TradingView actually roll the front-month contract on ES1!?
What is back-adjustment on continuous futures and how do I turn it on?
Why do EURUSD prices look different on FXCM vs OANDA vs ICE on TradingView?
What's the syntax for typing a TradingView symbol — NASDAQ:AAPL or just AAPL?
EXCHANGE:SYMBOL — NASDAQ:AAPL, BINANCE:BTCUSDT, CME_MINI:ES1!, CRYPTO:BTCUSD (aggregated). Typing just "AAPL" works because TradingView auto-routes to a default exchange (often BATS or BZX for US stocks), but the prefix gives you the exact data source. In Pine Script, syminfo.prefix returns the exchange and syminfo.ticker returns the symbol portion.Why can't I find my symbol in the TradingView search box?
EXCHANGE:SYMBOL and hit Enter. Third: the symbol may genuinely not be on TradingView — small foreign exchanges, niche OTC tickers, and crypto pools below liquidity thresholds get excluded.How do I create a spread or ratio chart (e.g. GLD/SLV)?
AAPL/GOOGL, SPY-QQQ, (AAPL+MSFT+GOOGL)/3. Constants are allowed (MSFT+50). Operators supported: +, −, *, /. Hard limit: 10 unique symbols per expression. Hit Enter and TradingView treats the whole expression as a chartable instrument, which you can then save to a watchlist.Can I see pre-market and after-hours data on TradingView for free?
How do I adjust TradingView charts for splits and dividends?
How far back does intraday (1-minute) data go on TradingView?
Why does the same crypto pair show different historical depth on different exchanges?
CRYPTO:BTCUSD symbol — TradingView blends data from multiple venues to produce the longest possible series.Why is the data on my broker's TradingView panel still delayed?
Why does the same crypto pair show different volume across exchanges?
CRYPTO: prefix sums volume across venues. For US stocks, the same effect is smaller but real — BATS/BZX volume is a fraction of NYSE+NASDAQ consolidated volume, which is why CBOE BZX charts can look "thin" relative to a TotalView feed.Performance, Bugs & Troubleshooting
18 answersWhy is TradingView so slow / laggy?
Why does TradingView lag specifically at US market open?
How do I fix TradingView running slow on Chrome / Firefox / Safari?
Why does TradingView use so much CPU and RAM?
Why is my TradingView chart blank or not loading?
What does "Internal Server Error" mean on TradingView?
How do I fix the desktop app stuck on the loading screen?
My ad blocker is breaking TradingView — how do I whitelist it?
I'm locked out of TradingView and 2FA isn't working — how do I get back in?
Why isn't TradingView sending my password reset email?
My TradingView payment failed but I was still charged — what now?
What does "Maximum number of studies per chart has been reached" mean?
What does "Study/strategy code is too complex" mean?
[] history references on many series, growing arrays/maps that never trim, more than 40 request.security calls, or thousands of drawing objects. Fixes in order of impact: explicitly set max_bars_back=500, trim arrays, cache request.security results in var variables, raise max_lines_count/max_labels_count/max_boxes_count, and as a last resort use calc_bars_count to limit historical execution.Why does the TradingView mobile app keep crashing or freezing?
Why are my drawings disappearing across devices?
Why is TradingView showing the wrong time zone?
hour, minute, and dayofweek always run in the exchange's time zone regardless of your chart display. Edge cases like daily timestamps showing off-by-one can happen near DST transitions; the chart fixes itself a day later.