Calculate the levels before the trading period starts
For Traditional pivots, let H, L and C be the previous completed period high, low and close. P = (H + L + C) / 3; S1 = 2P - H; R1 = 2P - L; S2 = P - (H - L); R2 = P + (H - L). For hypothetical H = 110, L = 100 and C = 105, P = 105, S1 = 100, R1 = 110, S2 = 95 and R2 = 115.
- The protocol below uses these five prices unchanged for the following session. Its entry buffer is b = 0.05 × (H - L), so the example buffer is 0.50. This buffer is a research choice, not part of the Traditional formula.
- Reject missing OHLC, H ≤ L, or a close outside the supplied high-low interval. Require a complete prior source session and enough capital for the stated quantity. Do not replace unavailable history with zero.
- These period pivots differ from swing pivots confirmed by later candles. This page tests orders around previous-period levels, not a method for labeling historical swing highs.
Choose the source session independently of the entry session
TradingView offers Traditional, Fibonacci, Woodie, Classic, DM and Camarilla formulas. Woodie includes the current period open. Other variants change the weighting or spacing; they are separate experiments. Select a pivot timeframe explicitly: Auto can switch it when the chart resolution changes.
- Daily-based values request the higher-timeframe feed; disabling them builds levels from chart data. Stock extended hours and futures settlement or session choices can produce different OHLC. Match the indicator and strategy source settings before comparing their lines.
- The illustrative baseline uses US equity regular-session five-minute candles, 09:30 through 16:00 America/New_York, on full trading days. Aggregate the previous complete regular session, excluding extended hours. Use the exchange calendar; skip shortened trading sessions. If the immediately preceding exchange session was shortened or incomplete, skip entries today rather than reaching further back for a source session.
- The entry window is narrower: evaluate completed bars closing from 10:00 through 14:55 New York time. This separates the price sample used to construct levels from the hours in which orders are allowed.
- Keep symbol, feed, price adjustment, timezone, holiday exclusions and five-minute resolution in the experiment record. A crypto day or an overnight futures session needs its own declared boundary; do not silently reuse these equity hours.
Compare bounce and breakout rules without choosing after the fact
Run the following long-only variants separately. Both use standard candles, 100 shares, no pyramiding, sufficient simulated capital, and at most one entry per trading session. Evaluate only while flat with no pending entry. The previous bar used for a breakout comparison must belong to the same trading session.
- Use unrounded levels for signal comparisons and the stated tick rounding for orders. Skip a signal if its close is not strictly between the rounded stop and target. Equality does not satisfy a strict comparison.
- Link the stop and target bracket to the entry when submitting orders. Freeze those prices for that trade; do not move them when a later session produces new pivots.
- Count the fill bar as bar one. If neither protective exit has filled by the close of bar 12, request a market exit, keeping protection active until flat. Cancel remaining orders after exit. Unexpected closures or missing bars can delay the executable exit.
- The variants do not switch roles after seeing a loss. A bounce that breaks down cannot be relabeled as an earlier breakout trade. Short-side rules, sizing and borrow costs require a separate specification.
| Decision | Bounce at S1 | Break above R1 |
|---|
| Signal at completed close | Low ≤ S1, low > S1 - b, and S1 + b < close < P. | Previous close ≤ R1 + b, current close > R1 + b, low > R1 - b, and close < R2. |
| Entry order | Submit a market buy after confirmation. | Submit a market buy after confirmation. |
| Fixed protective stop | S1 - b, rounded down to the minimum tick. | R1 - b, rounded down to the minimum tick. |
| Fixed limit target | P, rounded down to the minimum tick. | R2, rounded down to the minimum tick. |
| Failure hypothesis | The support rejection fails and price continues downward. | The break fails and price returns below resistance. |
Recompute the payoff from actual fills and costs
Using the hypothetical levels above and a 0.01 tick, a bounce bar with low 99.80 and close 100.80 qualifies. Assume the next available buy fill is 100.90. In a separate breakout experiment, previous close 110.40, current low 110.20 and current close 110.80 qualify; assume a buy fill of 110.90. Commission is $0.05 per share on each side. The following alternative outcomes include that $0.10 round-trip cost.
- Equal payoffs in this constructed example do not imply equal win rates, exposure or results. No market performance was measured. In the two-outcome exact-target/exact-stop model, break-even win rate is 1.50 / (4.00 + 1.50) = 27.27%; it is not a predicted success rate.
- For a cost stress case, charge $0.10 per share each side and assume an additional 0.10 adverse entry fill plus 0.10 adverse stop fill. A target winner becomes $380; a stop loser becomes $180. Break-even for those two outcomes rises to 180 / (380 + 180) = 32.14%. The limit target stays unchanged.
- Prices in each row already include its stated execution assumption. Do not subtract the same gap or slippage twice. Add any applicable spread, financing or other fees separately; this arithmetic does not model them.
| Variant and exit assumption | Per-share net calculation | 100-share result |
|---|
| Bounce target at 105 | 105 - 100.90 - 0.10 = 4.00 | +$400 |
| Bounce stop at 99.50 | 99.50 - 100.90 - 0.10 = -1.50 | -$150 |
| Breakout target at 115 | 115 - 110.90 - 0.10 = 4.00 | +$400 |
| Breakout stop at 109.50 | 109.50 - 110.90 - 0.10 = -1.50 | -$150 |
| Bounce gap exit at 99.20 | 99.20 - 100.90 - 0.10 = -1.80 | -$180 |
Reject hindsight and ambiguous execution
At 10:00, the current session final high and low are unknown. For example, the frozen P above is 105. If that session later finishes with H = 120, L = 98 and C = 118, its P = 112 belongs to the following eligible period. Replacing the morning 105 with 112 would test information that arrived after the decision.
- With default bar-close strategy timing, a market order generally fills at the next bar open in historical testing. The signal close is not a guaranteed fill. Gaps can execute stops beyond their specified prices.
- When one bar touches both stop and target, inspect the emulator path and available lower-timeframe evidence. Bar Magnifier can refine the simulation when data is available; it cannot establish an unobserved live fill. Record unresolved cases and compare a conservative outcome assumption.
- Check historical signals again after reload and compare them with saved observations. Current higher-timeframe values can change before that period closes. Any implementation must preserve the previous completed source period instead of leaking final current-period values backward.
| Audit case | Expected result under this protocol |
|---|
| Bounce low equals 99.50 | Reject: the low must be strictly above S1 - b. |
| Bounce closes exactly at 100.50 | Reject: recovery must close strictly above S1 + b. |
| Breakout candle only wicks above 110.50 | Reject unless its completed close exceeds 110.50. |
| Previous close already exceeds 110.50 | No fresh breakout cross on this bar. |
| Current-day high expands after entry | Keep the original levels, stop and target. |
| Buy gaps beyond its target or stop | Keep the actual fill and close at the first executable opportunity; do not erase the trade. |
Keep formula variants inside one controlled comparison
Changing the pivot formula changes where orders can qualify. Treat formula selection as a parameter experiment within this rulebook, rather than publishing a separate strategy claim for each label. A variant must still define source availability, entry conditions, target and stop ordering, and invalid cases before it is evaluated.
- Start with the Traditional baseline. For a candidate formula, verify that all referenced levels exist and that the intended target is above the entry and stop. Otherwise record a rejected setup; do not substitute a different target after viewing the chart.
- Keep development dates and later evaluation dates separate. Compare bounce and breakout results on identical symbols, dates, capital, session and fee assumptions. Save the number of eligible sessions, rejected signals, filled trades, average net trade and drawdown.
- First audit the prior-period boundary, an equality rejection, a session gap and a failed signal. Then compare a small predeclared buffer set, such as 0.025, 0.05 and 0.10 times the prior range. Preserve losing settings and do not retune using the reserved dates.
Implement the frozen rules, then compare parameters
Give Pine Script AI Coding Agent the session definition, formula, rule table and audit cases. Ask for visible frozen levels and distinct signal and fill markers. Review the generated source, explicitly request syntax validation, and inspect its behavior in TradingView before optimizing anything.
- Expose the buffer fraction and holding limit as explicit strategy inputs. Strategy Optimizer can test selected parameter combinations and record results; verify that each run uses the intended symbol, session and dates. Run the reserved evaluation period separately after freezing the settings.
- Use Backtest Deep Report with a compatible trade-list import to inspect supported metrics such as net profit, profit factor, trade count and drawdown. Confirm the imported records and calculation settings. A trade report cannot recover rejected setups or prove that pivot values were available at signal time.
- This page provides a research protocol, not a tested preset, order-routing service or profit estimate. Code assistance, parameter comparisons and report analysis each require review.