Skip to content
All library documents

Long-Only Strategy Using Crossovers Among Three Configurable Moving Averages

Article Strategy library · Author: BigBitsIO

Summary

This Pine Script tutorial presents a long-only market-order strategy built around three moving averages. Each average has configurable period, type, price source, and chart resolution; available types include simple, exponential, weighted, volume-weighted, and several smoothed variants. The script also exposes controls for enabling trades on each of the three pairwise crossover combinations. Its strategy declaration allows one layer of pyramiding and sizes orders as a percentage of account equity.

The excerpt contains visualization and forecast-related settings as well as the beginning of a function that selects the requested moving-average calculation. However, the source is cut off before the crossover conditions and order-management rules are shown, so the exact entry trigger and any exit behavior cannot be confirmed. The document provides no backtest settings, results, or discussion of trading costs and risk. Moving-average crossovers are lagging signals and can produce repeated entries in sideways markets; the visible setup therefore explains configurable strategy construction more than demonstrated profitability.

Key ideas

  • The strategy configures three moving averages with selectable calculation types, periods, data sources, and resolutions.
  • Users can enable long trades based on crossovers between each pair of averages.
  • The strategy is configured for market orders, equity-based sizing, and limited pyramiding.
  • The provided excerpt omits the crossover and order logic, so the full trading rules are unavailable.
  • No backtest evidence is presented, and crossover signals may lag or whipsaw in range-bound markets.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.