Skip to content
All library documents

Inside-Bar Momentum Entries with Range-Based Stops and Position Sizing

Article Strategy library · Author: BacktestRookies

Summary

This strategy looks for an inside bar, defined as a candle contained within the preceding candle’s range. It takes the direction from the preceding candle: a bullish candle sets a buy stop above its high, while a bearish candle sets a sell stop below its low. Entry, stop-loss, and take-profit levels are offsets based on the preceding candle’s range. Quantity is calculated from a configurable fraction of equity divided by the distance between entry and stop, linking exposure to the planned loss distance. When a new qualifying pattern appears, the script cancels pending orders and closes an existing position before setting updated levels.

The excerpt frames this as a momentum approach and includes a configurable date window, but it ends partway through the short-side section. It gives no backtest results, instrument-specific evidence, or execution assumptions. The chosen range offsets and risk fraction are settings rather than validated recommendations. Actual outcomes can vary with gaps, stop fills, costs, and the frequency of false breakouts after inside bars.

Key ideas

  • An inside bar is identified when its high and low remain within the prior candle’s range.
  • The prior candle’s direction determines whether the strategy stages a long or short stop entry.
  • Entry, stop, and target levels are calculated as offsets from the prior candle’s range.
  • Position quantity is based on an equity risk fraction and the entry-to-stop distance.
  • New qualifying setups cancel pending orders and close existing positions before updating orders, but no performance results are provided.

Tags

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