What Is MA-DNA?
MA-DNA [AlgoFuego] is an advanced, data-driven trend indicator designed to help traders analyze market direction, generate actionable entry and exit signals, and test strategies — all from within a single integrated tool on TradingView.
Unlike conventional moving averages that rely on a single calculation formula, MA-DNA combines four widely-used moving average types with adaptive noise-reduction techniques, producing a smoother and more reliable trend line — ideal for both systematic traders and discretionary analysts.
The result is a unified system that handles trend identification, signal generation, trade management, and performance measurement without requiring any external tools or additional scripts.
“A composite moving average that balances responsiveness and stability — reducing short-term noise while preserving long-term trend clarity.” — MA-DNA Algorithm · AlgoFuego
The MA-DNA Algorithm
At the heart of this indicator lies the proprietary MA-DNA algorithm — a custom moving average calculated as the average of four core moving average types over a user-defined period:
- SMA → Simple Moving Average
- EMA → Exponential Moving Average
- WMA → Weighted Moving Average
- SMMA → Smoothed Moving Average
This composite approach balances the responsiveness of faster averages with the stability of slower ones. After computing the blended value, the result is further processed through adaptive noise-reduction algorithms — producing an ultra-smooth trend line that reacts meaningfully to shifting market conditions without being distorted by short-term price fluctuations.
What Makes MA-DNA Different?
Traditional moving averages force traders to choose between responsiveness and stability. A fast EMA reacts quickly but generates false signals in choppy markets. A slow SMA is stable but lags significantly at reversals. MA-DNA resolves this tradeoff by blending all four types simultaneously:
- Multi-MA Integration — The MA-DNA value is derived from the average of SMA, EMA, WMA, and SMMA over a user-defined period, inheriting the strengths of each type while mitigating individual weaknesses.
- Adaptive Noise Reduction — Additional processing minimizes short-term market noise after the composite average is calculated, improving signal clarity for trend assessment without introducing excessive lag.
- Trend Confirmation Tooling — Optional filter moving averages validate entry and exit signals based on overall trend direction, reducing false entries in counter-trend conditions.
Traders can freely choose among five MA types (including MA-DNA itself), adjust calculation lengths, and select any price source — giving full flexibility to tailor the indicator to diverse strategies and instruments.
Customizable Moving Averages
MA-DNA provides two layers of moving average customization: a primary MA used for signal generation, and optional filter MAs used for entry and exit confirmation.
For each moving average, traders can configure:
- Visibility — Toggle the display of the moving average on the chart independently.
- Type — Select from MA-DNA algorithm, SMA, EMA, WMA, or SMMA.
- Source — Choose any price series as the calculation basis: Close, Open, High, Low, HL2, HLC3, OHLC4, and others.
- Length — Set the number of bars used in the calculation to match your trading timeframe and strategy rhythm.
- Color Coding — Assign distinct bullish and bearish colors with optional background fill between MAs to visually highlight trend direction at a glance.
Integrated Backtesting & Trade Simulation
MA-DNA doesn't simply reveal trends — it also supports complete strategy testing and simulation directly on the TradingView chart. No external code, no data exports, no third-party tools required.
The backtesting engine allows traders to configure every dimension of the simulation:
- Trade Direction — Run simulations in Long-only, Short-only, or both directions simultaneously.
- Entry Based On — Define what triggers a trade entry: price crossovers, MA crossovers, or other configurable signal conditions.
- Exit Based On — Define what closes a trade: signal-based exits triggered by the MA system, or bar-count exits that hold a position for a fixed number of bars.
- Entry Filter — Require that entry signals align with the direction of a selected filter MA before a trade is opened — reducing entries against the prevailing trend.
- Exit Filter — Require that exit signals align with the filter MA direction before a position is closed — avoiding premature exits during strong trend phases.
Risk Management — Stop-Loss & Take-Profit
MA-DNA includes a complete trade-level risk management layer that renders visually on the chart at every trade:
- Stop-Loss — Enable or disable with a configurable percentage distance from the entry price. The stop level is plotted directly on the chart as a labeled horizontal line at each trade.
- Take-Profit — Enable or disable with a configurable percentage distance. The target level is similarly visualized at each active trade position.
- Entry Level — The exact entry price is marked with a labeled line, giving a clear visual structure for every simulated trade.
- Label Sizes — Adjust label display sizes from Tiny to Huge across all trade markers for readability at any zoom level.
- Color Customization — Fully configurable colors for entry, stop-loss, and take-profit lines to match your personal chart style.
Commission-Aware Backtesting
To ensure backtesting results reflect real-world trading conditions, MA-DNA supports configurable commission simulation:
- Entry Commission % — A percentage fee applied when entering a position.
- Exit Commission % — A separate percentage fee applied when closing the position.
All profit, loss, and compound return calculations in the performance table adjust automatically when commission is enabled — preventing inflated theoretical results and giving an accurate picture of net strategy performance after trading costs.
Performance Statistics Table
A comprehensive performance summary panel renders directly on the TradingView chart, displaying all key strategy metrics without leaving the indicator interface. The table can be toggled on or off, repositioned anywhere on the screen, and customized for text size and visual style.
Metrics displayed in the performance table include:
- Signal Type — Shows the active backtesting configuration: trade side combined with the entry-to-exit trigger type.
- Number of Trades — Total trades executed, broken down into winning and losing trades.
- Returns — Maximum, minimum, and average return per trade across the full backtest period.
- Win Rate — Percentage of trades that closed profitably.
- Compound Return — The compounded growth of total equity across all trades, displayed both before and after commission depending on settings.
- Bars Left — A forward-looking counter showing how many bars remain until the current open trade is scheduled to close under bar-count exit mode.
Trade Visualization & Candle Coloring
MA-DNA enhances chart readability through multiple simultaneous visual layers designed to make both historical analysis and real-time monitoring intuitive at a glance:
- Entry & Exit Markers — Every trade entry and exit is plotted on the chart with labeled visual markers.
- Stop-Loss & Take-Profit Lines — Risk levels are drawn directly at each trade position, showing the exact structure of every simulated trade.
- Dynamic Candle Coloring — Candles change color automatically based on the current trade state: Long trades use the configured Up Color, Short trades use the Down Color, and neutral periods use the Neutral Color. This makes historical trade sequences immediately recognizable without scanning through individual markers.
Alert System
MA-DNA supports four independently configurable real-time alert types, ensuring traders receive only the notifications relevant to their active strategy:
- Entry Alert — Triggers when a new trade entry signal is generated by the active MA configuration.
- Exit Alert — Triggers when the current position is closed by a signal-based or bar-count exit condition.
- Stop-Loss Alert — Triggers when price reaches the defined stop-loss level of an active trade.
- Take-Profit Alert — Triggers when price reaches the defined take-profit target of an active trade.
Each alert type can be enabled or disabled individually through TradingView's native alert system, with push notification and email delivery available — keeping traders informed on any timeframe without continuously monitoring the chart.
How to Use: Step-by-Step
Follow this sequence to implement MA-DNA correctly from the first session:
- Step 1 — Add the Indicator. Apply MA-DNA [AlgoFuego] to any TradingView chart from the Invite-Only Scripts section after subscribing. The indicator functions on every asset class and timeframe without additional configuration to begin.
- Step 2 — Select MA Settings. Choose the moving average type (MA-DNA, SMA, EMA, WMA, or SMMA), set the calculation length, and select the price source that best aligns with your trading style. Start with the MA-DNA algorithm on the default length to observe its composite smoothing behavior before customizing.
- Step 3 — Identify Trend Direction & Reversals. Monitor the MA-DNA line color and slope direction for real-time trend confirmation. Color transitions signal potential reversals. The adaptive noise filter prevents false color flips caused by short-term price volatility.
- Step 4 — Configure Backtesting Parameters. Select trade direction (Long or Short), define entry triggers, and set exit conditions by signal or bar count. Enable entry and exit filters to reduce false signals and improve overall signal quality in trending conditions.
- Step 5 — Set Risk Parameters. Define stop-loss and take-profit levels as percentage distances from the entry price. Enable commission simulation with separate entry and exit fee percentages to reflect realistic trading costs in all performance calculations.
- Step 6 — Review the Performance Table. Analyze the on-chart statistics panel — win rate, trade count, average return, and compound growth — to evaluate the strategy before deploying capital. Adjust MA length and settings to optimize for your specific market and timeframe.
- Step 7 — Enable Real-Time Alerts. Activate Entry, Exit, Stop-Loss, and Take-Profit alerts individually. Alerts deliver push notifications or emails so signals are never missed, even when the chart is not actively monitored.
- Step 8 — Monitor Candle Colors & Trade Levels. Use dynamic candle coloring to instantly distinguish active Long, Short, and Neutral periods in both live and historical contexts. The plotted trade levels provide clear visual confirmation of trade structure at every point in history.
Technical Specifications
Complete technical details for integration and deployment on TradingView:
- Platform: TradingView
- Language: Pine Script v6
- Supported Timeframes: All timeframes (1-minute to Monthly)
- Supported Assets: Forex, Cryptocurrency, Stocks, Commodities, Indices
- MA Types: MA-DNA Algorithm · SMA · EMA · WMA · SMMA
- Backtesting Modes: Long · Short · Both
- Exit Modes: Signal-Based · Bar-Count
- Alert Types: Entry · Exit · Stop-Loss · Take-Profit (individually configurable)
- Commission Simulation: Separate entry and exit commission percentages
- Performance Table: On-chart with repositioning and size controls
- Updates: Lifetime updates included with active subscription
- Last Updated: January 2025
Settings Reference
MA-DNA organizes all configurable parameters into four logical modules:
- MA Settings — Visibility toggle, MA type, price source, calculation length, bullish/bearish color coding, and optional background fill between MA lines to highlight trend direction.
- Backtesting Parameters — Trade direction (Long/Short), entry trigger definition, exit condition mode (signal or bar count), number of bars for bar-count exits, entry filter MA selection, and exit filter MA selection.
- Trade & Risk Settings — Stop-loss toggle with percentage input, take-profit toggle with percentage input, entry and exit commission percentages, label size selection (Tiny to Huge), and full color customization for all trade level markers.
- Table & Display Settings — Performance table visibility toggle, on-screen position selection (Top Right, Bottom Center, etc.), text size setting, frame and border color customization, and dynamic candle coloring toggle with Up, Down, and Neutral color configuration.
Who Should Use MA-DNA?
MA-DNA is designed for three distinct trader profiles:
- Trend-Focused Traders who want a smooth, noise-resistant trend line that reacts meaningfully to directional shifts without generating excessive false signals in choppy markets.
- Strategy Builders & Analysts who need on-chart backtesting and performance measurement to validate trend-following approaches without exporting data or writing external code.
- Systematic Traders who value a single, integrated framework where trend logic, signal generation, risk management, and trade simulation are unified into one tool — reducing complexity and setup time across different markets and timeframes.
Important Disclosure
MA-DNA [AlgoFuego] is a technical analysis and strategy testing tool — not a guaranteed profit system. While this indicator provides actionable, measurable statistical insights, past performance is not necessarily indicative of future results. Many factors influence trading success beyond any single indicator. Always apply sound risk management practices and treat backtested performance as a research input, not a prediction of future returns.