Skip to content
All library documents

Preventing Repeated Intrabar Entries and Stops in CTA Strategies

Article vn.py community

Summary

The discussion describes a target-position CTA strategy that enters when a bar's high exceeds a breakout level and exits when its low falls below a stop. When both conditions occur within one bar, the strategy can enter, stop out, and then re-enter because the bar still satisfies both price tests, causing repeated trades on the same candle.

The suggested resolution is to use the target-position execution mode with bar intervals of one minute or longer. In that mode, the bar callback executes once per bar, and the strategy submits only one directional order at the end of that callback. This limits the repeated entry-and-exit cycle described in the example. The exchange does not discuss finer-grained intrabar execution, fill ordering, slippage, or how the approach behaves with other order-management modes.

Key ideas

  • A bar whose high crosses an entry level and whose low crosses a stop can trigger repeated trades when both conditions are evaluated on the same bar.
  • Target-position execution is described as running once per bar for intervals of one minute or longer.
  • The suggested mode places one directional order at the end of each bar callback.
  • The discussion does not cover intrabar data or execution behavior for other order modes.

Tags

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