OPEN-SOURCE SCRIPT

[COG] Platypus

188
[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®
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.

Pine Script®
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.

Pine Script®
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

Pine Script®
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.

Pine Script®
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.

Pine Script®
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.

Pine Script®
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.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.