SMA Directional Matrix

Sep 8, 2020

Static chart image
Moving Averages
Works on the following platforms:
tradingviewSymbolTradingView
For free use on the TradingView platform
ninjatraderNinjaTrader
For free use on the NinjaTrader platform
metatrader4MetaTrader 4
For free use on the MetaTrader 4 platform
metatrader5MetaTrader 5
For free use on the MetaTrader 5 platform
thinkorswimThinkorswim
For free use on the Thinkorswim platform

This script was collaboratively created with alexgrover to provide traders with a straightforward and stylish panel that reveals the direction of simple moving averages over a user-defined range of periods (Min, Max). The panel displays the period of each simple moving average, alongside a symbol indicating its direction, simplifying the analysis of market trends for both novice and experienced traders.

Configuration Options

  • Min: Defines the minimum period of the moving average.
  • Max: Sets the maximum period for analyzing moving averages.
  • Src: Selects the input source for the moving averages.
  • Number Of Columns: Configures the number of columns in the panel, beneficial when utilizing a broad range of periods.

How to Utilize the Moving Average Direction Panel

Monitoring the direction of moving averages of varied periods provides valuable insights into the overall market sentiment across short, mid, and long terms. It can indicate whether the market is experiencing a trend or is range-bound, aiding in forming a robust trading strategy.

indicator image

In our example using periods from 25 to 50, shorter moving averages are responsive to the recent price increase, whereas longer-term moving averages still reflect an earlier downward movement. This divergence reveals potential discrepancies, enabling traders to detect shorter-term changes against a longer trend backdrop.

The indicator thus offers crucial insight into trend clarity. A trend without retracements will show alignment across mid-to-long term moving averages, all pointing in the same direction. In contrast, the presence of retracements means mid-term averages might counter the prevailing trend, signaling caution.

indicator image

In range-bound markets, expect the panel to showcase a balanced count of rising and falling moving averages, hinting at indecision or equilibrium in market forces.

Troubleshooting

Using a wide range of periods may trigger a "String is too long" error. To resolve, adjust the Min or Max values to narrow the period range. If faced with a "Loop is too long to execute" error, resetting the settings and reapplying your desired configurations often helps.

FAQ

How do I access the Moving Average Direction Panel indicator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

What can cause errors in the script execution?

Errors such as "String is too long" or "Loop is too long to execute" might occur if the range of periods is too extensive. Adjusting the range can help minimize these errors.

Trading is risky and many will lose money in connection with trading 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 markets 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 for charting platforms, 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 or tool we provide.

Charts used on this site are by TradingView in which the majority of our tools 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.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2025 LuxAlgo Global, LLC.