Multi-Timeframe S/R & Breakout Projection

- Collects S/R levels from the 15-minute and 1-hour timeframes, using each timeframe’s pivot detection.
- Sorts those pivot-based levels by their distance from the current price, so you see the nearest levels first.
- Draws up to a user-defined number of those levels as horizontal rays on the current chart.
- Checks breakouts at the nearest S/R line (the one with the smallest distance from price):
- Real Breakout: price breaks above a level and sustains above it for the specified number of bars.
- False Breakout: price breaks above but quickly closes back below within the specified lookback.
- On confirmation of a real or false breakout, that S/R line changes color to green if price is going higher, or red if price is going lower.
Displays a small table in the corner with:
- Daily Trend: bullish or bearish, using an SMA on a 30-minute timeframe.
- Sentiment: bullish or bearish, using RSI on the same 30-minute timeframe.
2) How It Works
Multi-Timeframe Pivot Detection
- The script uses request.security() to fetch pivot highs/lows from two higher timeframes (15m and 60m).
- It collects up to a user-specified number of these pivots (numRecent) from each TF.
Sorting & Plotting S/R Lines
- Once pivot values are gathered, the script calculates their “distance” from current price.
- It sorts them so that the S/R lines drawn on your chart are the nearest ones first.
- Each line is drawn with a color and style you can customize:
- srRayColor sets the overall color (e.g. yellow).
- srRayStyleOptions can be Solid, Dashed, or Dotted.
Breakout Determination
After drawing the lines, the script looks at the nearest line and applies two specialized checks (f_isFalseBreakout & f_isRealBreakout):
- A real breakout occurs if price closes above (or below) and remains on that side for breakLook bars.
- A false breakout occurs if price closes above (or below) but quickly returns.
- When a breakout is confirmed, that nearest line changes color to:
- Green if price is ultimately going up,
- Red if price is going down.
Daily Trend & Sentiment Table
A small table in the bottom-right corner shows:
- Daily Trend: uses a 30-minute SMA to see if your price is above/below on that timeframe.
- Sentiment: uses the RSI (also on 30m). A value over 50 suggests bullish sentiment; under 50 suggests bearish.
3) How to Use It
Timeframes & Pivots
- Choose how many pivots (numRecent) from each TF to fetch (up to 10 total). A higher number means you’ll see more historical S/R lines.
- Customize pivotLeft & pivotRight for how “wide” the pivot detection is.
Line Customization
In the script’s Inputs tab, you’ll find:
- S/R Rays Color – sets the hue of the lines.
- S/R Line Style – pick from Solid, Dashed, or Dotted.
- Liquidity Lines Color – color for the smaller pivot lines from your chart timeframe’s pivot detection.
Breakout Lookback
breakLook determines how many bars must confirm or refute the breakout. Adjust it based on how conservative or aggressive you want the breakout detection.
Check the Table
In the bottom-right, watch the script’s “Daily Trend” & “Sentiment”. This can be a quick filter for trades:
- “Bullish” daily trend with a bullish sentiment is often more favorable for long trades.
- Conversely, “Bearish” daily trend & sentiment can confirm short ideas.
Scenarios
If you see a “Real Breakout” label near the line, the script recolors that line green or red, indicating a possible continuous move.
A “False Breakout” label suggests the price has quickly retraced.
4) Originality & Concepts
Multi-Timeframe Approach: Many S/R indicators fetch only local pivot lines; here, we explicitly gather pivot points from two separate TFs (15m & 60m) and project them onto your lower timeframe chart.
Distance-Based Sorting ensures you only see the nearest lines on the chart, preventing clutter from excessive lines.
Breakout Logic used is straightforward but effective: it checks if price truly holds beyond a level (real breakout) or fails to hold (false breakout).
Line Recoloring provides immediate visual feedback on the success or failure of the breakout.
5) Chart Usage
Plot this script on a relatively low timeframe chart (like the 1m, 5m, or 15m) to see the higher timeframe S/R lines.
Select how many S/R lines you want to show, choose the line style, set your pivot detection parameters, then watch for breakouts.
Tips:
Start with fewer lines (maxLevels=3 or 5) so the chart remains clear.
You can experiment with a small breakLook if you want more immediate breakout signals, or a higher breakLook if you need stronger confirmation.
Enjoy using the “Multi-Timeframe S/R & Breakout Projection” script! It simplifies the manual process of spotting higher timeframe pivot lines and helps you quickly assess potential breakouts or fakes on your intraday charts, all while giving you a snapshot of the higher timeframe’s trend and sentiment.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.