INVITE-ONLY SCRIPT

Smoothed Kama MAD Bands | Oquant

36
Overview
The Smoothed KAMA MAD Bands indicator is a tool designed for traders seeking to identify trend directions and potential entry/exit points. It combines a smoothed version of the Kaufman Adaptive Moving Average (KAMA) with Mean Absolute Deviation (MAD) bands to create dynamic band levels. This indicator not only visualizes trend-following signals but also incorporates backtesting-like metrics to evaluate performance(remember past performance doesn’t guarantee future results), including risk-adjusted ratios. It supports long and short positions (with options to disable them), making it suitable for both bullish and bearish strategies. Alerts are included for bullish and bearish signals, and customizable tables display key metrics compared to a buy-and-hold benchmark.

Key Factors/Components
Smoothed KAMA: A core moving average that adapts to market volatility, smoothed for reduced noise and better trend identification.
MAD Bands: Dynamic bands based on mean absolute deviation, providing volatility-adjusted boundaries around the smoothed KAMA to signal bullish or bearish conditions.
Signal Generation: Produces long (bullish) and short (bearish) signals based on price interactions with the bands, visualized with color-coded plots and fills.
Performance Metrics: Calculates advanced metrics like Maximum Drawdown (including intra-trade), Sharpe Ratio, Sortino Ratio, Omega Ratio, Percent Profitable, Profit Factor, and Net Profit for the strategy, displayed in a table.
Buy & Hold Comparison: A separate table benchmarks the indicator's metrics against a simple buy-and-hold approach for the asset.
Equity Curve: Optional plot of the indicators equity growth.
Customization Options: Inputs for start date, lengths of various components, band multiplier, trade direction toggles, and display preferences.

How It Works
The indicator starts by computing an kaufman adaptive moving average (KAMA) that adjusts its sensitivity based on market volatility, then smooths it further. Volatility bands are added using a mean absolute deviation approach, scaled by a multiplier to form upper and lower boundaries. Signals are triggered when price crosses these bands: above the upper for longs (indicating upward momentum) and below the lower for shorts (indicating downward momentum). These signals drive a position allocator that simulates holding long, short, or cash. Metrics are derived from the simulated returns, focusing on risk-adjusted performance and drawdown(remember past performance doesn’t guarantee future results). Visual elements like colored plots, fills, and bar coloring highlight the current trend, while tables provide at-a-glance insights.

For Who Is Best/Recommended Use Cases
This indicator is best suited for trend-following traders or those managing strategies on crypto markets. It's recommended for users who want to evaluate trend signals with volatility-adjusted bands and backtest metrics to inform their decision-making process(Remember past performance doesn’t guarantee future results). Ideal for traders comfortable with adaptive averages, particularly in markets where noise reduction can help avoid false signals.

Settings and Default Settings
Start Date: Defines the backtesting start point (default: 1 Jan 2018).
Efficiency Length: Period for volatility efficiency calculation in KAMA (default: 10).
Kama Fast Length: Shorter period for adaptive sensitivity (default: 2).
Kama Slow Length: Longer period for adaptive sensitivity (default: 30).
Kama Smoothing Length: Smoothing period for the final KAMA (default: 10).
MAD Length: Period for mean absolute deviation calculation (default: 20).
Band Multiplier: Scaling factor for band width (default: 1.6).
Allow Long Trades: Toggle longs (default: true); if false, defaults to cash.
Allow Shorts: Toggle shorts (default: false); if false, defaults to cash.
Show Indicator Metrics Table: Display strategy metrics (default: true).
Show Buy&Hold Table: Display benchmark metrics (default: true).
Plot Equity Curve: Show simulated equity line (default: false).

Conclusion
The Smoothed KAMA MAD Bands indicator offers a robust blend of adaptive trend detection, volatility banding, and performance analytics, empowering traders to make data-driven decisions. By visualizing signals and quantifying risk-reward, it bridges technical analysis with quantitative evaluation, potentially enhancing strategy refinement. Whether used standalone or integrated into a broader system, it provides actionable insights while preserving flexibility.

⚠️ Disclaimer: This indicator is intended for educational and informational purposes only. Trading/investing involves risk, and past performance does not guarantee future results. Always test and evaluate indicators/strategies before applying them in live markets. Use at your own risk.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.