Buy Sell Signal
Nov 28, 2025

The Buy Sell Signal indicator provides a comprehensive trend-following framework that combines EMA crossovers with dynamic, volatility-based risk management to automate trade entry and exit planning. It identifies momentum shifts while calculating real-time stop loss and take profit targets based on market volatility.
Usage
The Usage section explains how to implement the tool's core logic for trade execution and monitoring.
Trend Identification and Entry
The script uses a dual Exponential Moving Average (EMA) crossover system. A "BUY" signal is generated when the Fast EMA crosses above the Slow EMA, and a "SELL" signal is triggered when it crosses below. Users can enable the "Require candle confirmation" setting to ensure the signal is only valid if the candle closes in the direction of the trend (e.g., a bullish close for a long signal), which helps filter out noise in sideways markets.
Dynamic Risk Management
Once a signal is confirmed, the indicator automatically calculates exit levels:
- Stop Loss: Placed based on the Average True Range (ATR) multiplied by a user-defined factor. This ensures stops are wider during high volatility and tighter during low volatility.
- Take Profit: Calculated using a fixed Risk:Reward ratio relative to the distance of the stop loss.
- Intermediate Targets: The script automatically plots intermediate TP levels (TP1, TP2, etc.) if the Risk:Reward ratio is set high enough to accommodate multiple units of risk.
Trade Monitoring
Visual cues on the chart indicate the status of active positions:
- Dashed White Line: Represents the entry price.
- Red/Green Lines: Represent active Stop Loss and Take Profit levels.
- Visual Icons: Displays a target (🎯) for TP hits and a cross (❌) for SL hits.
- Invalidation: A diamond icon appears if a position is closed because an opposite trend signal appeared before price reached the SL or TP.
Details
The script is built on the concept of momentum following combined with volatility-adjusted exits. Unlike static crossover systems, this tool treats risk management as a dynamic component. By using the ATR for stop placement, it accounts for the "noise" of the specific asset being traded.
The script also features a built-in state machine to track active positions. It prevents multiple signals from cluttering the chart by only allowing one active trade direction at a time. If a "BUY" signal occurs while a "SHORT" position is active, the script automatically invalidates the short and initiates the long, reflecting a shift in market sentiment.
Settings
- Fast EMA: Sets the period for the responsive moving average used for trend detection.
- Slow EMA: Sets the period for the baseline moving average.
- ATR Period: Defines the lookback window for the Average True Range volatility calculation.
- SL Multiplier (ATR): Adjusts how many multiples of ATR the stop loss is placed away from the entry or swing point.
- Risk:Reward (R:R): Determines the distance of the final Take Profit target relative to the Stop Loss distance.
- Require candle confirmation: When enabled, requires the price to close in the direction of the crossover before a signal is plotted.
- EMAs Group: Options to toggle the visibility and colors of the Fast and Slow EMA lines.
FAQ
How do I adjust the indicator for different trading styles? For scalping, users typically lower the EMA lengths (e.g., 5 and 13) and use lower timeframes like 5-minute or 15-minute charts. For swing trading, higher EMA lengths and higher timeframes (4H or Daily) are recommended to capture broader trends.
What does the "INV" signal mean? "INV" stands for Invalidated. This occurs when the trend direction changes (EMA crossover in the opposite direction) before your Stop Loss or Take Profit was hit, signaling that the original trade thesis is no longer valid.
How can I get access to the Buy Sell Signal tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.