Skip to content
All library documents

A Multi-Period Price Change Strategy with Smoothed Directional Signals

Article TradingView scripts

Summary

This strategy measures whether the selected price is above or below its value at the start of each four-hour, daily, weekly, and monthly period. Each comparison becomes a positive, negative, or neutral vote, and the four votes are summed. A 60-bar simple moving average smooths that combined score. The strategy opens a long position when the smoothed score crosses above 2 and closes it once the score falls below zero; it opens short below −2 and closes short above zero. Background colors visualize directional conditions.

The logic is a multi-horizon trend-following approach, but the document offers no performance statistics, cost assumptions, asset-specific analysis, or validation procedure. Its signals can lag because they use a moving average, while thresholds and period definitions may behave differently across chart timeframes and instruments. The source sizes positions at 100 percent of equity and includes no explicit stop-loss or volatility-based sizing, so the code alone does not establish suitable risk controls or expected returns.

Key ideas

  • The strategy compares price with the start of four different calendar periods.
  • Each comparison contributes a directional vote, and their sum is smoothed with a moving average.
  • Long and short entries require threshold crossovers, with exits triggered at less extreme levels.
  • Background coloring displays the smoothed directional state.
  • No performance validation or explicit stop-loss and volatility-based sizing is provided.

Tags

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