PROTECTED SOURCE SCRIPT

MACD 直方图背离 + 连续N柱动能 + 量能/RSI 过滤(4周期版)

30
Strategy Overview (Concise English Description)
This trading script is built for Pine Script v6. It combines classic divergence detection with several trade-management safeguards to deliver fewer, higher-quality signals.

Core Signal Logic

MACD Histogram Divergence on up to four configurable time-frames (15 min, 30 min, 1 h, 4 h by default).

A trade is allowed if any selected timeframe shows a bullish or bearish divergence and its histogram bars move in the same direction for N consecutive candles (user-set per timeframe).

Context Filters

Volume filter: current volume must exceed a moving-average threshold (MA × multiplier).

RSI direction filter: RSI must be rising (for longs) or falling (for shorts).

Entry Controls

Cooldown: enforces a minimum number of minutes between new entries.

No pyramiding: just one position at a time.

Position Management

Minimum holding time: bars cannot be closed until a user-defined number of minutes has elapsed.

Fixed take-profit / stop-loss: expressed as percentages of entry price.

Optional trailing stop: activates once price moves a specified distance in favor; exits if it pulls back by a set offset.

Execution Details

Runs intrabar (calc_on_every_tick = true) and can send live orders, not just on bar close.

Uses fixed position size (1 contract) and applies a 0.05 % commission assumption.

Overall, the script targets clear momentum reversals confirmed by divergence, then layers on volume/RSI validation and strict timing rules to avoid over-trading and premature exits.Total Net Profit: +8,370,812.29 USDT (+837.08%)

Max Drawdown: 1,516,712.90 USDT (25.48%)

Total Trades: 700

Winning Trades: 36.71% (257 out of 700)

Profit Factor: 1.524

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。