PROTECTED SOURCE SCRIPT

Auto Div ADX STO RSI (Flip+P) v2

46
This strategy combines multi-indicator divergence detection, momentum confirmation and adaptive position management into a unified automated trading framework.

It identifies regular bullish and bearish divergences using RSI and Stochastic (K), with configurable confirmation logic (RSI+STO, RSI only, or STO only). Divergences are validated only when price forms a lower low / higher high while the oscillator forms a higher low / lower high within a user-defined lookback window.

To filter low-quality setups, the strategy applies an ADX trend strength requirement, ensuring signals are taken only when market conditions reflect sufficient directional energy. Optional stochastic filters (oversold/overbought K levels) can further refine long and short entries.

Once a valid signal appears, the system supports Automatic Flip Logic:

If a bullish divergence forms during a short position, the strategy closes the short and flips long.

If a bearish divergence forms during a long position, it closes the long and flips short.

Position sizing uses adaptive pyramiding: the initial flip takes size proportional to the opposite side’s accumulated units, and new signals in the same direction can add incremental units (scale-in) if enabled. This models progressive conviction as new divergence signals occur.

All entries can optionally be required to confirm on bar close.
Alerts are included for both Long and Short entries.

Key Features
• Automatic detection of RSI and Stochastic divergences
• User-selectable confirmation rules (RSI, STO, or both)
• ADX-based strength filter
• Optional Stochastic K oversold/overbought filters
• Full flip logic between Long and Short
• Dynamic pyramiding and configurable scale-ins
• Bar-close confirmation option
• Alerts for Long/Short entries
• Status-line visualization of ADX, RSI, Stochastic, and unit cycles

This strategy is designed for traders who want a structured, divergence-based model enhanced with trend strength filtering and flexible position management logic, suitable for systematic discretionary trading or fully automated execution.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。