Skip to content
All library documents

Fifty-Bar Range Breakout with Midpoint Exits

Article FMZ forum · Author: LIXIU

Summary

This example describes a futures strategy that tracks the highest high and lowest low over 50 bars. When flat, it enters long above the range high or short below the range low. It closes a long if price falls below the range midpoint, and closes a short if price rises above it. The code selects the MA109 contract and checks existing positions before placing trades.

The document provides implementation logic but no backtest, performance results, or risk analysis. Its heading reports a live-running error related to a missing Python executable, while the sample itself appears to use a separate trading platform’s API. The entry calls also contain apparent typing errors, so the example may need correction before it can run. It does not specify position sizing, protective stops, fees, or how the strategy handles repeated signals and data timing.

Key ideas

  • The strategy defines a rolling price channel using the highest high and lowest low over 50 bars.
  • It opens a long position on a close above the channel high and a short position below the channel low.
  • It exits positions when price crosses the midpoint of the channel in the adverse direction.
  • The document provides code but no evidence of performance or a complete risk-management plan.

Tags

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