Plain-language sequence

  1. Recurring Buy places BUYs on a timer (reads latestDataMap for strike/price).
  2. When a BUY completes, the per-index schedule loop creates a pending SELL schedule.
  3. The global trailing loop updates strike match from candles and watches target %.
  4. On match, MARKET SELL closes that position via executeSideSellOnce.
  5. When no buys remain on the active side, the system can switch CALL ↔ PUT and repeat.
  6. Stopping recurring buy on options can bulk-sell remaining open buys; cash/futures only stop the interval.
The global trailing loop is started/stopped by marketSessionManager.syncTrailingSellInterval(), not directly from app.ts.