Advanced Settings

These features help TWaveStrategy adapt to market structure and volatility more intelligently.


UseSwing

When you set StopLossOption to RecentPivot, the strategy places your stop loss at the most recent swing point, adjusted based on the direction of the trade:

  • πŸ“ˆ Long trade β†’ Stop is placed below the most recent swing low
  • πŸ“‰ Short trade β†’ Stop is placed above the most recent swing high

This type of stop placement adapts to market structure, rather than using a fixed dollar amount.

You can also apply a buffer using StopLossThresholdTicks to give the stop a bit of breathing room and reduce the chance of premature stop-outs.


SBarTrailingStop

When TakeProfitOption is set to SBarTrailingStop, the strategy will use a trailing stop based on significant bars (SBars).

  • For long positions β†’ the stop is placed below the most recent Up SBar, minus a tick buffer (TrailStopThresholdTicks)
  • For short positions β†’ the stop is placed above the most recent Down SBar, plus the buffer

What is an SBar?

An SBar is a bar with significant price movement, and it is detected using:

  • AtrPeriod β†’ defines the ATR window (volatility)
  • SBarMultiplier β†’ scales the ATR to determine what qualifies as "significant"

This lets the stop adapt dynamically as stronger bars emerge β€” locking in gains without exiting too early.


These advanced options make the strategy more responsive to actual price action and market conditions, offering a more professional edge in real-time trading.