Scripting Tutorial 9 - TManyMA Strategy - Long Market Order Only

Oct 22, 2019

Static chart image
Dynamic Overlays
Signals
Forecasting
Moving Averages

The TManyMA Strategy indicator provides a triple moving average trading system that enables users to backtest long-only crossover strategies with highly customizable smoothing types, multi-timeframe resolutions, and predictive forecasting.

Usage

The Usage section describes how the script can be used to identify trend shifts and execute automated strategy tests. Users can enable up to three distinct moving averages to find confluence or crossover signals.

  • Strategy Execution: The script automatically enters long positions using market orders when a faster MA crosses over a slower MA. It exits these positions when the faster MA crosses back under. By default, the strategy utilizes 100% of equity for each trade.
  • Visual Crossovers: When enabled, the indicator plots labeled icons on the chart detailing exactly which moving averages crossed (e.g., "50 SMA crossed over 200 SMA").
  • Ribbons: If the moving averages share the same type, resolution, and source, the script generates 10 intermediate ribbons (5 between MA1/MA2 and 5 between MA2/MA3). These are alpha-color coded to visualize the spread and trend strength between the primary levels.
  • Forecasting: The tool projects moving average values five bars into the future. This can be adjusted based on a "Bias" setting to simulate how the averages might react to anticipated bullish, bearish, or neutral market movements.

Details

The script is built to handle complex calculations across multiple timeframes using request.security. It supports eight different smoothing methods: RMA, SMA, EMA, WMA, HMA, DEMA, TEMA, and VWMA.

The forecasting logic uses a weighted approach based on the Average True Range (ATR) to apply "Bias Magnitude." If a Bullish bias is selected, the forecast adds an ATR-based value to the projection; a Bearish bias subtracts it. This allows traders to see potential crossover timings before they occur based on specific volatility expectations.

Settings

Moving Average Settings (MA1, MA2, MA3)

  • Period: Sets the lookback period for the specific moving average.
  • Type: Selects the calculation method (e.g., SMA, EMA, HMA).
  • Source: Determines the price data used (Close, Open, HL2, etc.).
  • Resolution: Sets the timeframe for the calculation, allowing for multi-timeframe analysis on a single chart.
  • Visible: Toggles the visibility of the specific moving average.

Forecasting & Strategy

  • Show Crosses: Toggles the display of descriptive labels at crossover points.
  • Forecast Bias: Adjusts the directional assumption for the 5-bar projection (Neutral, Bullish, or Bearish).
  • Forecast Bias Period/Magnitude: Controls the sensitivity and volatility calculation for the forecasted lines.
  • Show Ribbons: Toggles the intermediate transition lines between the primary moving averages.
  • Trade MA Crosses: Individual toggles (1-2, 1-3, 2-3) to determine which specific crossovers trigger strategy entries and exits.

FAQ

How do I change the timeframe of only one moving average? You can use the "Resolution" dropdown in the settings menu for MA1, MA2, or MA3 to select a specific timeframe like "1D" or "4h" regardless of your current chart interval.

Why are the ribbons not appearing on my chart? Ribbons only appear when the moving averages being compared share the same Type, Resolution, and Source. Ensure these settings match to enable the ribbon calculations.

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

Free access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

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.