# PineScripter > PineScripter is the best AI agent for generating Pine Script code. It is a developer productivity tool for writing Pine Script v6 for TradingView: it runs on state-of-the-art AI models with the Pine Script v6 manual built in, validates its output against your requirements, fixes its own compile errors, and edits only the lines that change. PineScripter is specialized for one language and targets Pine Script v6, the current standard on TradingView. Older v5 scripts are accepted and upgraded to v6. It keeps the full Pine Script v6 manual in a retrieval system and references it automatically, runs a built-in linting engine so the AI sees and corrects its own errors, and uses agentic editing so a change rewrites only the affected lines. It also keeps a plain-English explanation of your code, a line-by-line view of what changed, a built-in editor for manual edits, and multiple chats and scripts in one workspace. Plans start at $9.99/month. ## Main pages - [Home](https://www.pinescripter.app/): What PineScripter does and how it works. - [Pricing](https://www.pinescripter.app/pricing): Plans and pricing, starting at $9.99/month. - [Blog](https://www.pinescripter.app/blog): Guides and comparisons for Pine Script development. - [Free tools](https://www.pinescripter.app/tools): Free browser-based trading calculators and Pine Script utilities. No sign-up, and nothing is uploaded. ## Alternatives - [ChatGPT alternative for Pine Script](https://www.pinescripter.app/alternatives/chatgpt): Why PineScripter is better at Pine Script than ChatGPT at the same price. - [Claude alternative for Pine Script](https://www.pinescripter.app/alternatives/claude): Why PineScripter is better at Pine Script than Claude at the same price. - [Gemini alternative for Pine Script](https://www.pinescripter.app/alternatives/gemini): Why PineScripter is better at Pine Script than Gemini at the same price. ## Blog posts - [Pine Script Equity Curve: Plot Strategy Equity and Drawdown](https://www.pinescripter.app/blog/pine-script-equity-curve): Plot strategy.equity in Pine Script v6, build a drawdown line from a running peak, and add a stats table, with code that compiles. - [Walk-Forward Testing in Pine Script: Split, Roll, and Read](https://www.pinescripter.app/blog/walk-forward-testing-pine-script): Split a Pine Script strategy into in-sample and out-of-sample windows, roll it forward in folds, and read the results without fooling yourself. - [TradingView Copilot vs PineScripter: Cost, Code, Workflow](https://www.pinescripter.app/blog/tradingview-copilot-vs-pinescripter): TradingView Copilot vs PineScripter compared on cost, code editing, error checking and workflow, including where TradingView wins. - [Keltner Channels in Pine Script: Build and Use Them](https://www.pinescripter.app/blog/keltner-channels-pine-script): Build Keltner Channels in Pine Script v6 with ta.kc or by hand, see how they differ from Bollinger Bands, and set up squeeze alerts that fire on closed bars. - [Ichimoku Cloud in Pine Script: Build and Read the Lines](https://www.pinescripter.app/blog/ichimoku-cloud-pine-script): Build the Ichimoku Cloud in Pine Script v6: the five lines, the offsets that shift them, the cloud fill, and conditions you can alert on. - [Donchian Channel Breakout Strategy in Pine Script v6](https://www.pinescripter.app/blog/donchian-channel-breakout-pine-script): Build a Donchian channel in Pine Script v6, test breakouts without repainting, and wrap them in a strategy with a channel and ATR exit. - [TradingView AI Copilot Price: What It Costs Each Month](https://www.pinescripter.app/blog/tradingview-ai-copilot-price): TradingView's AI Copilot add-on sits on top of a paid plan. See the real monthly total, which prices are only reported, and how it compares. - [Pine Script Input Types: Every input.* Function Explained](https://www.pinescripter.app/blog/pine-script-input-types): Learn every Pine Script v6 input.* function, from input.int to input.enum, with grouping, layout, and the errors that break a settings dialog. - [TradingView Copilot Pine Script Not Working: How to Fix It](https://www.pinescripter.app/blog/tradingview-copilot-pine-script-not-working): TradingView's AI Copilot wrote a script that compiles but never triggers or repaints? Sort the failure into three bins and fix each with a small change. - [Pine Script Functions: Writing and Reusing Your Own](https://www.pinescripter.app/blog/pine-script-functions): Learn to write user-defined functions in Pine Script v6: syntax, typed parameters, tuple returns, and the every-bar rule that keeps results correct. - [Pine Script Color Gradients: Show Strength, Skip Plots](https://www.pinescripter.app/blog/pine-script-color-gradient): Use color.from_gradient in Pine Script v6 to show indicator strength on lines, candles, backgrounds and fills without adding more plots. - [Fix a Complex Pine Script Indicator Without Breaking It](https://www.pinescripter.app/blog/fix-complex-pine-script-indicator): A step-by-step method for fixing a half-working Pine Script indicator one change at a time, with a parity check that proves what stayed the same. - [Understand and Verify a Pine Script Indicator With AI](https://www.pinescripter.app/blog/understand-verify-pine-script-indicator): A step-by-step workflow to check what a Pine Script indicator really measures: plain-English reading, debug plots, na checks, and trigger counts. - [Pine Script Multi-Symbol Scanner: Build One Step by Step](https://www.pinescripter.app/blog/pine-script-multi-symbol-scanner): Build a Pine Script v6 multi-symbol scanner: one request per symbol, no repainting, a ranked table, and a single alert for the whole watchlist. - [Volume Profile Indicator in Pine Script: Build It With AI](https://www.pinescripter.app/blog/volume-profile-indicator-pine-script): Build a volume profile indicator in Pine Script v6 with arrays, loops, and boxes, add a value area, and learn how to prompt an AI for it. - [Supply and Demand Zone Pine Script: A Step-by-Step v6 Build](https://www.pinescripter.app/blog/supply-demand-zone-pine-script): Build a supply and demand zone indicator in Pine Script v6 with pivots, ATR-sized boxes, zone invalidation, a box cap and a first-touch alert. - [Add Alerts to a Complex Pine Script Indicator Safely](https://www.pinescripter.app/blog/add-alerts-complex-pine-script-indicator): Add multi-condition alerts to a working Pine Script indicator without changing what it draws, with cooldowns, bar-close gating, and a sequence pattern. - [How to Describe a Complex Indicator So the AI Gets It Right the First Time](https://www.pinescripter.app/blog/how-to-prompt-pine-script-ai): The difference between getting working code in one try and iterating for hours often comes down to how you describe what you want. Here is the framework for writing Pine Script prompts that produce accurate results immediately. - [How to Debug Pine Script When There Is No Error Message](https://www.pinescripter.app/blog/pine-script-debug-visual): Your indicator compiles cleanly but produces wrong results. The code runs, plots appear, and there are no error messages. The problem is somewhere in your logic. Here is how to find it using visual debugging techniques. - [How to Fetch Data From Another Symbol in Pine Script](https://www.pinescripter.app/blog/pine-script-fetch-another-symbol): Correlations, spreads, and relative value analysis require data from multiple symbols. Here is exactly how request.security fetches data from different instruments and the patterns that make it work reliably. - [calc_on_every_tick in Pine Script: What It Changes in Your Backtest](https://www.pinescripter.app/blog/calc-on-every-tick): One parameter quietly changes hundreds of fill prices in your backtest. Understanding calc_on_every_tick is essential because it makes the difference between a realistic simulation and one that looks far better than live trading will ever deliver. - [How Pine Script Handles na: Silent Propagation and How to Stop It](https://www.pinescripter.app/blog/pine-script-na-values): The na value in Pine Script spreads through calculations like a virus. Once it enters, it silently contaminates every dependent result. Here is exactly how it spreads and the patterns that contain it. - [Pine Script Table Objects: Building a Stats Dashboard on Your Chart](https://www.pinescripter.app/blog/pine-script-table-dashboard): Your strategy runs in the Strategy Tester, but the numbers are hidden in a panel you cannot see while trading. Tables let you display live metrics directly on the chart, exactly where you need them. - [Pine Script Drawing Objects: Lines, Boxes, and Labels That Do Not Hit the Limit](https://www.pinescripter.app/blog/pine-script-drawing-objects): Your indicator draws beautifully for the first 200 bars, then everything disappears. Understanding the drawing limits and the patterns that stay within them is essential for any visual indicator. - [The Lookback Bias Problem: Why Indicators Look Perfect in Hindsight](https://www.pinescripter.app/blog/lookback-bias-indicator): Your indicator works flawlessly on historical charts. Then you go live and everything falls apart. The reason is not your logic. It is what your code can see that the market never revealed in advance. - [How Slippage and Commission Actually Eat Your Returns](https://www.pinescripter.app/blog/slippage-commission-backtest): Your backtest shows a 40% return. Live trading produces 8%. The difference is not your strategy. It is the gap between ideal fills and what the market actually delivers. - [Maximum Drawdown: How to Measure Risk in a Backtest](https://www.pinescripter.app/blog/max-drawdown-backtest): Net profit tells you what a strategy made. Max drawdown tells you whether you could have stayed in it long enough to find out. Here is exactly how it is measured, and where TradingView’s default number understates it. - [ta.pivothigh and ta.pivotlow: Why Your Pivot Signals Arrive Late](https://www.pinescripter.app/blog/pine-script-pivot-high-low): Every pivot-based indicator has a built-in delay that looks like a bug the first time you see it. Here is exactly why the delay exists, how the two parameters control it, and the placement mistake that draws it in the wrong spot. - [How request.security Works in Pine Script (And Why Most Indicators Get It Wrong)](https://www.pinescripter.app/blog/how-request-security-works-pine-script): request.security is the most powerful and most misused function in Pine Script. Here is a precise account of what it fetches, when it evaluates, and the one pattern that prevents repainting. - [Building an Order Block Indicator in Pine Script](https://www.pinescripter.app/blog/order-block-indicator-pine-script): Order blocks are specific price bars where institutional orders caused a sharp move away. Here is a precise structural definition and a complete Pine Script v6 build using boxes and pivot detection. - [Pine Script Lookahead: The Setting That Makes Indicators Lie](https://www.pinescripter.app/blog/pine-script-lookahead-explained): barmerge.lookahead_on is a single parameter that can make a multi-timeframe indicator look perfect in backtests and fail immediately live. Here is exactly what it does and why it is almost always wrong. - [Why Your Pine Script Alert Fires on the Wrong Bar](https://www.pinescripter.app/blog/pine-script-alert-wrong-bar): alertcondition fires on every tick the condition is true, including mid-bar ticks on the live candle. Here is the confirmed-bar pattern that makes alerts fire exactly once, at the close. - [Pine Script v6 Lazy Evaluation: The and/or Trap That Breaks Indicators](https://www.pinescripter.app/blog/pine-script-and-or-lazy-evaluation): In Pine Script v6, the and and or operators short-circuit. Any ta.* function on the skipped side stops updating its history. Here is what breaks, why, and the one-line fix. - [Expectancy: The Only Number That Predicts Long-Term Trading Results](https://www.pinescripter.app/blog/trading-expectancy-explained): Win rate and average profit tell you different halves of the story. Expectancy combines them into the single figure that determines whether a strategy makes money over time. - [barstate.isconfirmed in Pine Script: Signals That Stop Repainting](https://www.pinescripter.app/blog/pine-script-barstate-isconfirmed): Signals that appear on unclosed bars and then disappear are one of the most common Pine Script frustrations. barstate.isconfirmed is the one-line fix — here is exactly how it works. - [How to Build a Divergence Detector in Pine Script (Non-Repainting)](https://www.pinescripter.app/blog/build-divergence-detector-pine-script): RSI and MACD divergence detection requires confirmed pivot highs and lows, which means the signal always arrives a few bars late — and must. Here is the complete build in Pine Script v6. - [From Indicator to Backtestable Strategy in Pine Script](https://www.pinescripter.app/blog/indicator-to-strategy-pine-script): An indicator marks signals. A strategy acts on them and tracks the results. Converting one to the other is a small code change with a big payoff — here is the complete workflow. - [Profit Factor Explained: What It Reveals and When to Ignore It](https://www.pinescripter.app/blog/profit-factor-explained): Profit factor above 1.0 means more money came in than went out. But a profit factor of 3.0 on 8 trades and 1.4 on 300 trades are not the same thing. Here is how to read it correctly. - [Win Rate Is a Trap: What Your Strategy Statistics Actually Tell You](https://www.pinescripter.app/blog/win-rate-is-a-trap): A 70% win rate can be a losing strategy. A 35% win rate can be highly profitable. Here is the math that explains why, and the numbers that actually predict long-term results. - [Building a Multi-Timeframe Indicator That Does Not Repaint](https://www.pinescripter.app/blog/build-multi-timeframe-indicator-pine-script): The most common way to add higher-timeframe context to a Pine Script indicator repaints. Here is the confirmed-bar pattern that fixes it, built step by step in Pine Script v6. - [Pine Script Strategy Tester: Every Metric Explained](https://www.pinescripter.app/blog/pine-script-strategy-tester-metrics): Most traders glance at net profit and move on. Here is what each Strategy Tester metric actually measures, when each one misleads, and how to read the full picture honestly. - [Pine Script max_bars_back Error: Causes and Fixes](https://www.pinescripter.app/blog/pine-script-max-bars-back): Why Pine cannot determine the referencing length of a series, how history buffers are sized from your code, and the three ways to fix it without guessing at numbers. - [Pine Script: End of Line Without Line Continuation](https://www.pinescripter.app/blog/pine-script-end-of-line-without-continuation): Pine uses indentation as part of its grammar. Learn exactly which whitespace rules produce this error, why pasted code triggers it, and how to fix it in one edit. - [Pine Script Label and Line Limits: Fixing the 500 Cap](https://www.pinescripter.app/blog/pine-script-max-drawings-limit): Why your labels and lines silently disappear from the chart, how max_labels_count and max_lines_count actually work, and how to draw only what you need. - [Stop Loss and Take Profit in Pine Script: A Full Guide](https://www.pinescripter.app/blog/pine-script-stop-loss-take-profit): How strategy.exit() actually works, the difference between stop, limit, loss and profit parameters, and why exits fire on the bar you did not expect. - [Trailing Stops in Pine Script: How to Code Them Right](https://www.pinescripter.app/blog/pine-script-trailing-stop): trail_points and trail_offset are measured in ticks, not price, which is why most trailing stops behave nothing like intended. Here is the full mechanism. - [Pine Script Session and Time Filters Without Bugs](https://www.pinescripter.app/blog/pine-script-session-time-filter): Session strings run in exchange time, not yours. How to build a trading-hours filter that holds up across symbols, timezones, and daylight saving changes. - [Order Blocks in Pine Script: What They Are and How to Code](https://www.pinescripter.app/blog/order-blocks-pine-script): What an order block actually is structurally, why marketed indicators disagree about it, and how to detect and draw one in Pine Script v6 without repainting. - [RSI Divergence in Pine Script: Detecting It Correctly](https://www.pinescripter.app/blog/rsi-divergence-pine-script): Divergence detection needs confirmed pivots, and confirmed pivots arrive late. How to code RSI divergence in Pine Script v6 and be honest about the lag. - [Why Backtest Results Differ From Live Trading](https://www.pinescripter.app/blog/why-backtest-results-differ-from-live): Fill assumptions, intrabar order, commission, slippage, and repainting each move the number. Here is what TradingView models, what it does not, and how to narrow the gap. - [TradingView Indicator Limits: How Many You Can Add](https://www.pinescripter.app/blog/tradingview-indicator-limits-per-chart): How many indicators each TradingView plan allows per chart, which Pine Script limits apply on top of that, and what to do when you hit either one. - [RSI Strategy in Pine Script: A Step-by-Step Guide](https://www.pinescripter.app/blog/rsi-strategy-pine-script): What the Relative Strength Index actually measures, why traders lean on it, and how to build an RSI indicator and a backtestable strategy in Pine Script v6, plus a trend filter and the honest pitfalls. - [MACD Strategy in Pine Script: A Step-by-Step Guide](https://www.pinescripter.app/blog/macd-strategy-pine-script): What the MACD line, signal line, and histogram each tell you, why the indicator is so popular, and how to build a MACD indicator and strategy in Pine Script v6 with ta.macd(). - [Bollinger Bands in Pine Script: A Complete Guide](https://www.pinescripter.app/blog/bollinger-bands-pine-script): What Bollinger Bands measure, why volatility bands adapt to each market, and how to build the indicator and two classic strategies, mean reversion and the squeeze breakout, in Pine Script v6. - [VWAP in Pine Script: The Volume-Weighted Guide](https://www.pinescripter.app/blog/vwap-pine-script): What VWAP measures, why intraday traders anchor to the volume-weighted average price, and how to build it with session anchoring and deviation bands in Pine Script v6 using ta.vwap(). - [Supertrend in Pine Script: How to Build and Use It](https://www.pinescripter.app/blog/supertrend-pine-script): What the Supertrend indicator does, why its ATR-based bands adapt to volatility, and how to build it and a strategy in Pine Script v6 with ta.supertrend() and line-break plotting. - [Stochastic Oscillator in Pine Script: A Complete Guide](https://www.pinescripter.app/blog/stochastic-pine-script): What the stochastic oscillator measures, why %K and %D are read together, and how to build the indicator and a strategy in Pine Script v6, plus the fast, slow, and full variants explained. - [ATR in Pine Script: Measuring Volatility in Code](https://www.pinescripter.app/blog/atr-pine-script): What the Average True Range measures, why it is the backbone of volatility-aware stops and position sizing, and how to build and use it in Pine Script v6 with ta.atr(). - [ADX in Pine Script: Measuring Trend Strength](https://www.pinescripter.app/blog/adx-pine-script): What the Average Directional Index measures, why it answers a different question than most indicators, and how to build it with +DI and -DI as a trend filter in Pine Script v6 using ta.dmi(). - [On-Balance Volume in Pine Script: A Volume Guide](https://www.pinescripter.app/blog/obv-pine-script): What On-Balance Volume measures, why volume-based confirmation and divergence matter, and how to build the OBV indicator and a volume-confirmed strategy in Pine Script v6 with ta.obv. - [Money Flow Index in Pine Script: Volume-Weighted Momentum](https://www.pinescripter.app/blog/mfi-pine-script): What the Money Flow Index measures, why it is called the volume-weighted RSI, and how to build the indicator and a strategy in Pine Script v6 with ta.mfi(), plus when to prefer it over the RSI. - [PineScripter vs ChatGPT and Claude: Better Pine Script, Lower Cost](https://www.pinescripter.app/blog/pinescripter-vs-chatgpt-claude): General assistants were not built for Pine Script and are expensive to run. Here is how a Pine-tuned model wrapped in a compile-checking agent produces code that compiles more often, for a fraction of the token cost. - [Pine Script Runtime Errors: Why It Fails on the Chart](https://www.pinescripter.app/blog/pine-script-runtime-errors): A runtime error happens while a script executes on bars, after it compiled. Learn how to read the message and bar index, and fix historical buffer, memory, drawing-limit, and invalid-argument failures. - [Why Your Pine Script Strategy Isn't Taking Trades](https://www.pinescripter.app/blog/pine-script-strategy-not-taking-trades): The script compiles and the trade list is empty. Check the five causes in order: the condition never fires, order size versus capital, unreachable order calls, v6 margin defaults, and the removed when parameter. - [What the Pine Script v6 Converter Fixes and What It Misses](https://www.pinescripter.app/blog/pine-script-v6-converter): The Pine Editor converts v5 to v6 automatically, but only handles mechanical syntax. Learn what it cannot decide for you: boolean na states, strategy.exit parameter pairs, margin defaults, and dynamic requests. - [ThinkScript to Pine Script: A Practical Conversion Guide](https://www.pinescripter.app/blog/thinkscript-to-pine-script): No official converter exists between thinkorswim and TradingView. Here is the concept mapping, the persistent-state pattern, and why thinkScript negative offsets cannot be translated to Pine at all. - [Position Size in Pine Script: How to Code Your Risk Rules](https://www.pinescripter.app/blog/pine-script-position-size): Pine Script offers fixed, cash, and percent-of-equity order sizing plus per-order quantity. Learn how each behaves and how to derive quantity from a stop distance without dividing by na. - [Cursor and Copilot for Pine Script: Where They Fall Short](https://www.pinescripter.app/blog/cursor-copilot-pine-script): Cursor and Copilot can edit Pine Script but cannot compile it, because Pine only runs on TradingView. Here is why that breaks their feedback loop and how to work around it. - [ChatGPT vs Claude vs Gemini for Pine Script Compared](https://www.pinescripter.app/blog/chatgpt-claude-gemini-pine-script): Three general assistants priced within a dollar of each other, judged on one job: producing Pine Script that compiles and stays maintainable across several iterations. - [How to Check AI-Generated Pine Script Before You Use It](https://www.pinescripter.app/blog/verify-ai-generated-pine-script): Compiling is the first test, not the last. A seven-pass review that catches version drift, conditions that never fire, repainting, strategy-default surprises, and runtime errors. - [TrendSpider vs PineScripter: No-Code or Code You Own](https://www.pinescripter.app/blog/trendspider-vs-pinescripter): These sit in different categories. One is an automation-first analysis platform, the other is a Pine Script coding workspace that leaves you with exportable source. - [Buying TradingView Indicators vs Coding Your Own](https://www.pinescripter.app/blog/buy-vs-code-tradingview-indicators): TradingView protected and invite-only scripts hide their source from users by design. That documented fact decides more than price does when choosing between buying and building. - ["Undeclared Identifier" in Pine Script: Cause and Fix](https://www.pinescripter.app/blog/pine-script-undeclared-identifier): The "undeclared identifier" error is usually a missing namespace, typo, scope issue, or declaration-order problem. Learn the exact debugging process and the smallest safe fix. - ["Could Not Find Function" in Pine Script: Fix It](https://www.pinescripter.app/blog/pine-script-could-not-find-function): Pine Script cannot find a function when its namespace, version, or signature does not match. Learn how to resolve the exact call without replacing your full script. - ["Mismatched Input" Error in Pine Script: Fix It](https://www.pinescripter.app/blog/pine-script-mismatched-input): A mismatched input error often points after the real problem. Find the missing parenthesis, comma, quote, or indentation issue and make the smallest correct repair. - ["Cannot Use plot in Local Scope" in Pine Script](https://www.pinescripter.app/blog/pine-script-plot-local-scope): Pine Script plots must be declared in global scope. Learn the correct conditional-plot pattern with na values instead of placing plot calls inside if blocks. - ["Script Requesting Too Many Securities" in Pine Script](https://www.pinescripter.app/blog/pine-script-too-many-securities): Your script has exceeded Pine Script data-request limits. Learn how unique request contexts are counted and how tuple requests reduce unnecessary duplication. - [Pine Script v6 Errors After Upgrading: How to Fix Them](https://www.pinescripter.app/blog/pine-script-v6-upgrade-errors): Fix the common Pine Script v5-to-v6 migration failures, including strict booleans, removed strategy parameters, changed defaults, dynamic requests, and visual syntax. - [Free AI Pine Script Generator: What You Actually Get](https://www.pinescripter.app/blog/free-ai-pine-script-generator): A free generator is useful only if it helps beyond the first draft. Compare compile-error recovery, surgical editing, code ownership, and workspace maintenance. - [Can AI Write Pine Script? An Honest Look at What Works](https://www.pinescripter.app/blog/can-ai-write-pine-script): AI can accelerate Pine Script drafts and explanations. Learn where it helps, why compile feedback matters, and how a focused editing workflow avoids manual error handoffs. - [How to Prompt ChatGPT for Pine Script, and Why It Still Breaks](https://www.pinescripter.app/blog/chatgpt-pine-script-prompts): Use clearer Pine Script prompts and understand the limits of a general chat workflow: compiler handoffs, full-script regenerations, and difficult code review. - [Best AI for TradingView: Tools for Writing Pine Script Faster](https://www.pinescripter.app/blog/best-ai-for-tradingview): The best AI for TradingView coding depends on the task. Compare a dedicated Pine Script workspace with general AI assistants for writing, compiling, and maintaining code. - [How Pine Script's Execution Model Actually Works](https://www.pinescripter.app/blog/pine-script-execution-model): Pine Script runs your code once per bar, not once total. Understand the series-of-values model, historical vs realtime bars, the [] history operator, and why your variables seem to reset every bar. - [The Pine Script Type System: Series vs Simple vs Const](https://www.pinescripter.app/blog/pine-script-type-system): The "cannot call with arguments of type series" error comes from Pine Script's type-qualifier hierarchy. Here is how const, input, simple, and series interact with function parameters, and how v6 tightened the rules. - [var, varip, and Persistent State in Pine Script](https://www.pinescripter.app/blog/pine-script-var-varip): A complete guide to persistent state in Pine Script: how var initializes once, how varip behaves differently on realtime bars, and how to build counters and arrays that survive across bars. - [Arrays, Matrices, and Maps in Pine Script](https://www.pinescripter.app/blog/pine-script-arrays-matrices-maps): Pine Script has three collection types: arrays, matrices, and maps. Here is when to reach for each, the object-count limits that trip people up, and the performance tradeoffs to keep in mind. - [Everything New in Pine Script v6, Ranked by What Matters](https://www.pinescripter.app/blog/pine-script-v6-whats-new): Pine Script v6 launched in November 2024 with dynamic requests, strict booleans, enums, runtime logging, and unlimited backtesting. Here is what actually changes how you write code, ranked by impact. - [Dynamic Requests in Pine Script v6: Multi-Symbol Scanners](https://www.pinescripter.app/blog/pine-script-dynamic-requests): Pine Script v6 lets you pass series arguments to request.security, so you can scan a watchlist inside a loop. Here is how to build scanners that were impossible in v5, plus the memory limits behind the RE10139 error. - [Runtime Logging in Pine Script: Debugging with log.info](https://www.pinescripter.app/blog/pine-script-runtime-logging): Before v6, debugging Pine Script meant plotting values and squinting. Now log.info, log.warning, and log.error send timestamped messages to the Pine Logs pane. Here is how to actually debug with them. - [Enums in Pine Script v6: Cleaner State Machines and Inputs](https://www.pinescripter.app/blog/pine-script-enums): Enums arrived in Pine Script v6. They make state machines readable, give you type-safe dropdown inputs, and eliminate the magic strings that used to break silently. Here is how and when to use them. - [What Pine Script Can and Cannot Do: An Honest Map](https://www.pinescripter.app/blog/what-pine-script-can-and-cannot-do): Before you commit to Pine Script, know its edges: the 500ms loop limit, drawing-object caps, no outbound HTTP, no file I/O, and the sandbox. An honest map of what the language can and cannot do. - [Can Pine Script Connect to an API, Broker, or Webhook?](https://www.pinescripter.app/blog/pine-script-api-broker-webhook): Pine Script cannot make outbound API calls, but it can fire alerts that hit a webhook, which an external service can turn into broker orders. Here is exactly what is possible and where the line is. - [Why Your Pine Script Is Slow and How to Fix It](https://www.pinescripter.app/blog/why-pine-script-is-slow): Loop timeouts and laggy charts usually trace to a few culprits: redundant request.security calls, expensive loops, and drawing-object churn. Here is how to profile Pine Script and fix the slow parts. - [Multi-Timeframe Analysis in Pine Script Without Repainting](https://www.pinescripter.app/blog/multi-timeframe-pine-script-without-repainting): Higher-timeframe data is one of the most misused features in Pine Script. Here is the definitive guide to request.security with lookahead, the confirmed-bar pattern, and code that does not repaint. - [Repainting Explained: The Five Kinds and How to Prevent Each](https://www.pinescripter.app/blog/pine-script-repainting-explained): Repainting is not one bug, it is five. Higher-timeframe leak, realtime fluctuation, future leak via lookahead, security misuse, and drawing repaint. Here is how to spot and prevent each kind. - [Pine Script vs Python for Algorithmic Trading](https://www.pinescripter.app/blog/pine-script-vs-python): An honest, technical comparison of Pine Script and Python for algorithmic trading. Where Pine wins (chart-native, zero setup, alerts) and where Python wins (data access, machine learning, live execution). - [Pine Script vs Backtrader: Chart-Native or Python Control?](https://www.pinescripter.app/blog/pine-script-vs-backtrader): Backtrader gives you event-driven realism and live-trading hooks in Python. Pine Script gives you speed and chart-native visualization. An honest comparison of the tradeoffs. - [Pine Script vs VectorBT: Vectorized Speed vs Simplicity](https://www.pinescripter.app/blog/pine-script-vs-vectorbt): VectorBT runs thousands of vectorized backtests in seconds using NumPy and Numba. Pine Script runs one strategy, live, on your chart. An honest comparison of speed, accuracy, and the learning curve. - [Pine Script vs Backtesting.py: The Simplest Way to Test](https://www.pinescripter.app/blog/pine-script-vs-backtesting-py): Backtesting.py is the friendliest Python backtesting framework. Pine Script is the friendliest chart-native one. An honest comparison for traders deciding where to test their first strategy. - [Pine Script vs MQL5 (MetaTrader): Two Worlds of Algo Trading](https://www.pinescripter.app/blog/pine-script-vs-mql5): MQL5 powers MetaTrader with full automation and a marketplace. Pine Script powers TradingView with fast, visual scripting. An honest comparison of language design, execution, and ecosystem. - [Pine Script vs ThinkScript vs EasyLanguage](https://www.pinescripter.app/blog/pine-script-vs-thinkscript-vs-easylanguage): Three charting-platform scripting languages compared: Pine Script on TradingView, ThinkScript on thinkorswim, and EasyLanguage on TradeStation. Language design, capabilities, and who each suits. - [Why TradingView Built Its Own Language](https://www.pinescripter.app/blog/why-tradingview-built-pine-script): TradingView could have used Python or JavaScript. Instead it built Pine Script. Here is why: the sandbox, determinism, safety at scale, and the series-of-values model that makes chart scripting natural. - [Building a Repaint-Free Alert System in Pine Script](https://www.pinescripter.app/blog/pine-script-alerts-guide): alertcondition, alert(), and strategy alerts do different things. Here is how each works, how to fire alerts only on confirmed bars, and how to format webhook JSON for external execution. - [How TradingView Backtesting Actually Works](https://www.pinescripter.app/blog/how-tradingview-backtesting-works): The Strategy Tester is easy to trust too much. Here is how bar-close fills, intrabar assumptions, calc_on_every_tick, slippage, commission, and lookahead really work, and where the numbers mislead you. - [Writing Reusable Pine Script Libraries](https://www.pinescripter.app/blog/pine-script-libraries): Pine Script libraries let you export functions once and import them across scripts. Here is how library(), export, and versioning work, and how to structure code you can reuse. - [Custom Types and Objects in Pine Script (UDTs)](https://www.pinescripter.app/blog/pine-script-custom-types-udt): User-defined types let you model data cleanly in Pine Script instead of juggling parallel arrays. Here is how to define types, build arrays of objects, and pair them with maps for readable code. - [How to Turn a Trading Idea into Testable Pine Script](https://www.pinescripter.app/blog/trading-idea-to-pine-script): A trading idea becomes testable Pine Script only after you turn it into concrete rules for entry, exit, filters, and sizing. Here is the process, from vague idea to a hypothesis to working v6 code. - [Moving Average Crossover in Pine Script: A Complete Guide](https://www.pinescripter.app/blog/moving-average-crossover-pine-script): Build a moving average crossover in Pine Script v6 from scratch: first as an indicator, then a backtestable strategy, with a trend filter, SMA vs EMA, and the lag and whipsaw pitfalls explained. - [How PineScripter Keeps Your Pine Script Strategy Private](https://www.pinescripter.app/blog/pine-script-privacy): Your strategy logic is your edge. An honest look at where your Pine Script gets exposed across freelancers, indicator suites, and public libraries, and what a private coding tool can and cannot promise. - [What It Costs to Get a Pine Script Indicator Built](https://www.pinescripter.app/blog/cost-to-build-pine-script-indicator): The real Pine Script indicator cost by route: freelancer, hourly developer, doing it yourself, or an AI tool. Honest price ranges plus the hidden costs of waiting, revisions, and privacy. - [Is PineScripter Worth It? An Honest Review for 2026](https://www.pinescripter.app/blog/is-pinescripter-worth-it): An honest look at whether PineScripter is worth it: who should not pay for it, who gets the most value, the simple time-and-cost math, and how to decide in five minutes with the free tier. - [Pineify vs PineScripter: No-Code Builder or Custom Code?](https://www.pinescripter.app/blog/pineify-vs-pinescripter): Pineify is a capable no-code Pine Script builder that exports real v6 code. PineScripter writes custom code from a description. An honest Pineify alternative comparison for when your idea outgrows the blocks. - [Pinegen vs PineScripter: Generator or Full Workspace?](https://www.pinescripter.app/blog/pinegen-vs-pinescripter): Pinegen is a capable Pine Script generator. PineScripter is a full coding workspace with a self-fixing error loop and surgical edits. An honest comparison for when you need more than a first draft. - [Pine Script v5 to v6: What Changed and How to Migrate](https://www.pinescripter.app/blog/pine-script-v5-to-v6-migration): Migrating from Pine Script v5 to v6 is mostly a handful of predictable changes. Here's what actually changed, grouped by category, with the exact fix for each and the silent behavior changes to watch. - [Best AI Pine Script Generators in 2026: An Honest Guide](https://www.pinescripter.app/blog/best-ai-pine-script-generator): Searching for an AI Pine Script generator? An honest 2026 roundup of ChatGPT, Pinegen, Pineify, LuxAlgo Quant, and PineScripter, judged on what compiles, what you can edit, and what you actually own. - [Pine Script Won't Compile? Common Errors and How to Fix Them](https://www.pinescripter.app/blog/pine-script-wont-compile): Your Pine Script won't compile? Most TradingView compile errors trace to a few root causes: type mismatches, scope rules, missing namespaces, indentation, and version drift. Here's how to read and fix each one. - [LuxAlgo Quant vs PineScripter: An Honest Comparison](https://www.pinescripter.app/blog/luxalgo-quant-vs-pinescripter): LuxAlgo Quant generates Pine Script and comes bundled with an indicator platform. PineScripter is a standalone workspace for code you own and edit. Here's an honest comparison. - [How PineScripter Works: From Idea to Working Pine Script in Seconds](https://www.pinescripter.app/blog/how-pinescripter-works): You have a strategy idea. You want to see if it works. Here's how PineScripter eliminates the painful debugging cycle and gets you to a working script faster than any other tool. - [5 Best AI Tools for Pine Script (2026 Comparison)](https://www.pinescripter.app/blog/best-ai-tools-pine-script): You want to write Pine Script faster. Should you use ChatGPT, Cursor, or a specialized tool? Here's an honest comparison of what actually works for TradingView development. - [PineScripter vs Hiring a Fiverr Developer (Cost & Time Comparison)](https://www.pinescripter.app/blog/pinescripter-vs-fiverr): You need a Pine Script indicator built. Do you hire a Fiverr developer for $150 and wait a week, or generate it yourself in 30 seconds? Here's the real cost comparison. - [Why ChatGPT Fails at Pine Script (And What Actually Works)](https://www.pinescripter.app/blog/chatgpt-vs-pinescripter): You have a great trading idea at 11pm on Sunday. You ask ChatGPT to write the Pine Script. You paste it into TradingView... and it breaks. Here's why generic AI fails at Pine Script. ## Free tools Every tool runs in the browser, needs no account, and never uploads your input. The calculators also show the Pine Script equivalent of the value they compute. ### Trading and investment metrics - [Win Rate & Win/Loss Ratio Calculator](https://www.pinescripter.app/tools/win-rate-calculator): Turn winning and losing trade counts into a win rate and ratio. - [Risk/Reward Ratio Calculator](https://www.pinescripter.app/tools/risk-reward-ratio-calculator): Compute reward-to-risk from entry, stop, and target prices. - [Sharpe Ratio Calculator](https://www.pinescripter.app/tools/sharpe-ratio-calculator): Measure return per unit of risk, with optional annualization. - [Sortino Ratio Calculator](https://www.pinescripter.app/tools/sortino-ratio-calculator): Return per unit of downside risk, a downside-only Sharpe. - [Trade Expectancy Calculator](https://www.pinescripter.app/tools/trade-expectancy-calculator): Compute expected value per trade from win rate and average P&L. - [Profit Factor Calculator](https://www.pinescripter.app/tools/profit-factor-calculator): Divide gross profit by gross loss to gauge a track record. - [Position Size Calculator](https://www.pinescripter.app/tools/position-size-calculator): Size a position from account size, risk %, entry, and stop. - [Pip Value Calculator](https://www.pinescripter.app/tools/pip-value-calculator): Find the value of one pip per lot in your account currency. - [Kelly Criterion Calculator](https://www.pinescripter.app/tools/kelly-criterion-calculator): Compute the Kelly optimal fraction and the safer half-Kelly. - [CAGR Calculator](https://www.pinescripter.app/tools/cagr-calculator): Compound Annual Growth Rate from start, end, and years. - [Drawdown Recovery Calculator](https://www.pinescripter.app/tools/drawdown-recovery-calculator): The gain needed to recover from a given percentage loss. - [Max Drawdown Calculator](https://www.pinescripter.app/tools/max-drawdown-calculator): Find the deepest peak-to-trough decline in an equity curve. - [Calmar Ratio Calculator](https://www.pinescripter.app/tools/calmar-ratio-calculator): Divide annualized return by max drawdown. - [Ulcer Index Calculator](https://www.pinescripter.app/tools/ulcer-index-calculator): Measure the depth and duration of drawdowns in one number. - [ATR Stop Loss Calculator](https://www.pinescripter.app/tools/atr-stop-loss-calculator): Place a volatility-based stop and size the position to match. - [Trading Compound Calculator](https://www.pinescripter.app/tools/trading-compound-calculator): Compound a balance forward at a fixed return per period. - [Risk of Ruin Calculator](https://www.pinescripter.app/tools/risk-of-ruin-calculator): Simulate how often a given risk level breaches your loss limit. - [Average Down Calculator](https://www.pinescripter.app/tools/average-down-calculator): Blend multiple entries into one average cost and break-even. - [Breakeven Win Rate Calculator](https://www.pinescripter.app/tools/breakeven-win-rate-calculator): The minimum win rate needed to break even at a given reward-to-risk ratio. - [Trade Journal Statistics Calculator](https://www.pinescripter.app/tools/trade-journal-statistics): Paste a trade list and get expectancy, profit factor, win rate, and more. - [R-Multiple Calculator](https://www.pinescripter.app/tools/r-multiple-calculator): Express any trade outcome as a multiple of the initial risk. ### Pine Script developer tools - [Pine Script Repainting Checker](https://www.pinescripter.app/tools/pine-script-repainting-checker): Scan your script for the most common repainting patterns. - [Pine Script Error Decoder](https://www.pinescripter.app/tools/pine-script-error-decoder): Paste a compile error and get the cause and the fix. - [Pine Script Validator](https://www.pinescripter.app/tools/pine-script-validator): Check a script for structural mistakes before you paste it. - [Pine Script v6 Migration Checker](https://www.pinescripter.app/tools/pine-script-v6-migration-checker): Scan a v5 script for the changes v6 requires. - [TradingView Alert Webhook Builder](https://www.pinescripter.app/tools/tradingview-alert-webhook-builder): Build a valid alert message JSON with live placeholders. - [Pine Script Session & Timezone Tool](https://www.pinescripter.app/tools/pine-script-session-timezone-tool): Build session strings and convert market hours between zones. ### Momentum indicators - [RSI Calculator](https://www.pinescripter.app/tools/rsi-calculator): Compute the Relative Strength Index from a price series. - [MACD Calculator](https://www.pinescripter.app/tools/macd-calculator): Compute the MACD line, signal line, and histogram. - [Stochastic Oscillator Calculator](https://www.pinescripter.app/tools/stochastic-calculator): Calculate %K and %D from high, low, and close data. - [CCI Calculator](https://www.pinescripter.app/tools/cci-calculator): Compute the Commodity Channel Index from OHLC data. - [Williams %R Calculator](https://www.pinescripter.app/tools/williams-r-calculator): Calculate Williams %R from high, low, and close data. - [Rate of Change (ROC) Calculator](https://www.pinescripter.app/tools/roc-calculator): Compute the percent change between the current price and N bars ago. ### Trend indicators - [Parabolic SAR Calculator](https://www.pinescripter.app/tools/parabolic-sar-calculator): Compute one step of the Parabolic SAR from prior values. - [Moving Average Calculator (SMA, EMA, WMA)](https://www.pinescripter.app/tools/moving-average-calculator): Calculate simple, exponential, and weighted moving averages. - [ADX Calculator (Average Directional Index)](https://www.pinescripter.app/tools/adx-calculator): Compute ADX, +DI, and -DI to gauge trend strength from OHLC data. - [Supertrend Calculator](https://www.pinescripter.app/tools/supertrend-calculator): Compute one Supertrend step from ATR, factor, and the prior bands. - [Heikin Ashi Calculator](https://www.pinescripter.app/tools/heikin-ashi-calculator): Compute a Heikin Ashi candle from regular OHLC and the prior candle. - [Ichimoku Cloud Calculator](https://www.pinescripter.app/tools/ichimoku-calculator): Compute Tenkan-sen, Kijun-sen, Senkou Span A/B, and the cloud. - [Donchian Channels Calculator](https://www.pinescripter.app/tools/donchian-channels-calculator): Compute the upper, middle, and lower Donchian channel from a lookback range. ### Volatility indicators - [Bollinger Bands Calculator](https://www.pinescripter.app/tools/bollinger-bands-calculator): Calculate the upper, middle, and lower Bollinger Bands. - [ATR Calculator](https://www.pinescripter.app/tools/atr-calculator): Compute the Average True Range from OHLC data. - [Keltner Channels Calculator](https://www.pinescripter.app/tools/keltner-channels-calculator): Compute the EMA basis and ATR-based upper and lower channels. ### Volume indicators - [VWAP Calculator](https://www.pinescripter.app/tools/vwap-calculator): Compute the Volume Weighted Average Price. - [OBV Calculator](https://www.pinescripter.app/tools/obv-calculator): Calculate On Balance Volume from close and volume data. - [Money Flow Index (MFI) Calculator](https://www.pinescripter.app/tools/mfi-calculator): Compute the volume-weighted Money Flow Index from OHLCV data. - [Chaikin Money Flow (CMF) Calculator](https://www.pinescripter.app/tools/chaikin-money-flow-calculator): Compute Chaikin Money Flow from high, low, close, and volume data. ### Price levels - [Pivot Points Calculator](https://www.pinescripter.app/tools/pivot-points-calculator): Standard, Fibonacci, and Camarilla pivot levels from prior H/L/C. - [Fibonacci Retracement Calculator](https://www.pinescripter.app/tools/fibonacci-retracement-calculator): Compute Fibonacci retracement and extension levels from a swing. ## Legal - [Privacy Policy](https://www.pinescripter.app/privacy-policy) - [Terms](https://www.pinescripter.app/terms) - [Refund Policy](https://www.pinescripter.app/refund-policy) Note: PineScripter is a coding tool, not a financial product. It does not provide financial advice and does not guarantee trading outcomes.