All indicators

Moving Average Strategy of BiznesFilosof

May 20, 2019

Static chart image
SignalsMoving Averages

The Moving Average Strategy of BiznesFilosof indicator provides a versatile backtesting framework that identifies trend reversals and trade opportunities through customizable moving average crossovers. It is designed to assist traders in evaluating trend-following performance across various assets, with specific default optimizations for Bitcoin.

Usage

The Usage section describes how the script can be used, particularly for identifying entry and exit points based on the interaction between two moving averages.

  • Trend Identification: The primary signal is generated when a shorter-period moving average (MA2) crosses a longer-period moving average (MA1). A crossover (MA2 moving above MA1) signals a potential long entry, while a crossunder (MA2 moving below MA1) signals a potential short entry.
  • Asset Flexibility: While pre-configured for Bitcoin, the strategy can be applied to other financial instruments by adjusting the lengths and types of the moving averages to suit the specific volatility of the asset.
  • Directional Filtering: Users can toggle "Long off" or "Short off" settings to restrict the strategy to only one direction, which is useful in strongly trending markets or for traders who prefer to trade only on the long or short side.
  • Exit Logic: The strategy includes built-in exit conditions that trigger when the source price (or MA2) crosses back through MA1, allowing for dynamic profit taking or loss mitigation.

Details

The script calculates two distinct moving averages (MA1 and MA2) using either Simple (SMA) or Exponential (EMA) methods. A unique aspect of this strategy is the inclusion of "Length bars close" (lbars), which introduces a delay to the crossover signal. This can help filter out "noise" or whipsaws by requiring the crossover condition to persist or be evaluated based on historical bar data.

Visually, the indicator colors the main moving average (MA1) based on the relationship between the current price and the high/low moving average bounds. Green indicates the price is above the "High" MA, red indicates it is below the "Low" MA, and blue suggests a neutral or ranging state.

Settings

Timeframe Settings

  • Start/Finish Year, Month, Day: Defines the specific backtesting window. The strategy will only execute trades within this defined date range.

Moving Average Settings

  • Length MA1: Sets the lookback period for the primary trend-defining moving average.
  • Exponential MA1: Toggles between Simple Moving Average (SMA) and Exponential Moving Average (EMA) for the first MA.
  • Length MA2: Sets the lookback period for the secondary (shorter) moving average. Setting this to 1 effectively uses the current price as the trigger.
  • Exponential MA2: Toggles between SMA and EMA for the second MA.

Strategy Logic Settings

  • Length bars close: Introduces a delayed crossover check for exit conditions.
  • Short off: When enabled, the strategy will close long positions on a bearish cross instead of opening a new short position.
  • Long off: When enabled, the strategy will close short positions on a bullish cross instead of opening a new long position.

FAQ

How do I adjust the strategy for different market conditions? You can modify the "Length MA1" and "Length MA2" settings. Longer lengths generally filter out noise but lag more, while shorter lengths react faster to price changes but may result in more false signals.

What happens if I set Length MA2 to 1? If Length MA2 is set to 1, the strategy essentially tracks the current price crossing the primary moving average (MA1), turning it into a Price-MA crossover strategy.

How can I access this script? 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.