Обновлено
Trend Shift Sequencer (5-Step)

TITLE
Trend Shift Sequencer (5-Step)
DESCRIPTION
What it does
Trend Shift Sequencer tracks a trend change as a sequence of five steps instead of a single crossover signal. Most moving-average tools say "up" or "down". This one shows how far a possible reversal has progressed: an early stall, a base, a breakout, confirmation, or a new trend that is fully in place. Candles are coloured by trend, and a small summary table shows the current trend, reversal progress and stage.
It also draws a reference put strike and a stop-loss level built from the same moving averages and ATR. It is meant for traders who sell cash-secured puts or wheel stocks and want the strike set below both trend support and normal daily volatility.
It is designed for daily charts and works on any symbol with price data.
Moving averages (defaults, all adjustable)
- Short-term: 9 EMA
- Medium-term: 20 EMA
- Long-term: 50 SMA
- Far: 100 SMA (plotted for reference only, not used in any calculation)
How the five steps work
The script always holds an "established" trend (up or down) and counts steps toward a reversal of it. The steps below describe an uptrend turning down. An up reversal is the exact mirror.
1. Stop: a candle closes below the short-term EMA.
2. Base: the short-term EMA starts falling.
3. Breakout: the short-term EMA is below the medium-term EMA.
4. Confirm: the short-term EMA, medium-term EMA and long-term SMA are all falling on the same bar.
5. New trend: all of the following are true at once:
- the short-term EMA is still below the medium-term EMA, and the medium-term and long-term averages are both falling;
- a lower high and a lower low have formed since step 1, using swing points with 3 bars on each side;
- price closed at least 1x ATR(14) below the short-term EMA within the last 15 bars;
- since step 3, at least one candle reached up to the short-term EMA and closed back below it (a rejection).
When step 5 completes, the established trend flips to down and the count restarts, now watching for an up reversal.
Rules that apply to every step:
- Steps are sequential. A step only counts after the one before it, though several can complete on the same candle.
- A completed step stays completed until the reversal finishes or is cancelled.
- A "rising" or "falling" average is one that is above or below its own value 1 bar ago. This lookback is adjustable.
Cancelling a reversal
At any step, an in-progress reversal is reset to zero if the old trend reasserts itself. Either of these cancels it:
- price closes back above a rising short-term EMA (in an uptrend), or below a falling one (in a downtrend);
- the short-term EMA crosses back over the medium-term EMA in the old trend's direction.
This keeps sharp V-shaped recoveries from being painted as reversals for long. Cancelling can be switched off.
Candle colours
- Candles take the established trend's colour (green for up, red for down).
- From step 2 of a reversal, candles switch to the new direction's colour.
- If the reversal is cancelled, they return to the old trend's colour.
- Step 1 is treated as an early warning only, so it does not change the colour.
Summary table
The table at the top right of the chart shows:
- the established trend, how many reversal steps have completed, and the current stage name;
- the medium-term EMA, the recommended strike, the stop loss, ATR, and the ATR floor.
Its background is transparent and the text follows your chart theme.
Reference strike and stop loss
- ATR floor = close minus 1.5 x ATR(14).
- Recommended strike = the first strike increment below whichever is lower: the medium-term EMA or the ATR floor. This places the strike below trend support and at least 1.5 ATRs below the current price.
- Stop loss = strike minus 10%.
- The strike, stop loss and ATR floor are drawn as lines to the right of the last bar. The table shows how far the strike is from price (in % and in ATRs) and which level set it.
- Strike increment is automatic: 0.5 under $25, 1 under $200, 5 under $1,000, 10 above. Set your own value when the option chain uses different increments.
These are price levels calculated from the chart. The script does not read option chains, premiums, implied volatility or earnings dates.
How to use it
- Read the colours as a trend filter. Green candles with no reversal in progress mean the uptrend is intact.
- A down reversal at steps 1-2 is an early warning. At steps 3-4 the trend is weakening. Step 5 means a new downtrend has been confirmed.
- Use the reference strike as a starting point for strike selection, then check the actual option chain, liquidity, premium and upcoming events before trading.
- Alerts are available for steps 1, 3 and 5 in each direction, plus an "Any alert() function call" alert that fires on every step.
Settings
- Show / hide: summary table.
- Moving averages: period of each average, slope lookback, and line colours.
- Step 5: swing strength, stretch size and window, and whether to require the swing structure, stretch and rejection checks.
- Invalidation: turn cancelling on or off.
- Display: paint candles, uptrend and downtrend colours, optional background tint.
- Recommended strike and stop loss: ATR multiple, ATR length, stop-loss %, strike increment, line colours.
What makes it different
Instead of one crossover, it breaks a trend change into five ordered, named steps with explicit cancel rules, so you can see whether a pullback is still a pullback or has become a trend change. It then links that trend read to a concrete strike and stop-loss level, using the same averages plus ATR.
Limitations
- All inputs are moving averages and swing points, so the steps lag price. Swing points are confirmed 3 bars after they form, so step 5 can complete several days after the actual turn. It sometimes completes near the end of a move.
- In sideways, choppy markets, reversals will start and cancel often.
- Results depend on the settings. Faster averages react sooner but produce more false starts.
- The trend state is built from the history loaded on the chart, so the very first bars are only a starting assumption.
- Signals are evaluated on bar close. Values on the current, unfinished bar can change until it closes.
- The strike increment is an approximation and may not match a given option chain.
- This is an analysis tool, not a trading system. It does not predict future prices, and nothing it shows is a recommendation to buy or sell.
Trend Shift Sequencer (5-Step)
DESCRIPTION
What it does
Trend Shift Sequencer tracks a trend change as a sequence of five steps instead of a single crossover signal. Most moving-average tools say "up" or "down". This one shows how far a possible reversal has progressed: an early stall, a base, a breakout, confirmation, or a new trend that is fully in place. Candles are coloured by trend, and a small summary table shows the current trend, reversal progress and stage.
It also draws a reference put strike and a stop-loss level built from the same moving averages and ATR. It is meant for traders who sell cash-secured puts or wheel stocks and want the strike set below both trend support and normal daily volatility.
It is designed for daily charts and works on any symbol with price data.
Moving averages (defaults, all adjustable)
- Short-term: 9 EMA
- Medium-term: 20 EMA
- Long-term: 50 SMA
- Far: 100 SMA (plotted for reference only, not used in any calculation)
How the five steps work
The script always holds an "established" trend (up or down) and counts steps toward a reversal of it. The steps below describe an uptrend turning down. An up reversal is the exact mirror.
1. Stop: a candle closes below the short-term EMA.
2. Base: the short-term EMA starts falling.
3. Breakout: the short-term EMA is below the medium-term EMA.
4. Confirm: the short-term EMA, medium-term EMA and long-term SMA are all falling on the same bar.
5. New trend: all of the following are true at once:
- the short-term EMA is still below the medium-term EMA, and the medium-term and long-term averages are both falling;
- a lower high and a lower low have formed since step 1, using swing points with 3 bars on each side;
- price closed at least 1x ATR(14) below the short-term EMA within the last 15 bars;
- since step 3, at least one candle reached up to the short-term EMA and closed back below it (a rejection).
When step 5 completes, the established trend flips to down and the count restarts, now watching for an up reversal.
Rules that apply to every step:
- Steps are sequential. A step only counts after the one before it, though several can complete on the same candle.
- A completed step stays completed until the reversal finishes or is cancelled.
- A "rising" or "falling" average is one that is above or below its own value 1 bar ago. This lookback is adjustable.
Cancelling a reversal
At any step, an in-progress reversal is reset to zero if the old trend reasserts itself. Either of these cancels it:
- price closes back above a rising short-term EMA (in an uptrend), or below a falling one (in a downtrend);
- the short-term EMA crosses back over the medium-term EMA in the old trend's direction.
This keeps sharp V-shaped recoveries from being painted as reversals for long. Cancelling can be switched off.
Candle colours
- Candles take the established trend's colour (green for up, red for down).
- From step 2 of a reversal, candles switch to the new direction's colour.
- If the reversal is cancelled, they return to the old trend's colour.
- Step 1 is treated as an early warning only, so it does not change the colour.
Summary table
The table at the top right of the chart shows:
- the established trend, how many reversal steps have completed, and the current stage name;
- the medium-term EMA, the recommended strike, the stop loss, ATR, and the ATR floor.
Its background is transparent and the text follows your chart theme.
Reference strike and stop loss
- ATR floor = close minus 1.5 x ATR(14).
- Recommended strike = the first strike increment below whichever is lower: the medium-term EMA or the ATR floor. This places the strike below trend support and at least 1.5 ATRs below the current price.
- Stop loss = strike minus 10%.
- The strike, stop loss and ATR floor are drawn as lines to the right of the last bar. The table shows how far the strike is from price (in % and in ATRs) and which level set it.
- Strike increment is automatic: 0.5 under $25, 1 under $200, 5 under $1,000, 10 above. Set your own value when the option chain uses different increments.
These are price levels calculated from the chart. The script does not read option chains, premiums, implied volatility or earnings dates.
How to use it
- Read the colours as a trend filter. Green candles with no reversal in progress mean the uptrend is intact.
- A down reversal at steps 1-2 is an early warning. At steps 3-4 the trend is weakening. Step 5 means a new downtrend has been confirmed.
- Use the reference strike as a starting point for strike selection, then check the actual option chain, liquidity, premium and upcoming events before trading.
- Alerts are available for steps 1, 3 and 5 in each direction, plus an "Any alert() function call" alert that fires on every step.
Settings
- Show / hide: summary table.
- Moving averages: period of each average, slope lookback, and line colours.
- Step 5: swing strength, stretch size and window, and whether to require the swing structure, stretch and rejection checks.
- Invalidation: turn cancelling on or off.
- Display: paint candles, uptrend and downtrend colours, optional background tint.
- Recommended strike and stop loss: ATR multiple, ATR length, stop-loss %, strike increment, line colours.
What makes it different
Instead of one crossover, it breaks a trend change into five ordered, named steps with explicit cancel rules, so you can see whether a pullback is still a pullback or has become a trend change. It then links that trend read to a concrete strike and stop-loss level, using the same averages plus ATR.
Limitations
- All inputs are moving averages and swing points, so the steps lag price. Swing points are confirmed 3 bars after they form, so step 5 can complete several days after the actual turn. It sometimes completes near the end of a move.
- In sideways, choppy markets, reversals will start and cancel often.
- Results depend on the settings. Faster averages react sooner but produce more false starts.
- The trend state is built from the history loaded on the chart, so the very first bars are only a starting assumption.
- Signals are evaluated on bar close. Values on the current, unfinished bar can change until it closes.
- The strike increment is an approximation and may not match a given option chain.
- This is an analysis tool, not a trading system. It does not predict future prices, and nothing it shows is a recommendation to buy or sell.
Информация о релизе
Changed default colors and labels.Информация о релизе
updated lables.Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.