OPEN-SOURCE SCRIPT
[COG] Platypus

[COG] Platypus
Overview
Platypus is a volume momentum indicator that combines price action, volume analysis, and multi-timeframe confirmation to generate trade signals. Unlike traditional volume indicators, Platypus reconstructs volume momentum by factoring in price velocity, volatility adjustment, and market structure to identify true institutional momentum shifts.
The indicator features a comprehensive filtering system including EMA alignment, background state confirmation, and optional multi-timeframe filters to eliminate false signals and ensure you only trade with the strongest momentum.
Key Features
✅ Volume Momentum Calculation
Volatility-Adjusted Volume: Normalizes volume relative to recent volatility periods
Quiet Market Filtering: Reduces noise during low-activity periods
Spike Detection: Identifies abnormal volume surges with boosted weighting
Momentum Smoothing: EMA-based smoothing prevents erratic signals
✅ Entry Pattern Detection
3-Bar Pattern Requirement: RED → GREEN → GREEN for buys (opposite for sells)
State Management: Prevents consecutive signals in same direction without reset
Background Confirmation: Must align with bullish/bearish market state
EMA Alignment Filter: Ensures trend structure supports the trade direction
✅ Multi-Timeframe Filtering System
HTF Closed Bar Filter: Confirms last closed higher timeframe bar matches direction (no repaint)
HTF Momentum Filter: Requires current HTF bar to match direction (live, prevents delayed entries)
Dual-Filter Capability: Use both filters for maximum precision
✅ Dashboard
Real-time Status Monitoring: Volume trend, background state, EMA order, trade state
Filter Status Display: Shows HTF filter conditions and signal permission
Pattern Detection: Indicates when 3-bar entry pattern is forming
✅ On-Chart Integration
50/100/200 EMAs: Automatically plotted on price chart with customizable colors
Visual Entry Markers: Triangle signals appear on price chart at entry points
Signal Alerts: Built-in alert conditions for all signal types
📚 Core Settings Explained
Pine Script®
Signal Period (Default: 8): Controls the smoothing of the signal line (blue line). Lower values = more responsive, higher values = smoother but slower to react.
Pine Script®
Volatility Period (Default: 20): Lookback period for volume and price range calculations. This period is used to normalize volume relative to recent market conditions.
Pine Script®
Price Filter MA Length (Default: 200): The SMA period used for background state determination. Price must be above this MA for bullish background, below for bearish background.
Advanced Settings
Pine Script®
Momentum Multiplier (Default: 50.0): Scales the final momentum score. Higher values = larger histogram bars and more sensitivity. Adjust based on your instrument's volatility.
Pine Script®
Momentum Smoothing (Default: 4): EMA period applied to raw momentum before normalization. Higher values reduce noise but add lag.
Pine Script®
Quiet Market Filter (Default: 0.3): During low-volume periods, this applies exponential dampening to momentum. Higher values = more aggressive filtering of weak moves.
Pine Script®
When volume is less than average + threshold, it squares the ratio (dampening), otherwise uses linear scaling.
Overview
Platypus is a volume momentum indicator that combines price action, volume analysis, and multi-timeframe confirmation to generate trade signals. Unlike traditional volume indicators, Platypus reconstructs volume momentum by factoring in price velocity, volatility adjustment, and market structure to identify true institutional momentum shifts.
The indicator features a comprehensive filtering system including EMA alignment, background state confirmation, and optional multi-timeframe filters to eliminate false signals and ensure you only trade with the strongest momentum.
Key Features
✅ Volume Momentum Calculation
Volatility-Adjusted Volume: Normalizes volume relative to recent volatility periods
Quiet Market Filtering: Reduces noise during low-activity periods
Spike Detection: Identifies abnormal volume surges with boosted weighting
Momentum Smoothing: EMA-based smoothing prevents erratic signals
✅ Entry Pattern Detection
3-Bar Pattern Requirement: RED → GREEN → GREEN for buys (opposite for sells)
State Management: Prevents consecutive signals in same direction without reset
Background Confirmation: Must align with bullish/bearish market state
EMA Alignment Filter: Ensures trend structure supports the trade direction
✅ Multi-Timeframe Filtering System
HTF Closed Bar Filter: Confirms last closed higher timeframe bar matches direction (no repaint)
HTF Momentum Filter: Requires current HTF bar to match direction (live, prevents delayed entries)
Dual-Filter Capability: Use both filters for maximum precision
✅ Dashboard
Real-time Status Monitoring: Volume trend, background state, EMA order, trade state
Filter Status Display: Shows HTF filter conditions and signal permission
Pattern Detection: Indicates when 3-bar entry pattern is forming
✅ On-Chart Integration
50/100/200 EMAs: Automatically plotted on price chart with customizable colors
Visual Entry Markers: Triangle signals appear on price chart at entry points
Signal Alerts: Built-in alert conditions for all signal types
📚 Core Settings Explained
signalPeriod = input.int(8, "Signal Period", minval=1, group="Core Settings")
Signal Period (Default: 8): Controls the smoothing of the signal line (blue line). Lower values = more responsive, higher values = smoother but slower to react.
volatilityPeriod = input.int(20, "Volatility Period", minval=1, group="Core Settings")
Volatility Period (Default: 20): Lookback period for volume and price range calculations. This period is used to normalize volume relative to recent market conditions.
priceFilterLength = input.int(200, "Price Filter MA Length", minval=1, group="Core Settings")
Price Filter MA Length (Default: 200): The SMA period used for background state determination. Price must be above this MA for bullish background, below for bearish background.
Advanced Settings
momentumMultiplier = input.float(50.0, "Momentum Multiplier", minval=20.0, maxval=80.0, step=2.0, group="Advanced")
Momentum Multiplier (Default: 50.0): Scales the final momentum score. Higher values = larger histogram bars and more sensitivity. Adjust based on your instrument's volatility.
momentumSmoothing = input.int(4, "Momentum Smoothing", minval=1, maxval=15, group="Advanced")
Momentum Smoothing (Default: 4): EMA period applied to raw momentum before normalization. Higher values reduce noise but add lag.
quietThreshold = input.float(0.3, "Quiet Market Filter", minval=0.0, maxval=1.0, step=0.05, group="Advanced")
Quiet Market Filter (Default: 0.3): During low-volume periods, this applies exponential dampening to momentum. Higher values = more aggressive filtering of weak moves.
volStrengthFactor = volRatio < (1.0 + quietThreshold) ? math.pow(volRatio, 2) : volRatio
When volume is less than average + threshold, it squares the ratio (dampening), otherwise uses linear scaling.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
CognitiveAlpha
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
CognitiveAlpha
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.