OPEN-SOURCE SCRIPT
Updated

FXMC Breakout with Strict Single Signal

63
It's designed to help traders identify and act on breakouts from the first candle of the trading day, with sophisticated options for managing trades and booking profits.

Understanding the "FXMC Breakout with Strict Single Signal" Indicator
This indicator, aptly named "FXMC Breakout with Strict Single Signal," is a powerful tool for day traders. It focuses on a popular strategy: trading the high and low of the first X-minute candle of the trading session. What makes this version particularly useful is its emphasis on clean, non-repetitive signals and its integration of multiple advanced exit strategies.

Core Concept: First Candle Breakout
The fundamental idea is simple: the first candle of the trading day (often the 5-minute or 15-minute candle) sets an important range. A breakout above its high suggests bullish momentum, while a break below its low suggests bearish momentum.

Here's how the script establishes this:

Adjustable First Candle: You can select the duration of this "first candle" directly from the indicator's settings (e.g., 1-minute, 5-minute, 15-minute, etc.). This makes it versatile for different markets and strategies.
Session Time: You define your trading session (e.g., "0915-1530" for Indian markets). The script will capture the high and low of the selected first candle only at the start of this session each day.
Daily Reset: At the beginning of each new day, all previous signals and trade states are reset, preparing the indicator for a fresh set of opportunities.
Visualizing the Range: Once identified, the high (green line) and low (red line) of this first candle are plotted as horizontal lines that extend throughout the trading day, clearly marking your breakout levels.
Entry Signals: Once per Direction, Per Day
The script generates clear entry signals:

Buy Entry (Green Up-Triangle): Appears when the price closes above the first candle's high.
Sell Entry (Orange Down-Triangle): Appears when the price closes below the first candle's low.
Strict Single Signal: A key feature is that you'll only see one Buy Entry and one Sell Entry signal per day. If a buy signal triggers, the script won't generate another buy signal until the trade is exited and a new opportunity arises (which would be the next day, as this strategy is typically intraday). Similarly for sell signals.
Advanced Exit Strategies: Multiple Options, Single Signal
This is where the indicator truly shines, offering robust ways to manage your trades once an entry has occurred. You can enable or disable these methods in the indicator settings:

Price Cross Back (Default Exit):

Long Trade Exit: If you're in a long position and the price closes back below the first candle's high, it signals an exit.
Short Trade Exit: If you're in a short position and the price closes back above the first candle's low, it signals an exit.
ATR Trailing Stop:

Volatility-Adjusted: This stop loss automatically adjusts to market volatility. When you enter a trade, a trailing stop is set a certain multiple of the Average True Range (ATR) away from the entry price.
Protects Profits: As the price moves in your favor, the stop trails behind it, locking in profits while still allowing room for normal market fluctuations. It never moves against your position.
Exit Trigger: An exit signal is generated if the price closes back beyond this trailing stop level.
RSI Exit (Overbought/Oversold):

Momentum Based: Uses the Relative Strength Index (RSI) to identify extreme momentum conditions.
Long Trade Exit: If you're long and the RSI moves above a user-defined "overbought" level (e.g., 70 or 80), it suggests the upward move might be exhausted, prompting an exit.
Short Trade Exit: If you're short and the RSI moves below a user-defined "oversold" level (e.g., 30 or 20), it suggests the downward move might be overdone, prompting an exit.
EMA Crossover Exit:

Trend Reversal: This uses two Exponential Moving Averages (EMAs) – a fast one and a slow one.
Long Trade Exit: If you're long and the fast EMA crosses below the slow EMA, it indicates a potential shift to a bearish trend, signaling an exit.
Short Trade Exit: If you're short and the fast EMA crosses above the slow EMA, it indicates a potential shift to a bullish trend, signaling an exit.
Single Exit Signal (Crucial Improvement): Just like entries, you'll only see one exit signal (an "X" mark) per trade. The script tracks your implied position (long, short, or flat). Once you're in a trade, it continually checks all enabled exit conditions. The first condition met will trigger the single exit signal, flatten your implied position, and reset for the next trading day.
Visual Aids and Alerts
Background Colors: The chart background changes color to indicate if the indicator is currently in a simulated Long position (light green) or Short position (light orange). This gives you a quick visual overview of the trade's duration.
Plotting Trailing Stop (Optional): You can see the ATR trailing stop line dynamically adjust on your chart when a position is active, providing clear visualization of your protective stop.
Alerts: The indicator is equipped with alerts for both entries and exits, so you can be notified in real-time when signals occur without constantly watching the chart.
How to Use It
Add to Chart: Apply the indicator to any intraday chart (e.g., 1-minute, 5-minute, 15-minute).
Adjust Settings: Open the indicator's settings (Inputs tab) to:
Set your desired "First Candle Timeframe."
Define your "Session Time."
Enable or disable each of the "Exit Conditions" (ATR, RSI, EMA) and customize their parameters to fit your trading style and the asset you're analyzing.
Analyze Signals: Observe the entry and exit signals, along with the background colors, to understand the indicator's proposed trades.
This robust indicator provides a comprehensive framework for a first-candle breakout strategy, offering clear signals and dynamic trade management, all with a focus on a clean, uncluttered chart.
Release Notes
It's designed to help traders identify and act on breakouts from the first candle of the trading day, with sophisticated options for managing trades and booking profits.

Understanding the "FXMC Breakout with Strict Single Signal" Indicator
This indicator, aptly named "FXMC Breakout with Strict Single Signal," is a powerful tool for day traders. It focuses on a popular strategy: trading the high and low of the first X-minute candle of the trading session. What makes this version particularly useful is its emphasis on clean, non-repetitive signals and its integration of multiple advanced exit strategies.

Core Concept: First Candle Breakout
The fundamental idea is simple: the first candle of the trading day (often the 5-minute or 15-minute candle) sets an important range. A breakout above its high suggests bullish momentum, while a break below its low suggests bearish momentum.

Here's how the script establishes this:

Adjustable First Candle: You can select the duration of this "first candle" directly from the indicator's settings (e.g., 1-minute, 5-minute, 15-minute, etc.). This makes it versatile for different markets and strategies.
Session Time: You define your trading session (e.g., "0915-1530" for Indian markets). The script will capture the high and low of the selected first candle only at the start of this session each day.
Daily Reset: At the beginning of each new day, all previous signals and trade states are reset, preparing the indicator for a fresh set of opportunities.
Visualizing the Range: Once identified, the high (green line) and low (red line) of this first candle are plotted as horizontal lines that extend throughout the trading day, clearly marking your breakout levels.
Entry Signals: Once per Direction, Per Day
The script generates clear entry signals:

Buy Entry (Green Up-Triangle): Appears when the price closes above the first candle's high.
Sell Entry (Orange Down-Triangle): Appears when the price closes below the first candle's low.
Strict Single Signal: A key feature is that you'll only see one Buy Entry and one Sell Entry signal per day. If a buy signal triggers, the script won't generate another buy signal until the trade is exited and a new opportunity arises (which would be the next day, as this strategy is typically intraday). Similarly for sell signals.
Advanced Exit Strategies: Multiple Options, Single Signal
This is where the indicator truly shines, offering robust ways to manage your trades once an entry has occurred. You can enable or disable these methods in the indicator settings:

Price Cross Back (Default Exit):

Long Trade Exit: If you're in a long position and the price closes back below the first candle's high, it signals an exit.
Short Trade Exit: If you're in a short position and the price closes back above the first candle's low, it signals an exit.
ATR Trailing Stop:

Volatility-Adjusted: This stop loss automatically adjusts to market volatility. When you enter a trade, a trailing stop is set a certain multiple of the Average True Range (ATR) away from the entry price.
Protects Profits: As the price moves in your favor, the stop trails behind it, locking in profits while still allowing room for normal market fluctuations. It never moves against your position.
Exit Trigger: An exit signal is generated if the price closes back beyond this trailing stop level.
RSI Exit (Overbought/Oversold):

Momentum Based: Uses the Relative Strength Index (RSI) to identify extreme momentum conditions.
Long Trade Exit: If you're long and the RSI moves above a user-defined "overbought" level (e.g., 70 or 80), it suggests the upward move might be exhausted, prompting an exit.
Short Trade Exit: If you're short and the RSI moves below a user-defined "oversold" level (e.g., 30 or 20), it suggests the downward move might be overdone, prompting an exit.
EMA Crossover Exit:

Trend Reversal: This uses two Exponential Moving Averages (EMAs) – a fast one and a slow one.
Long Trade Exit: If you're long and the fast EMA crosses below the slow EMA, it indicates a potential shift to a bearish trend, signaling an exit.
Short Trade Exit: If you're short and the fast EMA crosses above the slow EMA, it indicates a potential shift to a bullish trend, signaling an exit.
Single Exit Signal (Crucial Improvement): Just like entries, you'll only see one exit signal (an "X" mark) per trade. The script tracks your implied position (long, short, or flat). Once you're in a trade, it continually checks all enabled exit conditions. The first condition met will trigger the single exit signal, flatten your implied position, and reset for the next trading day.
Visual Aids and Alerts
Background Colors: The chart background changes color to indicate if the indicator is currently in a simulated Long position (light green) or Short position (light orange). This gives you a quick visual overview of the trade's duration.
Plotting Trailing Stop (Optional): You can see the ATR trailing stop line dynamically adjust on your chart when a position is active, providing clear visualization of your protective stop.
Alerts: The indicator is equipped with alerts for both entries and exits, so you can be notified in real-time when signals occur without constantly watching the chart.
How to Use It
Add to Chart: Apply the indicator to any intraday chart (e.g., 1-minute, 5-minute, 15-minute).
Adjust Settings: Open the indicator's settings (Inputs tab) to:
Set your desired "First Candle Timeframe."
Define your "Session Time."
Enable or disable each of the "Exit Conditions" (ATR, RSI, EMA) and customize their parameters to fit your trading style and the asset you're analyzing.
Analyze Signals: Observe the entry and exit signals, along with the background colors, to understand the indicator's proposed trades.
This robust indicator provides a comprehensive framework for a first-candle breakout strategy, offering clear signals and dynamic trade management, all with a focus on a clean, uncluttered chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.