OPEN-SOURCE SCRIPT

MoneyLine Cipher

172
MoneyLine Cipher
Overview
MoneyLine Cipher is a trend-following indicator designed to identify high-probability entry and exit points by combining multiple technical analysis methods into a unified signal system. The indicator adapts its behavior based on current market conditions, becoming more aggressive in strong trends and more conservative in choppy or uncertain markets.
Core Concept: The Money Line
At the heart of this indicator is the Money Line, a linear regression line that acts as a dynamic center of price action. Unlike a simple moving average, linear regression fits a straight line through recent prices using least-squares methodology, providing a smoother representation of the underlying trend direction. The slope of this line determines whether the market is in a bullish, bearish, or neutral state.
Dynamic Envelope Bands
The indicator plots upper and lower bands around the Money Line using Average True Range (ATR) as the volatility measure. What makes these bands unique is their adaptive multiplier system. When the ADX (Average Directional Index) indicates a strong trend, the bands automatically widen to accommodate larger price swings and avoid premature exits. In ranging or weak trend conditions, the bands contract to provide tighter entry and exit zones. This dynamic adjustment helps the indicator perform consistently across different market environments.
Trend State Detection
The indicator classifies market conditions into five distinct states: Strong Uptrend, Uptrend, Neutral, Downtrend, and Strong Downtrend. This classification uses three complementary methods working together.
First, the Directional Movement Index (DMI) measures the spread between positive and negative directional indicators. A large positive spread suggests bullish momentum, while a large negative spread indicates bearish pressure.
Second, On-Balance Volume (OBV) confirms whether volume supports the indicated trend direction. For a Strong Uptrend classification, OBV must be rising above its moving average, confirming that buying pressure backs the price movement.
Third, ADX must exceed a minimum threshold for Strong trend classifications, ensuring that only genuinely trending markets receive the Strong designation.
Signal Generation
Buy and sell signals are generated using Fisher Transform and Aroon indicators, but with a crucial enhancement: the trigger thresholds adjust dynamically based on the current trend state.
The Fisher Transform converts price data into a Gaussian normal distribution, making turning points easier to identify. In a Strong Uptrend, the buy threshold relaxes (making buys easier to trigger) while the sell threshold tightens (making sells harder to trigger). This allows traders to stay in winning positions longer during favorable conditions. The opposite applies in downtrends, where the system becomes quick to exit and reluctant to enter long positions.
The Aroon indicator measures how recently price made a new high or low within the lookback period. Combined with Fisher Transform, this dual-confirmation approach reduces false signals that might occur when using either indicator alone.
Band touches also generate signals. When price reaches the lower band, a potential buy zone is identified. When price reaches the upper band, a potential sell zone is flagged.
Cascade Protection System
A key feature is the built-in protection against averaging down into a losing position. The system tracks consecutive buy signals and limits them to a configurable maximum (default: 3). After reaching this limit, no additional buy signals are generated until a sell signal resets the counter. This prevents the common mistake of repeatedly buying during a sustained decline.
Additionally, the indicator monitors Bollinger Band Width Percentile (BBWP), which measures current volatility relative to historical volatility. When BBWP exceeds a threshold (indicating a volatility spike often associated with sharp moves), buy signals are temporarily frozen. This protects against entering during panic selloffs or blow-off tops.
Extreme Move Detection
Sometimes price moves so aggressively that it penetrates the bands by an unusual amount. The indicator detects these extreme moves and can generate signals even during normal cooldown periods. The logic is that an extreme band penetration represents a significant overextension that warrants attention regardless of recent signal history. These extreme signals are visually distinguished from regular signals.
RSI Divergence
The indicator includes RSI divergence detection as an additional confirmation tool. When price makes a lower low but RSI makes a higher low (bullish divergence), it suggests weakening downside momentum and a potential reversal. Bearish divergence (price higher high, RSI lower high) warns of potential tops. Both regular and hidden divergences are detected and marked on the chart.
Signal Cooldown
To prevent overtrading and signal clustering, a configurable cooldown period prevents new signals for a set number of bars after each signal. This spacing ensures that each signal represents a distinct trading opportunity rather than repeated triggers on the same price movement.
Visual Display
The indicator provides a comprehensive information panel showing current trend state, BBWP status, consecutive buy count, ADX reading, Fisher and Aroon values, cooldown status, and current dynamic thresholds. An ADX bar at the bottom of the chart provides quick visual reference for trend strength and direction using color coding.
Signal labels display the entry or exit price along with the current buy count (for buy signals), helping traders track their position sizing.
How to Use
In uptrending markets, look for buy signals near the lower band, particularly when the trend state shows Uptrend or Strong Uptrend. These represent pullback opportunities within an established trend.
In downtrending markets, the indicator naturally reduces buy signals and increases sell sensitivity, helping traders avoid catching falling knives.
In neutral or ranging conditions, signals from both directions are generated with moderate thresholds, suitable for mean-reversion trading within the bands.
Monitor the BBWP and consecutive buy counter in the info panel. If BBWP shows "FROZEN" or the buy counter approaches the maximum, exercise additional caution with new long entries.
Settings Guidance
The default settings are optimized for 5-minute cryptocurrency charts but can be adjusted for other timeframes and assets. Key parameters to consider adjusting include the Money Line length (shorter for more responsive, longer for smoother), ATR multiplier range (wider bands reduce signals but improve accuracy), and the various threshold values for trend classification.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.