# ForexCodes > ForexCodes is the quality-assurance platform for algorithmic trading code — TradingView Pine Script v6 and MetaTrader MQL4/MQL5. We verify that trading code is CORRECT (no look-ahead bias, no repainting, sound risk wiring) — never that it is profitable. Correctness ≠ profitability. Everything is educational; we make no win-rate, profit, or performance claims, and nothing on this site is financial advice. Every recommended Pine example passes our deterministic validator before publication. Key facts: - 107 indicator & concept guides: exact mechanics, how to read them, honest pitfalls, and a validated Pine v6 example each. - 133 articles on Pine Script, MetaTrader EAs, backtesting honesty (overfitting, repainting, look-ahead bias), and risk education. - 12 Pine Script error-reference pages with verbatim error text, cause, and a validated fix. - 36 free deterministic calculators — identical inputs always give identical outputs; no predictions, no signals, no login. - 4 public case studies where our engine's real findings (look-ahead, repaint, dead risk inputs) are shown on common strategy patterns. - Free tools: a deterministic Pine validator and Repaint Checker that run in the browser — code never leaves the machine. - Paid platform: Strategy Validator (Strategy Health Score™ — code correctness only), Code Fixer, Prop Compliance Checker, English→Pine, and MetaTrader MQL4/5 tools incl. Pine↔MQL conversion both ways. - Open source: the deterministic validation engine (MIT) plus VS Code and browser extensions — https://github.com/ForexCodes-hq ## Tools - [All platforms](https://forexcodes.com/platforms): the hub for all 7 code validators (Pine, MQL, Python, NinjaScript, cTrader, LEAN, EasyLanguage), the Backtest suite and the Universal Translator — one correctness engine across every platform - [ForexCodes API](https://forexcodes.com/developers): public validation API — POST /api/v1/validate scores code for any of the 7 platforms and returns the Strategy Health Score, findings and a code fingerprint; GET /api/v1/verify/{id} confirms a "Verified by ForexCodes" badge. Free & open deterministic validation, key-authed - [Strategy Validator](https://forexcodes.com/audit): paste Pine Script, get a Strategy Health Score™ (0–100, code correctness only) with every finding and fix - [Repaint Checker](https://forexcodes.com/repaint-checker): free, instant repaint / look-ahead check — runs locally in the browser - [Backtest Health Check](https://forexcodes.com/backtest): upload a TradingView/MetaTrader backtest → recompute-vs-claimed integrity checks, structural lie-detectors, drop-the-best-K robustness + Deflated Sharpe + Monte Carlo → a Backtest Health Score (integrity & robustness, never profitability) - [Backtest Overfitting Check](https://forexcodes.com/backtest/overfitting): upload your optimizer's many runs → Probability of Backtest Overfitting (PBO/CSCV), White's Reality Check, Hansen SPA, and a multiple-testing haircut. We never run a backtest ourselves - [Python Backtest Validator](https://forexcodes.com/python): paste a pandas/backtrader/freqtrade/vectorbt strategy → deterministic static analysis for look-ahead bias (negative shift, centered windows, backtrader future indices), same-bar execution, higher-timeframe leakage, in-sample overfitting, and missing cost/risk modeling. Correctness only, not profitability - [NinjaScript Validator](https://forexcodes.com/ninjascript): paste a NinjaTrader 8 NinjaScript strategy → deterministic static analysis for intrabar repaint (Calculate.OnEachTick without a bar-close guard), future-bar access (CurrentBar + N), multi-series higher-timeframe sync, Historical-vs-Realtime divergence, and missing stops. Correctness only, not profitability - [cTrader / cAlgo Validator](https://forexcodes.com/ctrader): paste a cTrader cAlgo robot (C#) → deterministic static analysis for orders placed in OnTick (intrabar repaint), future/negative series indices, multi-timeframe GetBars sync, and missing stops. Correctness only, not profitability - [LEAN / QuantConnect Validator](https://forexcodes.com/lean): paste a QuantConnect LEAN algorithm (Python or C#) → deterministic checks for indicators used without SetWarmUp/IsReady, History() look-ahead, and missing risk management. Correctness only, not profitability - [EasyLanguage Validator](https://forexcodes.com/easylanguage): paste a TradeStation EasyLanguage strategy → deterministic static analysis for same-bar execution ('this bar' orders), negative bar offsets, IntrabarOrderGeneration repaint, and missing stops. Correctness only, not profitability - [Universal Strategy Translator](https://forexcodes.com/translate): convert a strategy any-to-any across Pine Script, MetaTrader MQL, Python, NinjaScript, cTrader and EasyLanguage (or plain English → any) — semantics preserved, then the OUTPUT is run through the target platform's own validator and every construct is marked maps-cleanly / approximated / no-equivalent. A faithful starting point, not a 1:1 port - [Code Fixer](https://forexcodes.com/fix): fix, de-repaint, or migrate Pine to v6 — output re-validated by our engine - [Prop Compliance Checker](https://forexcodes.com/prop-firm-check): does the code carry the risk controls FTMO-style firms require - [MetaTrader tools](https://forexcodes.com/metatrader): EA safety audit, English→MQL, Pine→MQL and MQL→Pine conversion - [Extensions](https://forexcodes.com/extensions): VS Code extension (live) and browser extension — the same engine where you write code - [Position Size Calculator](https://forexcodes.com/tools/position-size-calculator): How many units to trade so a loss costs exactly what you decided. - [Risk/Reward Calculator](https://forexcodes.com/tools/risk-reward-calculator): Your reward-to-risk ratio and the break-even win rate. - [Drawdown Recovery Calculator](https://forexcodes.com/tools/drawdown-calculator): The brutal math: the gain needed to recover a loss. - [Risk of Ruin Calculator](https://forexcodes.com/tools/risk-of-ruin-calculator): Monte-Carlo odds your edge survives. - [Prop-Firm Challenge Calculator](https://forexcodes.com/tools/prop-firm-calculator): Can the math pass — and how many losses blow it? - [Expectancy Calculator](https://forexcodes.com/tools/expectancy-calculator): Your average edge per trade — positive or not. - [Pip Value Calculator](https://forexcodes.com/tools/pip-calculator): What one pip is worth on your position. - [Profit / Loss Calculator](https://forexcodes.com/tools/profit-loss-calculator): P&L on a trade, long or short. - [Spread Cost Calculator](https://forexcodes.com/tools/spread-cost-calculator): What the spread really costs you per trade. - [Compounding Calculator](https://forexcodes.com/tools/compounding-calculator): Hypothetical growth — illustrative math, not a forecast. - [Margin Calculator](https://forexcodes.com/tools/margin-calculator): The margin a position locks up, from lots and leverage. - [Effective Leverage Calculator](https://forexcodes.com/tools/leverage-calculator): Your true leverage — and the move that wipes equity. - [Lot Size Converter](https://forexcodes.com/tools/lot-size-converter): Standard ↔ mini ↔ micro ↔ units, instantly. - [Break-Even Win Rate Calculator](https://forexcodes.com/tools/break-even-win-rate-calculator): The win rate you need just to break even — costs included. - [Profit Factor Calculator](https://forexcodes.com/tools/profit-factor-calculator): Gross profit ÷ gross loss, honestly framed. - [Sharpe Ratio Calculator](https://forexcodes.com/tools/sharpe-ratio-calculator): Risk-adjusted return of your sample — with honest caveats. - [Sortino Ratio Calculator](https://forexcodes.com/tools/sortino-ratio-calculator): Sharpe's cousin that only punishes downside. - [CAGR Calculator](https://forexcodes.com/tools/cagr-calculator): Annualized growth — and why short samples lie. - [R-Multiple Calculator](https://forexcodes.com/tools/r-multiple-calculator): Every trade measured in units of initial risk. - [SQN Calculator (Van Tharp)](https://forexcodes.com/tools/sqn-calculator): Van Tharp's SQN — a grade for your sample, not a promise. - [ATR Stop Calculator](https://forexcodes.com/tools/atr-stop-calculator): Volatility-sized stops from ATR × multiplier. - [ADR Position Size Helper](https://forexcodes.com/tools/adr-position-size-calculator): Position size from the average daily range. - [Profit Target Calculator](https://forexcodes.com/tools/profit-target-calculator): The target your R:R actually implies. - [Commission Break-Even Calculator](https://forexcodes.com/tools/commission-breakeven-calculator): How far price must move before you're at zero. - [Trading Cost Calculator](https://forexcodes.com/tools/trading-cost-calculator): What frequency really costs you per year. - [Losing Streak Probability Calculator](https://forexcodes.com/tools/losing-streak-calculator): Long losing streaks are normal — see the odds. - [Expected Consecutive Losses Calculator](https://forexcodes.com/tools/consecutive-losses-calculator): The worst streak you should EXPECT, not fear. - [Win/Loss Streak Simulator](https://forexcodes.com/tools/streak-simulator): Pure randomness produces uglier streaks than you think. - [Martingale Calculator (Danger Demo)](https://forexcodes.com/tools/martingale-calculator): Why doubling-down math destroys accounts. - [Portfolio Heat Calculator](https://forexcodes.com/tools/portfolio-heat-calculator): Total risk across every open position. - [Max Open Positions Calculator](https://forexcodes.com/tools/max-positions-calculator): How many positions your risk budget allows. - [Risk-per-Trade Ladder](https://forexcodes.com/tools/risk-ladder-calculator): Where 20 straight losses actually leaves you. - [Drawdown Recovery Time Calculator](https://forexcodes.com/tools/recovery-time-calculator): How long a drawdown really costs you. - [Drawdown Duration Estimator](https://forexcodes.com/tools/drawdown-duration-calculator): Trades and months to dig out of a hole. - [Pyramiding Calculator](https://forexcodes.com/tools/pyramiding-calculator): What adding to winners does to your average entry. - [Equity Goal Reverse Calculator](https://forexcodes.com/tools/equity-goal-calculator): What your goal mathematically demands. ## Indicator guides - [RSI (Relative Strength Index)](https://forexcodes.com/indicators/rsi): A momentum oscillator that measures the speed and size of recent price changes on a 0-100 scale. - [MACD (Moving Average Convergence Divergence)](https://forexcodes.com/indicators/macd): A momentum indicator built from the difference between two moving averages, plus a signal line and histogram. - [Moving Averages (SMA & EMA)](https://forexcodes.com/indicators/moving-averages): A smoothed line of average price that helps traders see the underlying trend through noisy candles. - [Bollinger Bands](https://forexcodes.com/indicators/bollinger-bands): A moving average wrapped in volatility-based bands that widen and narrow as price action calms or churns. - [Stochastic Oscillator](https://forexcodes.com/indicators/stochastic): A bounded momentum oscillator showing where the close sits within a recent high-low range. - [Average True Range (ATR)](https://forexcodes.com/indicators/atr): A volatility gauge that measures how much price moves on average over a chosen period, expressed in price units. - [ADX / DMI (Average Directional Index / Directional Movement)](https://forexcodes.com/indicators/adx-dmi): A trend-strength gauge with two directional lines, built to measure how strong a move is rather than which way it goes. - [Ichimoku Cloud (Ichimoku Kinko Hyo)](https://forexcodes.com/indicators/ichimoku-cloud): A multi-line system that aims to show trend direction, equilibrium, and potential support/resistance on a single chart. - [Volume Weighted Average Price (VWAP)](https://forexcodes.com/indicators/vwap): The average price of an asset over a defined period, weighted by how much volume traded at each price. - [Fibonacci Retracement](https://forexcodes.com/indicators/fibonacci-retracement): A drawing tool that marks proportional levels between a chosen swing high and swing low. - [Supertrend](https://forexcodes.com/indicators/supertrend): An ATR-based trend-following overlay that plots a single line above or below price to track the prevailing direction. - [On-Balance Volume (OBV)](https://forexcodes.com/indicators/obv): A running total of volume that adds or subtracts each bar's volume based on whether price closed up or down. - [Parabolic SAR](https://forexcodes.com/indicators/parabolic-sar): A trailing-stop and trend-direction tool that plots dots above or below price. - [Commodity Channel Index (CCI)](https://forexcodes.com/indicators/cci): An oscillator that measures how far price has moved from its recent average, scaled by recent volatility. - [Williams %R](https://forexcodes.com/indicators/williams-r): A momentum oscillator that shows where the latest close sits within the recent high-low range. - [Pivot Points](https://forexcodes.com/indicators/pivot-points): Price-derived horizontal levels that mark a central pivot plus support and resistance bands for the current period. - [Donchian Channels](https://forexcodes.com/indicators/donchian-channels): A channel built from the highest high and lowest low over a chosen lookback period. - [Keltner Channels](https://forexcodes.com/indicators/keltner-channels): A volatility-based envelope built around a moving average using the Average True Range. - [Money Flow Index (MFI)](https://forexcodes.com/indicators/mfi): A volume-weighted momentum oscillator bounded between 0 and 100. - [Awesome Oscillator (AO)](https://forexcodes.com/indicators/awesome-oscillator): A momentum histogram that compares a short-term and a longer-term average of price. - [Heikin Ashi](https://forexcodes.com/indicators/heikin-ashi): A smoothed candlestick chart that averages price to make trends and pauses easier to see. - [Volume Profile](https://forexcodes.com/indicators/volume-profile): A horizontal histogram that shows how much volume traded at each price level over a chosen range. - [Chaikin Money Flow (CMF)](https://forexcodes.com/indicators/chaikin-money-flow): A volume-weighted oscillator that gauges buying versus selling pressure over a set lookback, swinging between +1 and -1 around a zero line. - [Rate of Change (ROC)](https://forexcodes.com/indicators/rate-of-change): A momentum oscillator that measures the percentage change in price over a set number of bars. - [TRIX](https://forexcodes.com/indicators/trix): A triple-smoothed momentum oscillator that measures the rate of change of a heavily filtered price series. - [Aroon](https://forexcodes.com/indicators/aroon): Measures how recently price hit its highest high and lowest low to help describe whether a trend is present or absent. - [Vortex Indicator (VI)](https://forexcodes.com/indicators/vortex): Two crossing lines that traders read to gauge whether upward or downward movement has been more dominant recently. - [Standard Deviation](https://forexcodes.com/indicators/standard-deviation): A statistical measure of how far price has spread from its own moving average over a chosen lookback. - [Choppiness Index](https://forexcodes.com/indicators/choppiness-index): A 0-100 gauge of whether a market has been trending or chopping sideways — it describes the character of price movement, not its direction. - [Elder-Ray Index](https://forexcodes.com/indicators/elder-ray): Splits price action into Bull Power and Bear Power around a moving-average baseline to describe buying and selling pressure. - [Force Index](https://forexcodes.com/indicators/force-index): Combines price direction, the size of the move, and volume into one line that oscillates around zero. - [Ultimate Oscillator](https://forexcodes.com/indicators/ultimate-oscillator): A momentum oscillator that blends three lookback periods into one 0-100 reading, aiming to reduce some of the false signals common in single-period oscillators. - [Connors RSI (CRSI)](https://forexcodes.com/indicators/connors-rsi): A three-part momentum oscillator that blends a short-term RSI, an RSI of price streaks, and a percentile rank of recent price change into one 0-100 line. - [Hull Moving Average (HMA)](https://forexcodes.com/indicators/hull-moving-average): A weighted moving average designed to reduce lag while staying relatively smooth. - [Arnaud Legoux Moving Average (ALMA)](https://forexcodes.com/indicators/alma): A Gaussian-weighted moving average designed to reduce lag while keeping the line smooth. - [Accumulation/Distribution Line (A/D Line)](https://forexcodes.com/indicators/accumulation-distribution): A running, volume-weighted tally of where price closes within each bar's range — used to study whether buying or selling pressure appears to be building. - [Detrended Price Oscillator (DPO)](https://forexcodes.com/indicators/dpo): Strips out the longer-term trend so shorter price cycles are easier to see. - [Moving Average Envelopes](https://forexcodes.com/indicators/envelopes): Two bands set a fixed percentage above and below a moving average, framing how far price has drifted from its mean. - [Stochastic RSI](https://forexcodes.com/indicators/stochastic-rsi): An oscillator that applies the stochastic formula to RSI values instead of price, producing a faster but noisier 0-100 (or 0-1) momentum reading. - [EMA vs SMA](https://forexcodes.com/indicators/ema-vs-sma): Two ways of averaging the same prices — equal weights versus exponentially fading weights — with a measurable lag-versus-smoothness trade-off and no 'better' answer. - [Anchored VWAP](https://forexcodes.com/indicators/anchored-vwap): The volume-weighted average price accumulated from a specific starting bar you choose — an event, a swing point, or a session — rather than an automatic daily reset. - [TTM Squeeze (Squeeze Momentum)](https://forexcodes.com/indicators/ttm-squeeze): A volatility-compression detector — Bollinger Bands inside Keltner Channels — paired with a linear-regression momentum histogram; it flags coiling, not direction. - [ZigZag](https://forexcodes.com/indicators/zigzag): A swing-mapping tool that connects significant highs and lows with straight lines — and the canonical example of an indicator that repaints by construction. - [Williams Fractals](https://forexcodes.com/indicators/williams-fractals): A five-bar swing pattern that marks local highs and lows — always confirmed two bars after the fact, which is where most implementations quietly cheat. - [Renko Charts](https://forexcodes.com/indicators/renko): A time-independent chart of fixed-size price bricks that looks beautifully smooth — largely because it assumes fills at prices that never traded as drawn. - [Golden Cross & Death Cross](https://forexcodes.com/indicators/golden-cross-death-cross): The 50/200 moving-average crossovers behind endless headlines — precisely defined, easy to code, and lagging by design. - [Relative Volume (RVOL)](https://forexcodes.com/indicators/relative-volume): A ratio comparing current volume to what is typical for that moment, so 'high volume' becomes a measured statement instead of a guess. - [Cumulative Volume Delta (CVD)](https://forexcodes.com/indicators/cumulative-volume-delta): A running sum of estimated buying minus selling volume — useful context, but only as good as the delta estimate underneath it. - [Market Structure (BOS & CHoCH)](https://forexcodes.com/indicators/market-structure): Pivot-based definitions of Break of Structure and Change of Character that turn 'structure' from a retrospective story into a testable condition. - [Order Blocks](https://forexcodes.com/indicators/order-blocks): A rule-based definition — the last opposing candle before a displacement move — for a concept that is usually defined only after the fact. - [Fair Value Gaps (FVG)](https://forexcodes.com/indicators/fair-value-gaps): A three-candle pattern marking a price range the market skipped over in one fast move, leaving an untraded gap between the first and third candles. - [Smart Money Concepts (SMC)](https://forexcodes.com/indicators/smart-money-concepts): A modern vocabulary for price action — swing structure, zones, and gaps — that largely relabels ideas classical technical analysis has described for decades. - [Fibonacci Extensions](https://forexcodes.com/indicators/fibonacci-extension): A three-point projection tool that extends Fibonacci ratios beyond a completed swing to mark possible price objectives past the prior extreme. - [Opening Range Breakout (ORB)](https://forexcodes.com/indicators/opening-range-breakout): A session-based framework that records the high and low of the first minutes of trading and watches how price behaves against that range for the rest of the day. - [Williams Alligator](https://forexcodes.com/indicators/williams-alligator): Three forward-shifted smoothed moving averages — the Jaw, Teeth, and Lips — used to visualize when a market is trending versus 'sleeping'. - [WaveTrend Oscillator](https://forexcodes.com/indicators/wavetrend-oscillator): A community-famous momentum oscillator — essentially a smoothed, EMA-normalized cousin of the CCI — with two lines and overbought/oversold zones near ±60. - [Chandelier Exit](https://forexcodes.com/indicators/chandelier-exit): An ATR-based trailing stop that hangs a fixed volatility distance below the highest high (or above the lowest low) and only ever ratchets in the trade's favor. - [Percentage Price Oscillator (PPO)](https://forexcodes.com/indicators/ppo): MACD expressed as a percentage of price — the same two-EMA momentum measure, normalized so readings are comparable across symbols and across time. - [QQE (Quantitative Qualitative Estimation)](https://forexcodes.com/indicators/qqe): A smoothed RSI wrapped in an ATR-style trailing band — a popular but often mystified momentum tool, demystified. - [Fisher Transform](https://forexcodes.com/indicators/fisher-transform): A statistical transform that reshapes bounded price position into a sharper, near-Gaussian oscillator. - [Schaff Trend Cycle](https://forexcodes.com/indicators/schaff-trend-cycle): MACD run through two rounds of stochastic normalization — faster-turning than MACD, at the cost of more whipsaw. - [Momentum Indicator](https://forexcodes.com/indicators/momentum-indicator): The simplest oscillator there is: today's price minus the price N bars ago. - [Chande Momentum Oscillator (CMO)](https://forexcodes.com/indicators/chande-momentum-oscillator): An RSI relative that uses the same up/down price changes but raw sums and a symmetric −100 to +100 scale. - [Relative Vigor Index (RVI)](https://forexcodes.com/indicators/relative-vigor-index): An oscillator comparing where bars close within their range, smoothed with symmetric weighting — not to be confused with the Relative Volatility Index. - [DeMarker (DeM)](https://forexcodes.com/indicators/demarker): A MetaTrader-default oscillator that compares successive highs and lows — not closes — on a 0-to-1 scale. - [Accelerator Oscillator (AC)](https://forexcodes.com/indicators/accelerator-oscillator): A Bill Williams histogram that measures whether momentum itself is speeding up or slowing down — momentum of momentum. - [Traders Dynamic Index (TDI)](https://forexcodes.com/indicators/traders-dynamic-index): A forex-forum favorite that is really three familiar tools stacked on one RSI: a smoothed RSI, its signal line, and Bollinger Bands drawn on the RSI itself. - [Stochastic Momentum Index (SMI)](https://forexcodes.com/indicators/stochastic-momentum-index): A double-smoothed stochastic that measures where the close sits relative to the midpoint of the recent range, producing a centered oscillator from -100 to +100. - [Weighted Moving Average (WMA)](https://forexcodes.com/indicators/weighted-moving-average): A moving average with linearly declining weights — the newest bar counts most, the oldest counts least, and the window has a hard edge. - [Smoothed Moving Average (SMMA / RMA)](https://forexcodes.com/indicators/smoothed-moving-average): Wilder's slow, recursive moving average — the RMA that quietly powers RSI and ATR, and mathematically an EMA in disguise. - [Double Exponential Moving Average (DEMA)](https://forexcodes.com/indicators/dema): A lag-compensated combination of two EMAs — 2·EMA minus EMA-of-EMA — that trades smoothness for overshoot. - [Triple Exponential Moving Average (TEMA)](https://forexcodes.com/indicators/tema): Mulloy's triple-stage lag compensator — 3·EMA1 − 3·EMA2 + EMA3 — often confused with TRIX, which shares the core but plots something else entirely. - [Kaufman Adaptive Moving Average (KAMA)](https://forexcodes.com/indicators/kama): A moving average that changes its own speed using an efficiency ratio — adaptive to past noise, not predictive of future conditions. - [Zero-Lag EMA (ZLEMA)](https://forexcodes.com/indicators/zero-lag-ema): An EMA variant that subtracts an estimate of its own lag from the input — reducing lag, but never eliminating it. - [T3 Moving Average](https://forexcodes.com/indicators/t3-moving-average): Tim Tilson's smoothing filter built from six nested EMAs blended by a 'volume factor' coefficient set. - [McGinley Dynamic](https://forexcodes.com/indicators/mcginley-dynamic): A moving average with a self-adjusting denominator that speeds up in fast markets and slows down in quiet ones. - [Least Squares Moving Average (LSMA)](https://forexcodes.com/indicators/least-squares-moving-average): The endpoint of a rolling linear regression — a statistics-based average that fits a trend line to each window of bars. - [Volume-Weighted Moving Average (VWMA)](https://forexcodes.com/indicators/vwma): A rolling moving average that weights each bar's price by its volume, so high-volume bars pull the line harder than quiet ones. - [Moving Average Ribbon](https://forexcodes.com/indicators/moving-average-ribbon): A stack of moving averages at increasing lengths plotted together, turning trend alignment and lag into one visual band. - [Guppy Multiple Moving Average (GMMA)](https://forexcodes.com/indicators/guppy-multiple-moving-average): Two bands of six EMAs each — a fast group and a slow group — read for separation, compression, and agreement between short and long lookbacks. - [Bollinger %B](https://forexcodes.com/indicators/bollinger-percent-b): A single number that states where price sits relative to the Bollinger Bands: 1 at the upper band, 0 at the lower, and beyond either when price escapes the bands. - [Bollinger BandWidth](https://forexcodes.com/indicators/bollinger-bandwidth): A single line that turns 'the Bollinger Bands look tight' into a measurable number, so squeezes can be defined precisely instead of eyeballed. - [ATR Bands](https://forexcodes.com/indicators/atr-bands): Volatility envelopes plotted a multiple of Average True Range above and below price, sized by how much the market has actually been moving. - [Historical Volatility](https://forexcodes.com/indicators/historical-volatility): The annualized standard deviation of logarithmic returns — the standard quantitative measure of how much an instrument has actually been moving. - [Volatility Stop](https://forexcodes.com/indicators/volatility-stop): The generic ATR flip-stop — a trailing line that ratchets behind price and switches sides when crossed, and the common ancestor of SuperTrend and the Chandelier Exit. - [Price Volume Trend (PVT)](https://forexcodes.com/indicators/price-volume-trend): A cumulative volume line that scales each bar's volume by the percentage price change, rather than adding all of it like OBV. - [Chaikin Oscillator](https://forexcodes.com/indicators/chaikin-oscillator): The MACD of the Accumulation/Distribution line — a fast EMA minus a slow EMA of cumulative money flow. - [Klinger Volume Oscillator](https://forexcodes.com/indicators/klinger-oscillator): A fast-minus-slow EMA of signed volume force — an indicator whose published formulas genuinely disagree across platforms. - [Volume Oscillator](https://forexcodes.com/indicators/volume-oscillator): The percentage gap between a fast and a slow moving average of volume — a measure of volume expansion or contraction, with no directional content. - [VWAP Standard Deviation Bands](https://forexcodes.com/indicators/vwap-bands): Bands plotted a chosen number of volume-weighted standard deviations above and below VWAP, showing how far price has stretched from the average traded price since the anchor. - [Open Interest](https://forexcodes.com/indicators/open-interest): The total number of derivative contracts currently outstanding — a count of open positions, which is a different thing from the volume traded. - [Gann Fan](https://forexcodes.com/indicators/gann-fan): A fan of straight lines projected from a pivot at fixed price-per-time slopes — deterministic geometry whose meaning depends entirely on a scale you must choose. - [Linear Regression Channel](https://forexcodes.com/indicators/linear-regression-channel): A best-fit straight line through recent price with parallel deviation bands — a legitimate statistical summary that refits, and therefore repaints, on every bar. - [HalfTrend](https://forexcodes.com/indicators/halftrend): A stateful trend-following overlay that ratchets a support/resistance line and flips between up and down states. - [Range Filter](https://forexcodes.com/indicators/range-filter): A recursive deadband filter that only moves when price closes further than its own smoothed typical range. - [Andrews' Pitchfork](https://forexcodes.com/indicators/andrews-pitchfork): A three-pivot channel built from a median line and two parallels — deterministic geometry with subjective inputs. - [Camarilla Pivots](https://forexcodes.com/indicators/camarilla-pivots): Intraday reference levels spaced from the previous close by fixed fractions of yesterday's range. - [Market Profile (TPO)](https://forexcodes.com/indicators/market-profile): A charting method that organizes price by how much time the market spent at each level, building the familiar bell-shaped profile. - [Z-Score](https://forexcodes.com/indicators/z-score): A rolling statistical measure of how many standard deviations price sits from its recent mean. - [Correlation Coefficient](https://forexcodes.com/indicators/correlation-coefficient): A rolling Pearson correlation between two symbols, scored from -1 to +1 over a chosen lookback window. - [Hurst Exponent](https://forexcodes.com/indicators/hurst-exponent): A statistical estimate of whether a series has tended to trend, mean-revert, or wander randomly — with wide error bars. - [Pairs Trading Spread & Z-Score](https://forexcodes.com/indicators/pairs-trading-spread): A statistical construction that measures the gap between two related instruments and expresses it in standard deviations. - [Session Highs & Lows](https://forexcodes.com/indicators/session-highs-lows): Reference levels that track the running high and low of a defined trading session such as Asia, London, or New York. - [Previous Day High/Low](https://forexcodes.com/indicators/previous-day-high-low): Yesterday's completed high and low plotted as fixed intraday reference lines — and a classic test case for repaint-free coding. - [ICT Killzones](https://forexcodes.com/indicators/ict-killzones): Fixed time-of-day windows from the ICT methodology, plotted as chart highlights — defined precisely, endorsed by evidence nowhere. - [Seasonality Analysis](https://forexcodes.com/indicators/seasonality): A statistical study that averages historical returns by calendar slot — day of week, month of year, or hour of day — to describe recurring patterns in past data. - [TWAP (Time-Weighted Average Price)](https://forexcodes.com/indicators/twap): The running average of price over time within a session — every bar counts equally, unlike VWAP where volume sets the weights. ## Articles - [How to Convert a MetaTrader EA to TradingView Pine Script](https://forexcodes.com/learn/convert-metatrader-ea-to-pine-script) - [request.security() Repainting in Pine Script: Causes and the Fix](https://forexcodes.com/learn/pine-script-request-security-repainting) - [Why Your Pine Script Backtest Doesn't Match Live Trading](https://forexcodes.com/learn/pine-script-backtest-vs-live) - [How to Add a Trailing Stop in Pine Script v6](https://forexcodes.com/learn/pine-script-trailing-stop) - [MQL5 vs Pine Script: Key Differences and Which to Use](https://forexcodes.com/learn/mql5-vs-pine-script) - [MQL4 vs MQL5: Which Should You Code Your EA In?](https://forexcodes.com/learn/mql4-vs-mql5) - [How to Add a Stop-Loss to a MetaTrader Expert Advisor](https://forexcodes.com/learn/metatrader-ea-stop-loss) - [Why Expert Advisors Blow Accounts: The Bugs to Check Before You Run One](https://forexcodes.com/learn/why-expert-advisors-blow-accounts) - [How to Convert a TradingView Strategy into a MetaTrader EA](https://forexcodes.com/learn/convert-tradingview-strategy-to-metatrader) - [What Is an Expert Advisor (EA)? A Plain-English Guide to MetaTrader Bots](https://forexcodes.com/learn/what-is-an-expert-advisor) - [How to Add Stop-Loss and Take-Profit in Pine Script](https://forexcodes.com/learn/pine-script-stop-loss-take-profit) - [Pine Script for Beginners: Your First Indicator](https://forexcodes.com/learn/first-pine-script-indicator) - [How to Backtest a Strategy in TradingView — and What It Cannot Tell You](https://forexcodes.com/learn/backtesting-in-tradingview) - [How to Convert a TradingView Indicator into a Strategy](https://forexcodes.com/learn/convert-indicator-to-strategy) - [Pine Script v5 to v6: The Complete Migration Guide](https://forexcodes.com/learn/pine-script-v5-to-v6) - [How to Turn a Trading Idea Into Pine Script](https://forexcodes.com/learn/trading-idea-to-pine-script) - [Why Your TradingView Alerts Fire Late or Repaint — and How to Fix Them](https://forexcodes.com/learn/tradingview-alerts-repaint-late) - [Common Pine Script Errors, Decoded](https://forexcodes.com/learn/pine-script-errors-explained) - [Support & Resistance](https://forexcodes.com/learn/support-and-resistance) - [Trend vs Range Markets](https://forexcodes.com/learn/trend-vs-range) - [Divergence (Price vs Indicator)](https://forexcodes.com/learn/divergence) - [Risk Management Basics](https://forexcodes.com/learn/risk-management-basics) - [Position Sizing](https://forexcodes.com/learn/position-sizing) - [Drawdown & Recovery Math](https://forexcodes.com/learn/drawdown-and-recovery) - [What Is Backtesting (and Its Traps)](https://forexcodes.com/learn/what-is-backtesting) - [Candlestick Basics](https://forexcodes.com/learn/candlestick-basics) - [Chart Patterns — an Overview](https://forexcodes.com/learn/chart-patterns-overview) - [Head & Shoulders Pattern](https://forexcodes.com/learn/head-and-shoulders) - [Double Top & Double Bottom](https://forexcodes.com/learn/double-top-and-bottom) - [Triangles & Wedges: How Traders Read These Chart Patterns](https://forexcodes.com/learn/triangles-and-wedges) - [Flags & Pennants: How Traders Read These Consolidation Patterns](https://forexcodes.com/learn/flags-and-pennants) - [The Doji Candlestick](https://forexcodes.com/learn/candlestick-doji) - [Engulfing Candlesticks](https://forexcodes.com/learn/candlestick-engulfing) - [Hammer & Shooting Star](https://forexcodes.com/learn/candlestick-hammer-and-star) - [Multi-Timeframe Analysis: How Traders Read One Market Across Several Charts](https://forexcodes.com/learn/multi-timeframe-analysis) - [Expectancy & Trading Edge](https://forexcodes.com/learn/expectancy-and-edge) - [alertcondition() vs alert() in Pine Script: Which One Should You Use?](https://forexcodes.com/learn/pine-script-alertcondition-vs-alert) - [Strategy Order Alerts and Webhooks in Pine Script: alert_message and Placeholders](https://forexcodes.com/learn/pine-script-strategy-alerts-webhooks) - [Pine Script Arrays: A Practical Guide to push, get, Loops, and Pitfalls](https://forexcodes.com/learn/pine-script-arrays-guide) - [How to Draw Labels, Boxes, and Lines in Pine Script v6 (and Manage Object Limits)](https://forexcodes.com/learn/pine-script-labels-boxes-lines) - [Sessions and Timezones in Pine Script: time(), Session Strings, and DST Traps](https://forexcodes.com/learn/pine-script-sessions-timezones) - [How to Debug Pine Script: plotchar, Labels, log.info, and the Pine Logs Pane](https://forexcodes.com/learn/pine-script-debugging-techniques) - [strategy() vs indicator() in Pine Script: What Actually Changes](https://forexcodes.com/learn/pine-script-strategy-vs-indicator) - [Handling na Values in Pine Script: nz(), na(), fixnan() and Silent Bugs](https://forexcodes.com/learn/pine-script-na-handling) - [barstate in Pine Script: isconfirmed, islast, isrealtime and Why They Matter](https://forexcodes.com/learn/pine-script-barstate-explained) - [Pine Script Strategy Properties Explained: Commission, Slippage, Initial Capital, and Fill Assumptions](https://forexcodes.com/learn/pine-script-strategy-properties) - [TradingView Strategy Tester Explained: Every Metric, Honestly](https://forexcodes.com/learn/tradingview-strategy-tester-explained) - [Deep Backtesting in TradingView: What It Does and What It Doesn't Fix](https://forexcodes.com/learn/tradingview-deep-backtesting) - [How TradingView's Broker Emulator Fills Orders: the OHLC Assumption Explained](https://forexcodes.com/learn/tradingview-broker-emulator) - [Why You Shouldn't Backtest on Heikin Ashi, Renko, or Range Charts](https://forexcodes.com/learn/tradingview-backtest-chart-types) - [MT4 Strategy Tester Modeling Quality: What 90% Actually Means](https://forexcodes.com/learn/mt4-strategy-tester-modeling-quality) - [MT5 Strategy Tester Modes Compared: Every Tick, Real Ticks, 1-Minute OHLC, and Open Prices](https://forexcodes.com/learn/mt5-strategy-tester-tick-modes) - [MT5 Strategy Optimization: Genetic Algorithm, Forward Testing, and the Overfitting Trap](https://forexcodes.com/learn/mt5-optimization-guide) - [MetaTrader OrderSend Errors Explained: 130, 131, 134, 4109 and Friends](https://forexcodes.com/learn/metatrader-ordersend-errors) - [Why Your EA Isn't Taking Trades: A Diagnostic Checklist](https://forexcodes.com/learn/metatrader-ea-not-taking-trades) - [Why MetaTrader Backtests Don't Match Live Results](https://forexcodes.com/learn/metatrader-backtest-vs-live) - [Overfitting in Trading: Why Your Perfect Backtest Is Probably Curve-Fit](https://forexcodes.com/learn/overfitting-curve-fitting-explained) - [Walk-Forward Analysis in Trading: How to Do It Step by Step](https://forexcodes.com/learn/walk-forward-analysis) - [Monte Carlo Simulation for Trading Strategies: How to Stress-Test a Backtest](https://forexcodes.com/learn/monte-carlo-simulation-backtests) - [The Deflated Sharpe Ratio Explained: Correcting Your Backtest for How Many Strategies You Tried](https://forexcodes.com/learn/deflated-sharpe-ratio) - [In-Sample vs Out-of-Sample Testing: The One Habit That Separates Testing from Fooling Yourself](https://forexcodes.com/learn/in-sample-vs-out-of-sample) - [How Many Trades Does a Backtest Need to Be Statistically Meaningful?](https://forexcodes.com/learn/how-many-trades-is-enough) - [Look-Ahead Bias: The Backtest Bug That Uses Tomorrow's Data Today](https://forexcodes.com/learn/look-ahead-bias) - [What Is Slippage in Trading — and How Much Should You Budget For?](https://forexcodes.com/learn/slippage-explained) - [Bid, Ask, and Spread Mechanics: Why Spreads Widen and What They Cost You](https://forexcodes.com/learn/spread-mechanics) - [How Margin and Leverage Work in Forex: Margin Calls and Stop-Outs, Step by Step](https://forexcodes.com/learn/margin-leverage-mechanics) - [Why ChatGPT-Generated Pine Script Won't Compile (and How to Fix It)](https://forexcodes.com/learn/chatgpt-pine-script-errors) - [Supertrend vs Parabolic SAR: What's the Difference and Which Should You Use?](https://forexcodes.com/learn/supertrend-vs-parabolic-sar) - [RSI vs Stochastic Oscillator: What's the Difference?](https://forexcodes.com/learn/rsi-vs-stochastic) - [Keltner Channels vs Bollinger Bands: Which Should You Use?](https://forexcodes.com/learn/keltner-channels-vs-bollinger-bands) - [Which Indicators Repaint? The Complete List](https://forexcodes.com/learn/which-indicators-repaint) - [Does Supertrend Repaint? A Deterministic Answer](https://forexcodes.com/learn/does-supertrend-repaint) - [Why Heikin Ashi Backtests Show Unrealistic Results (and How to Fix Them)](https://forexcodes.com/learn/heikin-ashi-backtest-accuracy) - [Are Renko Backtests Reliable? An Honest Look at Brick Mechanics](https://forexcodes.com/learn/renko-backtest-accuracy) - [Best RSI Settings for Day Trading and Scalping: An Honest Answer](https://forexcodes.com/learn/best-rsi-settings) - [How to Fix OrderSend Error 130 (Invalid Stops) in MQL4](https://forexcodes.com/learn/ordersend-error-130-invalid-stops) - [Pine Script 'Syntax Error at Input' — What It Means and How to Fix It](https://forexcodes.com/learn/syntax-error-at-input) - [Kelly Criterion Calculator: How Much Should You Risk Per Trade?](https://forexcodes.com/learn/kelly-criterion) - [Prop Firm Trailing Drawdown: How It Works and How Close You Are to Breaching It](https://forexcodes.com/learn/trailing-drawdown) - [Forex Swap Rates Explained: How Much Holding a Position Overnight Really Costs](https://forexcodes.com/learn/swap-cost) - [XAUUSD Lot Size and Pip Value: How to Calculate Position Size for Gold](https://forexcodes.com/learn/gold-lot-size) - [Curve Fitting: How to Tell If Your Trading Strategy Is Overfit](https://forexcodes.com/learn/curve-fitting-overfitting) - [Can ChatGPT Write a Profitable Trading Strategy?](https://forexcodes.com/learn/can-chatgpt-write-trading-strategy) - [Pine Script Tables: How to Display Data on the Chart](https://forexcodes.com/learn/pine-script-tables-display-data) - [request.security_lower_tf(): How to Use Intrabar Data in Pine Script v6](https://forexcodes.com/learn/pine-script-request-security-lower-timeframe) - [Pine Script Libraries: How to Create, Publish, and Import Reusable Code](https://forexcodes.com/learn/pine-script-libraries-guide) - [var vs varip in Pine Script: Persistent Variables Explained](https://forexcodes.com/learn/pine-script-var-vs-varip) - [Pyramiding in Pine Script Strategies: How It Works and How It Distorts Backtests](https://forexcodes.com/learn/pine-script-pyramiding-explained) - [The Martingale Math: Why Doubling-Down EAs Always Blow Up Eventually](https://forexcodes.com/learn/martingale-math) - [Order Types Explained: Market, Limit, Stop, and Stop-Limit (and How Each Gets Filled)](https://forexcodes.com/learn/order-types-explained) - [Why Most Backtests Fail: The Seven Failure Modes, Ranked](https://forexcodes.com/learn/why-most-backtests-fail) - [Why Python Backtests Fail Live: The Common Culprits](https://forexcodes.com/learn/why-python-backtests-fail) - [Look-Ahead Bias in Python Backtests: How to Find and Fix It](https://forexcodes.com/learn/python-backtest-look-ahead-bias) - [Look-Ahead Bias in backtrader: the [1]-is-the-Future Trap](https://forexcodes.com/learn/backtrader-look-ahead-bias) - [Look-Ahead Bias in freqtrade: Informative Pairs and populate_indicators](https://forexcodes.com/learn/freqtrade-look-ahead-bias) - [Look-Ahead Bias in vectorbt: Same-Bar Execution in from_signals](https://forexcodes.com/learn/vectorbt-look-ahead-bias) - [pandas .shift() for Trading Signals: +1 vs -1 (and Why It Matters)](https://forexcodes.com/learn/pandas-shift-trading-signals) - [backtrader vs vectorbt vs freqtrade: Which Python Backtester?](https://forexcodes.com/learn/backtrader-vs-vectorbt-vs-freqtrade) - [Data Leakage in Machine-Learning Trading Strategies](https://forexcodes.com/learn/data-leakage-ml-trading) - [Same-Bar Execution: The Silent Python Backtest Bug](https://forexcodes.com/learn/same-bar-execution-python) - [Walk-Forward Analysis in Python: a Practical Guide](https://forexcodes.com/learn/walk-forward-analysis-python) - [Modeling Commission and Slippage in Python Backtests](https://forexcodes.com/learn/commission-slippage-python-backtest) - [backtrader Line Indexing Explained: [0], [-1], and the [1] Bug](https://forexcodes.com/learn/backtrader-indexing-explained) - [freqtrade startup_candle_count Explained](https://forexcodes.com/learn/freqtrade-startup-candle-count) - [Is My Python Trading Strategy Overfit? How to Tell](https://forexcodes.com/learn/is-my-python-strategy-overfit) - [Common vectorbt Mistakes That Inflate Your Backtest](https://forexcodes.com/learn/vectorbt-common-mistakes) - [How to Verify a Backtest Report You Didn't Run](https://forexcodes.com/learn/how-to-verify-a-backtest-report) - [Backtest Integrity Checks: Catching a Report That Contradicts Itself](https://forexcodes.com/learn/backtest-integrity-checks) - [The Drop-the-Best-Trades Test: Is Your Edge One Lucky Trade?](https://forexcodes.com/learn/drop-the-best-trades-test) - [The Backtest Metrics That Flatter a Strategy (and What to Read Instead)](https://forexcodes.com/learn/backtest-metrics-that-lie) - [Before You Buy a Trading Strategy: A Backtest Verification Checklist](https://forexcodes.com/learn/buying-a-trading-strategy-checklist) - [Monte Carlo Trade Shuffling: How Lucky Was Your Backtest's Ordering?](https://forexcodes.com/learn/monte-carlo-trade-shuffling) - [Risk of Ruin: What Monte Carlo Reveals That a Single Backtest Hides](https://forexcodes.com/learn/risk-of-ruin-explained) - [Is Your Equity Curve Skill or Luck? The Reshuffle Test](https://forexcodes.com/learn/equity-curve-luck-or-skill) - [Why Your Backtest's Max Drawdown Is Probably an Underestimate](https://forexcodes.com/learn/backtest-drawdown-underestimate) - [Block Bootstrap for Trading: Respecting Streaks When You Resample](https://forexcodes.com/learn/block-bootstrap-trading) - [Probability of Backtest Overfitting (PBO): The Number Every Optimizer Should Report](https://forexcodes.com/learn/probability-of-backtest-overfitting) - [How to Detect Overfitting in an MT5 or TradingView Optimization](https://forexcodes.com/learn/detect-overfitting-optimizer) - [The Multiple-Testing Haircut: Why Trying 500 Variants Inflates Your Best Sharpe](https://forexcodes.com/learn/multiple-testing-haircut-trading) - [White's Reality Check & Hansen SPA: Did Your Best Strategy Actually Beat Luck?](https://forexcodes.com/learn/whites-reality-check-explained) - [The Optimization Overfitting Trap: When Curve-Fitting Looks Like Alpha](https://forexcodes.com/learn/optimization-overfitting-trap) - [NinjaScript Repainting: Why OnEachTick Strategies Lie in Backtests](https://forexcodes.com/learn/ninjascript-repainting) - [Calculate.OnEachTick vs OnBarClose in NinjaScript](https://forexcodes.com/learn/calculate-oneachtick-vs-onbarclose) - [IsFirstTickOfBar in NinjaScript: The Repaint Fix](https://forexcodes.com/learn/isfirsttickofbar-explained) - [Look-Ahead Bias in NinjaScript (CurrentBar + N and Beyond)](https://forexcodes.com/learn/ninjascript-look-ahead-bias) - [Multi-Series Look-Ahead in NinjaScript: AddDataSeries Done Right](https://forexcodes.com/learn/ninjascript-multi-series-lookahead) - [Why Your NinjaTrader Backtest Doesn't Match Live](https://forexcodes.com/learn/ninjatrader-backtest-vs-live) - [NinjaScript Bar Indexing: barsAgo, CurrentBar, and the Gotchas](https://forexcodes.com/learn/ninjascript-barsago-indexing) - [Setting Stop-Loss and Profit Target in NinjaScript](https://forexcodes.com/learn/ninjascript-stop-loss-target) - [Market Replay vs Strategy Analyzer: Which NinjaTrader Backtest to Trust](https://forexcodes.com/learn/ninjatrader-market-replay-vs-strategy-analyzer) - [NinjaScript OnStateChange Explained: SetDefaults, Configure, Historical, Realtime](https://forexcodes.com/learn/ninjascript-onstatechange-explained) - [Common NinjaScript Mistakes That Break Your Backtest](https://forexcodes.com/learn/ninjascript-common-mistakes) - [Tick Replay in NinjaTrader: When You Need It and When It Repaints](https://forexcodes.com/learn/tick-replay-ninjatrader-explained) ## Pine Script errors - [Undeclared identifier ''](https://forexcodes.com/pine-errors/undeclared-identifier) - [Mismatched input '' expecting ''](https://forexcodes.com/pine-errors/mismatched-input-end-of-line) - [Cannot use 'plot' in local scope](https://forexcodes.com/pine-errors/cannot-use-plot-in-local-scope) - [Could not find function or function reference 'study'](https://forexcodes.com/pine-errors/could-not-find-function-study) - [Add to Chart operation failed, reason: line N: Cannot call 'operator +' with argument of type 'series string'](https://forexcodes.com/pine-errors/add-to-chart-operator-plus-series-string) - [Syntax error at input 'end of line without line continuation'](https://forexcodes.com/pine-errors/end-of-line-without-line-continuation) - [line N: Script requesting too many securities. The limit is 40.](https://forexcodes.com/pine-errors/script-requesting-too-many-securities-limit-40) - [Pine cannot determine the referencing length of a series. Try using max_bars_back in the study or strategy function.](https://forexcodes.com/pine-errors/max-bars-back-referencing-length) - [The function 'ta.ema' should be called on each calculation for consistency. It is recommended to extract the call from this scope.](https://forexcodes.com/pine-errors/function-should-be-called-on-each-calculation) - [Cannot call 'ta.sma' with argument 'length'='series int'. The argument 'length' of 'ta.sma' should be of type 'simple int'.](https://forexcodes.com/pine-errors/cannot-call-ta-sma-series-int-simple-int) - [Loop is too long (> 500 ms).](https://forexcodes.com/pine-errors/loop-is-too-long-500ms) - [The requested historical offset (N) is beyond the historical buffer's limit (M).](https://forexcodes.com/pine-errors/requested-historical-offset-beyond-buffer) ## Policies - [The Strategy Health Score™ Standard](https://forexcodes.com/standard): the open scoring methodology — the four-level severity model, the exact penalty formula, the bands, and the bar for a "Verified by ForexCodes" seal (score ≥ 90, no critical/high). Code correctness only, never profitability - [Editorial standards](https://forexcodes.com/editorial-standards): how examples are validated, our no-performance-claims policy, corrections - [Privacy](https://forexcodes.com/privacy) · [Terms](https://forexcodes.com/terms) Software & education only — not financial advice. Trading involves substantial risk of loss. © Veltrix Technology LLC.