MA MACD BB BackTester
Jun 22, 2024

The MA MACD BB BackTester indicator provides a comprehensive environment for testing strategies based on Moving Averages, MACD, and Bollinger Bands within a single tool. It allows users to evaluate trend-following and mean-reversion setups over historical data to optimize their trading approach.
Usage
The Usage section focuses on selecting the underlying logic for the backtest and configuring the execution parameters.
- Strategy Selection: Users can toggle between three primary indicator logics: MACD (momentum-based), Moving Average (trend-following), and Bollinger Bands (volatility/mean-reversion).
- Directional Bias: The tool allows for either Long-only or Short-only backtesting to suit specific market regimes.
- Time Filtering: A built-in date range filter enables testing over specific historical periods, such as bull markets or high-volatility years.
- Position Sizing: The capital allocation setting determines how much of the account equity is used for each trade, allowing for realistic compounding or fixed-size simulations.
Details
The script executes trades based on specific technical triggers:
- MACD Logic: Long entries occur on a bullish crossover of the MACD and Signal lines, while exits occur on a bearish crossunder (and vice versa for shorting).
- MA Logic: Trades are entered when the price crosses over (long) or under (short) a simple moving average of a defined length.
- Bollinger Bands Logic: This mean-reversion strategy enters long when the price drops below the lower band and exits when the price touches the basis (median) line.
Settings
The settings are categorized to allow fine-tuning of each component:
- Core Configuration: Includes "Select Indicator" (MACD, BB, or MA) and "Select Long / Short" direction.
- Backtest Window: "SIP / Lumpsum Start Date" and "End Date" define the active period for the strategy.
- Capital Management: "Each position's capital allocation %" controls the trade quantity based on equity.
- MACD Parameters: Adjust "Fast Length", "Slow Length", "Signal Smoothing", and the source price.
- MA Parameters: "Moving Average Length" defines the lookback period for the trend line.
- Bollinger Bands Parameters: "Length" and "Multiplier" control the width and sensitivity of the bands.
FAQ
How do I use the MA MACD BB BackTester?
Select your preferred indicator and trading direction in the settings menu, then adjust the indicator lengths to see historical performance results on the TradingView Strategy Tester tab.
Can I test multiple indicators at the same time?
No, the script is designed to isolate the performance of one indicator (MA, MACD, or BB) at a time to help you identify which specific logic performs best for a given asset.
How can I get access to this 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.