Skip to content
All library documents

Bollinger Breakout Strategy with Adaptive EMA Exits

Article vn.py community

Summary

This Chinese community post presents a VeighNa CTA strategy built around Bollinger Bands and recent closing-price extremes. It aggregates incoming bars into daily bars, then updates an array manager and waits for its data window to initialize. A long entry is considered when the daily high reaches both the upper band and the lookback maximum; a short entry is considered when the low reaches both the lower band and the lookback minimum. Position size is fixed by an input parameter.

For exits, the strategy calculates an EMA whose period adapts to position status: it starts from a configured longer period while flat and shortens by one per bar during a position, subject to a minimum. Long and short positions are closed when price crosses the EMA under additional Bollinger conditions. The post is framed as a request for help because signals appeared in minute-level tests but not daily tests; it supplies code but no diagnosis, test results, or evidence that the rules are profitable. Data aggregation, bar timing, and order handling may affect observed results.

Key ideas

  • The strategy combines Bollinger Band breaks with recent closing-price extremes to trigger entries.
  • It aggregates bars into daily bars before applying its entry and exit rules.
  • An EMA exit period changes with position status and has a configured minimum.
  • The post reports a discrepancy between minute and daily backtests but does not resolve it or provide performance evidence.

Tags

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