What Is AVA Backtest?
AVA Backtest [AlgoFuego] is a comprehensive technical analysis and strategy testing tool built around the proprietary Advanced Volatility Activator (AVA) algorithm. Unlike conventional trend-following indicators that apply static formulas to price data, AVA evaluates how price moves — classifying each candle's volatility structure before applying adaptive smoothing to produce a trend line that reflects real market expansion and contraction, not just raw price levels.
The result is a unified platform covering three interconnected functions: volatility-adaptive trend identification, configurable trade simulation, and quantified performance analytics — all rendered directly within TradingView, with no external data exports or custom scripting required.
“By blending adaptive volatility metrics with a refined moving-average algorithm, AVA offers traders a dynamically responsive framework for trend identification — designed for both novice and advanced traders seeking data-driven decision-making.” — Amit, Lead Developer & Market Strategist, AlgoFuego
The AVA Algorithm — Volatility Structure Analysis
The foundation of the indicator is the AVA algorithm, which processes market data through two sequential layers: candle structure classification and exponential volatility smoothing.
In the first layer, each candle's high-low relationship is evaluated against the preceding bar and classified into one of four structural types that represent the market's current volatility state:
- Inside Bars — High and low contained within the prior bar. Signals volatility contraction; the market is consolidating.
- Outside Bars — High and low both exceed the prior bar. Signals volatility expansion; range is widening in both directions.
- Higher Highs — High exceeds the prior bar's high without a new low. Signals directional bullish pressure.
- Lower Lows — Low breaks the prior bar's low without a new high. Signals directional bearish pressure.
These four classifications drive specialized volatility-weighted averages that encode the character of each bar's price movement — not just its position. In the second layer, an exponential volatility filter smooths these raw classifications, suppressing isolated spikes and choppy oscillations. The trend line updates meaningfully only when sustained structural changes accumulate — producing a significantly more stable output than standard adaptive averages in ranging market conditions.
AVA Settings — Sensitivity & Length Control
Two parameters govern the AVA algorithm's behavior and allow calibration to any market environment or trading timeframe:
- Sensitivity — Controls how reactive the trend line is to volatility structure changes. Higher values produce faster responses to expansion events; lower values filter more aggressively, producing fewer but higher-confidence signals. Start at the default and adjust after observing behavior on your target market.
- Length — Sets the moving average period used to smooth volatility classifications and model trend direction. Use shorter values for high-frequency scalping setups; increase Length for swing or position strategies where noise tolerance is higher.
- Up Color / Down Color — Independent color controls for bullish and bearish trend states, allowing immediate visual identification of trend direction changes on the chart.
Integrated Backtesting Engine
AVA Backtest includes a fully self-contained trade simulation engine that runs directly on the TradingView chart. It applies the AVA trend logic to the full visible bar history, generating a complete record of simulated trades based on the configured entry and exit rules. No external tools, spreadsheets, or scripts are required.
Entry Logic
Two entry trigger modes are available, each responding to a different interaction between price and the AVA trend structure:
- AVA Signal — Entry triggers when the AVA trend line itself flips direction: from bearish to bullish for Long entries, or from bullish to bearish for Short entries. This mode responds to internal trend state changes driven by accumulated volatility structure, and tends to produce earlier, higher-frequency entries.
- AVA Cross — Entry triggers when price crosses above (for Long) or below (for Short) the AVA trend line. This mode responds to price interacting with the trend structure rather than the line's own direction, and tends to produce entries that are confirmed by price behavior.
Exit Logic
Exit conditions are configured independently from entry logic, enabling flexible asymmetric setups:
- AVA Signal Exit — Closes the trade when the AVA trend line flips against the position direction.
- AVA Cross Exit — Closes when price crosses back through the AVA trend line against the active position.
- Bar Count Exit — Closes the trade automatically after a specified number of bars from entry, regardless of signal state. Enables time-limited holding period strategies and is useful for limiting exposure on slow-developing instruments.
Risk Management — Stop-Loss & Take-Profit
Every simulated trade can be equipped with percentage-based stop-loss and take-profit levels applied symmetrically from the entry price. Both levels are fully optional and independently toggled — allowing traders to test pure signal-based strategies, risk-bounded strategies, or target-defined strategies with equal ease.
- Stop-Loss % — Defines the maximum adverse move the simulation will tolerate before closing the trade as a loss.
- Take-Profit % — Defines the target gain at which the trade closes as a winner, independent of the exit signal state.
When enabled, stop-loss and take-profit levels are rendered as labeled horizontal lines directly on the chart for every trade, with fully configurable colors and label sizes ranging from Tiny to Huge.
Commission Simulation
AVA Backtest supports independent entry and exit commission percentage inputs to model real broker trading costs. When enabled, all profit and loss figures, win rate calculations, and compound return metrics in the performance table automatically incorporate these fees — producing accurate, non-inflated results that reflect the net economics of live trading with your actual execution costs.
- Entry Commission % — Applied at the open of each simulated trade.
- Exit Commission % — Applied at the close of each simulated trade.
Visual Trade Markers & Candle Coloring
AVA Backtest enhances chart readability through a multi-layer visualization system that renders every simulated trade directly on price history:
- Trade Level Lines — Entry, stop-loss, and take-profit levels are plotted as labeled horizontal lines for each trade, color-coded and sized according to user configuration.
- Entry & Exit Markers — Labeled markers are placed at each signal trigger and trade close point, providing a complete visual record of the backtesting sequence.
- Dynamic Candle Coloring — Candles automatically adopt a configurable color based on the active trade state: the Up Color during Long trades, Down Color during Short trades, and a neutral color during flat periods. This creates instant visual clarity when reviewing long backtesting histories.
Performance Statistics Table
A comprehensive on-chart analytics panel automatically updates after every completed trade, delivering a quantified summary of the full backtesting session without requiring any external tools:
- Signal Type — Displays the active configuration: trade direction combined with entry and exit mode (e.g., “Long · AVA Signal → AVA Cross”).
- Total Trades — Total number of simulated positions taken across the visible chart history.
- Wins & Losses — Count of profitable and unprofitable trades separately.
- Maximum Return — Best single-trade return recorded across the backtest.
- Minimum Return — Worst single-trade return recorded.
- Average Return — Mean return per trade across all completed positions.
- Win Rate % — Percentage of total trades that closed profitably.
- Compound Return — Cumulative compounded equity growth across all simulated trades, displayed before and after commission where applicable.
- Bars Left — Number of bars remaining until the current open trade is expected to close under the active exit logic.
The table's position, text size, and frame colors are fully customizable. It can be toggled on or off independently of all other indicator components.
Real-Time Alert System
Four independent alert types allow traders to monitor live signals without continuous chart observation. Each alert can be enabled or disabled individually, ensuring notifications are limited to the events relevant to the active strategy:
- Entry Alert — Triggers when entry conditions are met and a new simulated trade would open.
- Exit Alert — Triggers when exit conditions are met and the current position would close.
- Stop-Loss Alert — Triggers when price reaches the defined stop-loss threshold.
- Take-Profit Alert — Triggers when price reaches the defined take-profit target.
Alerts integrate with TradingView's standard notification system, supporting push notifications, email, and webhook delivery.
Long & Short Simulation Modes
The backtesting engine operates independently in Long or Short mode, allowing traders to evaluate directional strategy performance in isolation. Running the same configuration in both modes on the same market and timeframe reveals which directional bias the AVA algorithm's historical signals align with more effectively — providing objective data to inform whether a market is better suited to trend-following from the long or short side.
Modular Architecture
Every component of AVA Backtest is independently toggleable. The indicator can be used as a pure volatility-adaptive trend visualization tool — displaying only the AVA line with directional coloring — or as a complete trade simulation and analytics platform with all modules active simultaneously. This modularity allows AVA Backtest to serve as a trend filter within an existing strategy or as the primary analytical framework for a fully rules-based trading approach.
How to Use: Step-by-Step
Follow this sequence to implement AVA Backtest correctly from the first session:
- Step 1 — Add the Indicator. Apply AVA Backtest [AlgoFuego] to any TradingView chart from the Invite-Only Scripts section after subscribing. It is immediately operational on any asset and timeframe without additional configuration.
- Step 2 — Configure AVA Settings. Adjust Sensitivity and Length to match the volatility profile of your target market. Observe the historical flip frequency on the AVA line before configuring the backtesting engine to understand the signal character.
- Step 3 — Select Trade Direction & Entry Trigger. Choose Long or Short depending on the directional hypothesis you want to test. Select AVA Signal mode for internal trend-flip entries or AVA Cross mode for price-interaction entries. Test both and compare results.
- Step 4 — Configure Exit Logic. Set the exit condition independently from the entry. Use Signal or Cross exits for dynamic closes, or Bar Count for fixed holding periods. Combine with optional entry/exit filters to reduce false signals in flat markets.
- Step 5 — Set Risk Parameters. Enable stop-loss and take-profit and define their percentage distances. Start with wider stops during initial research to avoid excessive exits distorting the signal statistics. Enable commission simulation and enter your actual broker fee percentages.
- Step 6 — Enable Visual Markers. Turn on Trade Levels and candle coloring. Observe how each trade unfolded against the price action to evaluate whether the AVA signal captured meaningful moves or produced false entries.
- Step 7 — Review the Performance Table. Analyze total trades, win rate, per-trade returns, and compound equity growth. Iterate systematically — adjust Sensitivity and Length, compare Signal vs Cross, test Long vs Short — and document the configurations that produce the most consistent results on your specific market.
- Step 8 — Activate Alerts & Go Live. Once the backtested configuration shows statistically meaningful results, enable only the alert types relevant to your strategy. Receive push or email notifications through TradingView so no signal is missed when away from the chart.
Technical Specifications
- Platform: TradingView
- Language: Pine Script v6
- Timeframes: All timeframes supported
- Supported Assets: Forex, Cryptocurrency, Stocks, Commodities, Indices
- Candle Structure Types: Inside Bar · Outside Bar · Higher High · Lower Low
- Entry Trigger Modes: AVA Signal · AVA Cross
- Exit Modes: AVA Signal · AVA Cross · Bar Count
- Trade Directions: Long & Short (independent simulation)
- Risk Controls: Percentage-based Stop-Loss & Take-Profit
- Commission Simulation: Separate Entry % and Exit % inputs
- Alert Types: Entry · Exit · Stop-Loss · Take-Profit (individually configurable)
- Performance Table: On-chart · Fully customizable position, size, and colors
- Updates: Lifetime updates included with active subscription
- Last Updated: January 2025
Default Configuration Reference
- Trade Side: Long
- Entry Trigger: AVA Signal (trend flip)
- Exit Mode: AVA Signal
- Stop-Loss: Disabled (toggleable with % input)
- Take-Profit: Disabled (toggleable with % input)
- Commission: Disabled (Entry % + Exit % inputs available)
- Bar Color: Enabled (Long / Short / Neutral states)
- Performance Table: Enabled, Top-Right position
Important Disclosure
AVA Backtest [AlgoFuego] is a technical analysis and strategy testing tool — not a guaranteed profit system. While this indicator provides actionable, statistically measurable insights into volatility-adaptive trend strategies, past backtested performance is not necessarily indicative of future results. Market conditions are also shaped by fundamental events, macroeconomic developments, and sentiment shifts that purely technical systems do not account for. Always apply sound risk management practices alongside any technical tool, and treat backtested metrics as a starting point for hypothesis refinement rather than a performance guarantee.