Simple moving average
Jan 30, 2026

The Custom AI Trader indicator identifies market trends and potential entry points using a dual-smoothed simple moving average system to filter noise and provide actionable buy/sell signals.
Usage
The Usage section describes how the script can be used, examples should be provided in this section. This section also focuses on how main settings affect the indicator interpretation and output.
- Trend Identification: The script colors the background based on the current price relationship to the smoothed moving average. A green background indicates a bullish trend (price above MA), while a red background indicates a bearish trend (price below MA).
- Signal Generation: Buy signals (green triangles and "BUY" labels) are triggered when the price crosses above the smoothed moving average. Sell signals (red triangles and "SELL" labels) are triggered when the price crosses below the smoothed moving average.
- Filtering Noise: Users can increase the "Trend MA Length" or "Smoothing" values to reduce the frequency of signals, which helps in avoiding "whipsaws" or false entries in sideways markets.
- Support/Resistance: If enabled, the indicator displays blue and red boxes based on the highest highs and lowest lows of the last 20 bars to highlight immediate supply and demand zones.
- Risk Management: The script can display automated Take Profit (TP) and Stop Loss (SL) targets based on fixed percentages relative to the current closing price to assist in trade planning.
Details
The script is a refactored version of the original work by @Wave-Trader. It utilizes a two-step smoothing process: first, it calculates a Simple Moving Average (SMA) of the closing price, and then it applies a second SMA to that result. This double-smoothing approach aims to create a more stable baseline for trend detection compared to a standard SMA.
The support and resistance zones are dynamically calculated using the ta.highest and ta.lowest functions over a 20-period lookback. Signals are processed on a bar-close basis to ensure validity, and built-in alert conditions are integrated for real-time notifications.
Settings
- Trend MA Length: Determines the period used for the initial Simple Moving Average calculation. Higher values result in a slower, more lagging trend line that filters more noise.
- Smoothing: Sets the period for the second SMA applied to the first MA. This adds additional lag but smooths out minor price fluctuations.
- Show Support/Resistance Zones: A toggle to enable or disable the visual boxes representing recent swing highs and lows.
- Show Targets: A toggle to display a floating label containing calculated Take Profit and Stop Loss levels.
FAQ
How do I adjust the sensitivity of the signals? You can adjust the sensitivity by changing the "Trend MA Length" and "Smoothing" inputs. Lowering these values will make the indicator more responsive to price changes, while increasing them will produce fewer, more conservative signals.
What do the colored background zones signify? The green background signifies that the price is currently trading above the smoothed moving average, indicating a bullish bias. A red background signifies price is below the average, indicating a bearish bias.
How can I access the Custom AI Trader? 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.

