TetraTrend Engine [MarkitTick]💡 The TetraTrend Engine is an advanced, multifaceted overlay indicator designed to provide traders with a comprehensive view of market structure, trend direction, and institutional liquidity levels. By capturing and freezing critical moving average data at a user-defined moment in time, it transforms lagging indicators into static support and resistance frameworks. Furthermore, it integrates a sophisticated Multi-Timeframe (MTF) confluence matrix, ADX-based chop filtering, and dynamic position sizing, making it a complete suite for methodical trade execution. Please note that if applied to non-standard charts (like Heikin Ashi or Renko), the script's calculations may repaint.
✨ Originality and Utility
Standard moving averages constantly adjust to new price data, which is useful for trailing trends but less effective for identifying historical break-and-retest zones. This script introduces a novel "Freeze Point" mechanic. At a specific, fixed date and time, the engine captures the exact values of four distinct moving averages and the Average True Range (ATR). These values are then projected forward as horizontal levels, creating a persistent architectural map of the market based on a fundamental historical event (like an earnings report, macroeconomic news release, or structural pivot). Combined with an Auto-Anchored VWAP that automatically initiates from this exact freeze date, it offers a highly unique, institutional-grade perspective on volumetric average price versus static historical momentum.
🔬 Methodology and Concepts
● Core Trend Identification
The indicator calculates four separate moving averages, with default lengths of 20, 50, 100, and 200.
Users can toggle the calculation method between Simple (SMA), Exponential (EMA), Weighted (WMA), and Volume-Weighted (VWMA) moving averages.
● The Freeze Engine
A timestamp is set by the user (defaulting to a specific date like "2025-12-31 23:59").
Once the market time crosses this threshold, the script triggers a state where calculations are locked.
It records the exact values of the four MAs and the 14-period ATR at that exact candle.
● Institutional Confluence and Risk Matrix
The script checks higher timeframe (HTF) trend alignment using a primary HTF filter (defaulting to Daily).
An optional MTF Matrix requires alignment across three custom timeframes (e.g., 240m, Daily, Weekly) before validating any bullish signals.
It incorporates an ADX threshold (default 20.0) to filter out choppy, ranging markets, ensuring signals are only generated during periods of active momentum.
🎨 Visual Guide
● Chart Overlays and Lines
MA 1 (Length 20): Plotted in bright Cyan (#00E5FF).
MA 2 (Length 50): Plotted in Teal (#14B5CB).
MA 3 (Length 100): Plotted in Royal Blue (#2979FF).
MA 4 (Length 200): Plotted in Purple (#AA00FF).
Freeze Marker: A vertical line (default Dashed, colored Gray/Blue) denotes the exact moment the historical levels were captured.
Anchored VWAP: If enabled, an Orange line (#FFB74D) plots the volume-weighted average price starting precisely from the Freeze Marker.
● Dynamic Liquidity Zones
If enabled, semi-transparent shaded bands appear around Frozen Level 1 and Frozen Level 4.
These bands represent a distance of 0.5 * Frozen ATR, illustrating expected volatility boundaries at the time of the freeze.
● Analytics Dashboard
A heads-up display table is drawn in the top-right corner, displaying a dark theme with blue/gray borders.
It lists the HTF Trend Status (Bullish in Green, Bearish in Red).
It displays the current Market State (Trending/Active vs. Chop/Low Vol) based on the ADX.
It shows current Volatility (ATR) and ADX Strength.
If enabled, it outlines the MTF Matrix Status and the mathematically calculated Dynamic Position Size.
● Signal Shapes and Labels
A green triangle pointing up (#00E676) plots below the bar when a valid Long signal is generated.
Dynamic labels attach to the right side of the frozen levels, constantly updating to show the MA length and exact price level.
📖 How to Use
● Setting the Anchor
Identify a major market event on your chart (a swing high/low, a CPI data release, or a sudden volume spike).
Open the settings and input the exact date and time of this event into the "Fixed Date/Time (Freeze Point)" input.
● Interpreting Signals
Wait for the market to interact with the freshly drawn horizontal frozen levels.
A valid Long signal (Green Triangle) will only trigger if: the price crosses above Frozen Level 1, the HTF trend is bullish, the market is not ranging (ADX > threshold), and the optional MTF matrix is fully aligned.
Monitor the Analytics Dashboard table to ensure the broader market environment supports the trade setup.
⚙️ Inputs and Settings
• Moving Average Settings
Length 1 through 4: Adjust the lookback periods for the core trend calculation.
MA Type: Dropdown to select the mathematical smoothing method (SMA, EMA, WMA, VWMA).
• Advanced Filters & Risk
Primary HTF Filter: Determines the baseline higher timeframe to establish the primary trend direction.
ADX Chop Filter Threshold: Sets the minimum ADX value required to consider the market "trending" rather than "ranging".
Risk/Reward Ratio: A multiplier used to automatically calculate Take Profit 1, 2, and 3 targets based on the dynamically calculated Stop Loss distance.
• Institutional Features (Optional)
Enable Auto-Anchored VWAP: Anchors a VWAP strictly starting from the chosen Freeze Date.
Enable MTF Confluence Matrix: Requires alignment across three separate, user-defined timeframes.
Enable Dynamic Position Sizing: Inputs for Account Size ($) and Risk Per Trade (%). The script uses the ATR-based stop loss to output exact contract/share sizing required to maintain strict risk parameters.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The TetraTrend Engine leverages several established quantitative and statistical concepts to derive its signals. Moving averages serve as low-pass filters, dampening high-frequency market noise to reveal the underlying directional component of the time series. By capturing these values statically at a user-defined vector (the Freeze Point), the script transitions from dynamic time-series analysis to fixed architectural support/resistance theory, positing that historical mean values at critical temporal nodes retain psychological and institutional relevance.
Furthermore, the integration of the Average Directional Index (ADX) relies on the statistical measurement of trend velocity and momentum dispersion. The ADX component acts as a volatility gatekeeper, mathematically ensuring that the standard deviation of directional movement exceeds a baseline threshold before capital is deployed. Position sizing calculations utilize the Average True Range (ATR)—a measure of absolute price dispersion—to dynamically scale risk exposure inversely to market volatility, ensuring normalized risk parity across varied market environments.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
Indicatore Pine Script®






















