Role Reversal Detection Alert [MsF]
Mar 6, 2023

The Role Reversal Detection Alert [MsF] indicator is a specialized monitoring tool designed to identify and alert traders when price action confirms a support-to-resistance or resistance-to-support flip. It automates the observation of horizontal levels, ensuring users do not miss high-probability rebound setups commonly found in double top or double bottom patterns.
Usage
The script is primarily used to track potential role reversal setups around a user-defined price level. It operates on a two-step confirmation logic:
- Touch Phase: The price (including candle wicks) must first touch or penetrate the primary horizontal support/resistance line within a specified lookback period.
- Breakout Phase: After the initial touch, an alert is triggered only when a candle body closes beyond a secondary "alert judgment" band.
This mechanism filters out premature signals, requiring the market to demonstrate a clear rejection and subsequent momentum away from the level.
Details
The indicator constructs three visual reference lines:
- Base Line: The primary horizontal price level where the "role reversal" is expected to occur.
- Upper/Lower Bands: Offset lines calculated based on a pip range from the base line. These serve as the threshold for the alert judgment.
The logic incorporates a lookback window (defaulting to 18 bars) to check for the initial touch of the base line. For a long setup, the price must have dropped to or below the base line before closing above the upper band. For a short setup, the price must have risen to or above the base line before closing below the lower band.
Settings
- Input Horizontal Value: Sets the specific price level for the main horizontal base line.
- Band Range by pips: Determines the distance (in pips) from the base line to the secondary alert judgment lines.
- Line Color/Width: Customizes the visual appearance of the primary base line.
- Band Color/Width: Customizes the visual appearance of the upper and lower offset bands.
FAQ
How do I set up an alert for this indicator? You can use the built-in TradingView alert menu and select "Role Reversal Detection Alert [MsF]" as the condition. The script includes pre-configured alert conditions for both Long and Short role reversals.
What timeframe is best for detecting role reversals? While the indicator works on any timeframe, it is most commonly used on higher timeframes (like 1H, 4H, or Daily) where horizontal levels carry more historical significance.
How can I access Role Reversal Detection Alert [MsF]? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

