Skip to content

feat: implement TDSequential (TD Sequential Candlestick Indicator) #6620#9325

Open
vibeyclaw wants to merge 1 commit intoQuantConnect:masterfrom
vibeyclaw:feature/td-sequential-indicator
Open

feat: implement TDSequential (TD Sequential Candlestick Indicator) #6620#9325
vibeyclaw wants to merge 1 commit intoQuantConnect:masterfrom
vibeyclaw:feature/td-sequential-indicator

Conversation

@vibeyclaw
Copy link

Summary

Implements the TD Sequential candlestick indicator as requested in #6620.

TD Sequential, developed by Tom DeMark, is a momentum-based indicator that identifies potential trend exhaustion points through two sequential phases.

Implementation

Setup Phase

  • Tracks 9 consecutive bars where each close is higher (sell setup) or lower (buy setup) than the close 4 bars prior
  • SetupValue reports +1 to +9 for sell setups, -1 to -9 for buy setups
  • A value of ±9 marks a completed setup

Countdown Phase

  • Activated after a completed 9-bar setup
  • Accumulates up to 13 qualifying bars:
    • Sell countdown: close ≥ high of 2 bars ago
    • Buy countdown: close ≤ low of 2 bars ago
  • CountdownValue reports +1 to +13 (sell) or -1 to -13 (buy)
  • A completed countdown of ±13 signals potential trend exhaustion

Class Details

  • Extends BarIndicator (consumes IBaseDataBar)
  • Implements IIndicatorWarmUpPeriodProvider with WarmUpPeriod = 5
  • Uses RollingWindow<IBaseDataBar> of size 5 for efficient look-back
  • Exposes two output properties: SetupValue and CountdownValue
  • Full Reset() support

Reference

Closes #6620

Implements the TD Sequential indicator as requested in QuantConnect#6620.

TD Sequential, developed by Tom DeMark, identifies potential trend
exhaustion via two phases:

- Setup: 9 consecutive bars where each close is higher (sell) or lower
  (buy) than the close 4 bars prior. SetupValue reports +1..+9 for sell
  setups and -1..-9 for buy setups.

- Countdown: After a completed 9-bar setup, accumulates up to 13
  qualifying bars (close >= high[2] for sell, close <= low[2] for buy).
  CountdownValue reports +1..+13 (sell) or -1..-13 (buy); ±13 signals
  trend exhaustion.

The indicator extends BarIndicator and implements
IIndicatorWarmUpPeriodProvider (WarmUpPeriod = 5). A RollingWindow<IBaseDataBar>
of size 5 maintains the look-back bars needed by both phases.

Closes QuantConnect#6620
@Martin-Molinero
Copy link
Member

Hey @vibeyclaw! Thanks for the contribution, this is lacking a few pieces, specially tests! please take a look at other indicator PRs , like https://github.com/QuantConnect/Lean/pull/9109/changes . But there are many examples see https://github.com/QuantConnect/Lean/pulls?q=is%3Apr+indicator+is%3Aclosed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement TD Sequential Candlestick Indicator

2 participants