Skip to content
All library documents

HalfTrend Signals with Session Filtering and Deferred Entries

Article Strategy library · Author: YashikaSatya

Summary

This strategy implements a HalfTrend indicator using recent highs and lows, moving averages, and an ATR-based channel deviation. Changes in the internal trend state produce buy and sell signals. The configurable amplitude and channel deviation shape the indicator, while the strategy assigns the full specified equity percentage to positions.

A session filter limits entries and exits to a user-selected trading window in the Asia/Kolkata timezone. Signals that occur before the window are latched, with the latest pending direction carried to the first bar of the session unless a live signal occurs there. The excerpt ends just as the entry and exit rules begin, so it does not show how positions are actually opened, closed, or managed after a signal. It provides no backtest settings, performance results, or discussion of costs, and the code alone cannot establish that the session handling or indicator produces a profitable strategy.

Key ideas

  • HalfTrend direction changes generate buy and sell signals from price extrema and smoothed highs and lows.
  • The indicator uses an ATR-based channel whose deviation and amplitude are configurable.
  • Entries and exits are gated by a configurable session in the Asia/Kolkata timezone.
  • The most recent pre-session signal can be carried to the session open.
  • The supplied excerpt omits the actual order rules and gives no performance evidence.

Tags

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