TradingView strategy research

The Strat trading strategy: bar types and testable setups

The Strat trading strategy uses numbered bars to describe how price trades relative to the previous bar: 1 stays inside its range, 2 breaks one side, and 3 breaks both sides. The method is associated with Rob Smith. A sequence such as 2-1-2 needs direction, a trigger, and exit rules before it becomes a testable strategy. A bar pattern alone does not establish a profitable trade.

Build my chosen Strat setup

Where the method comes from

Rob Smith taught TheStrat as a price-action method. The Benzinga conference archive below identifies him with TheStrat and his presentation, The Truth About Price Action. The linked TheStrat education documents explain its numbered scenarios and reversals. This page focuses on translating that vocabulary into explicit TradingView rules; its illustrative testing choices are not a complete reproduction of every discretionary part of the method.

  • Timeframe continuity and broadening formations are also discussed in TheStrat teaching. Adding either requires a separate definition of the timeframe, direction, and information available at the decision time.
  • The example below isolates one bullish 2-1-2 variation without a higher-timeframe filter. Do not treat its results, if tested, as a verdict on every version of TheStrat.

Classify a bar against the immediately preceding bar

A break means trading beyond a previous extreme, not merely touching it. To make the example reproducible, the table uses strict comparisons and leaves any equal-high or equal-low case unclassified. That tie policy is an explicit research choice: other scripts may include equality, so compare their definitions before comparing signals.

  • Classify from the entire candle range. Open and close determine candle color, which is a separate attribute.
  • Each comparison uses the previous bar, even when an earlier large bar still contains several later bars.
  • A 3 says both sides were exceeded. Its final OHLC values alone do not tell you which side broke first.
LabelHigh compared with previous highLow compared with previous low
1: insideLowerHigher
2u: directional upHigherHigher
2d: directional downLowerLower
3: outsideHigherLower
Boundary caseEither extreme is equal to its previous valueExcluded by this example

Keep the direction in the combination name

Numbers list adjacent bars in chronological order. The same three numbers can describe different hypotheses. Keep reversal and continuation variants in separate experiments instead of merging every occurrence into one signal.

CombinationWhat it describesWhat remains undecided
2d-1-2uA downside bar, contraction, then an upside break: bullish reversal setup.Whether to act during the break or after the last bar closes.
2u-1-2dThe bearish reversal counterpart.Entry timing, stop, target, and position size.
2u-1-2u / 2d-1-2dContraction followed by a break in the earlier direction: continuation setup.The context in which continuation is being tested.
2d-2u / 2u-2dDirectional bars switch sides without an intervening inside bar.A distinct two-bar reversal rulebook.
3-1-2Outside range, inside range, then a one-sided break.The last 2 direction and any context filter.

A hypothetical 2d-1-2u, one bar at a time

These invented prices illustrate classification and timing, not a historical trade or performance result. Assume standard candles, a 0.01 tick, one fixed timeframe, and no missing bars. The candidate begins after C closes; the confirmation choice below waits for D to close above C's high while remaining a 2u.

  • If D instead reaches 107, falls to 98.50, and closes at 106.50, it is a 3. Reject the completed-bar setup even though an earlier upside break occurred.
  • If D has high 107 and low 100 but closes at 105.50, it remains a 2u. The pattern exists, but this example's close-above-106 entry rule fails.
  • If D stays inside C, the one-bar candidate expires. Do not keep C's trigger alive indefinitely or retroactively turn a later break into D's signal.
BarOpen / High / Low / CloseKnown at the closeDecision
A104 / 110 / 100 / 106Reference range only.No classification without an earlier bar.
B105 / 108 / 98 / 100High is below A; low is below A: 2d.No inside bar yet.
C101 / 106 / 99 / 103High is below B; low is above B: 1.Save C high 106 and low 99 for the next bar only.
D103 / 107 / 100 / 106.50Only C high broke, and the close is above 106: 2u.Completed 2d-1-2u passes this confirmation rule.
EAssume an entry fill of 106.60The entry follows D's closing decision.Apply the preset stop and exit rules; this is not a fill at 106.

Complete the illustrative rulebook before running it

The following is a closed-bar research baseline for bullish 2d-1-2u only. Waiting for a closing price beyond the inside-bar high changes the entry from an intrabar break. These extra rules are chosen to make the experiment inspectable; they are not recommended settings or a claim about Smith's preferred execution.

  • In the hypothetical example, the stop is 98.99 and the target is 108. An assumed 106.60 fill gives 7.61 price units to the stop and 1.40 to the target, before costs. The recognizable pattern therefore does not imply an attractive reward-to-risk ratio.
  • A gap can place the actual fill beyond the intended target or stop. Keep that trade in the record and close at the first executable opportunity under the chosen model; do not delete it because the gap was inconvenient.
  • If both exits are reachable within one chart bar, inspect the broker emulator's sequence assumptions and available lower-timeframe detail. A chart-bar high and low are not a complete execution log.
  • The five-bar exit, fixed quantity, and rejection rule belong to this baseline. Change one at a time and retain the earlier version when comparing results.
DecisionFixed rule for this baseline
EligibilityUse consecutive completed bars, the strict tie policy above, and one symbol, session, and timeframe. Require B=2d, C=1, D=2u.
TriggerD must close above C high. Submit a market entry after that close; use the default next-tick fill model.
Initial stopOne minimum tick below C low. Submit the protective order with the entry so it can protect the position after the fill.
TargetUse B high as a fixed limit target. Reject at D close if that target is already at or below D close.
Time exitIf the position remains open at the close of the fifth bar counting the entry bar as bar one, submit a market close.
Position handlingUse one tradable unit with sufficient simulated capital and margin. Allow one open position and ignore new setups while it is open.
CostsSet commission and a stated slippage assumption appropriate to the instrument before comparing runs.

A live label and a confirmed signal can disagree

During an open bar, its high can rise and its low can fall. A live 1 can become a 2, then a 3. A break-triggered trade may therefore remain in the account even when the completed candle no longer matches its initial label. Waiting for close avoids that particular provisional classification, but delays the decision and does not prove that all other parts of a script are free from repainting.

  • Record the trigger timestamp and the final bar type separately. Never remove a real intrabar entry from a backtest solely because its completed bar later became a 3.
  • For an intrabar variant, define the pending order, its activation time, cancellation conditions, and which event wins if both sides trade. Test it separately from this close-confirmed baseline.
  • Use standard candlesticks for the baseline. Synthetic chart prices can change both pattern identification and simulated fills.
  • If adding a higher-timeframe filter, decide whether it uses completed higher-timeframe bars or their evolving values. The latter can change before that higher-timeframe candle closes.

Build one combination in Pineify, then audit its timestamps

Give the Pine Script AI Coding Agent the exact combination, tie policy, confirmation rule, expiry, and exit model. Ask for distinct markers for the candidate, closing confirmation, and actual order fill. Review the generated source against the numerical example before interpreting the Strategy Tester report.

  • The Visual Editor supports price conditions and historical offsets. Use those building blocks for the selected high/low comparisons; check the resulting sequence and order behavior instead of assuming a built-in TheStrat preset.
  • Keep long reversal, short reversal, and continuation variants separate. Report trade count, costs, drawdown, and results for each selected rulebook.
  • Choose an earlier development period and an untouched later evaluation period. Preserve failed parameter choices and investigate results that depend on one symbol or a few trades.
  • This page explains a workflow and supplies hypothetical arithmetic. It does not scan the market, generate live signals, or report measured strategy performance.
Where Pineify fits

Pine Script AI Coding Agent

Turn your chosen bar combination and execution rules into a Pine Script draft. Check the classification, order timing, and failure cases before using its backtest results.

Also useful: Visual Pine Script Editor. Compose high/low comparisons and historical offsets visually, then inspect the generated strategy against your written rules.

Build my chosen Strat setup

Frequently asked questions

Educational material, not investment advice. The example prices and research rules are illustrative and have not been performance-tested. Trading involves losses; a recognizable pattern or historical backtest does not guarantee future returns.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.