OPEN-SOURCE SCRIPT
Camarilla S6-R6 + Day

# Camarilla S6–R6 + Day Type
## Short title
Camarilla S6-R6 + Day Type
---
## Description
Camarilla pivots plotted with the full six-level set (S6 through R6 plus the central pivot), using the level naming most execution platforms display, with a session-locked calculation and a dashboard that classifies the developing period as a rotation day or a breakout day.
**Levels**
All levels derive from the previous completed period's high, low and close:
Range = prior High − prior Low
PP = (H + L + C) / 3
R1 = C + Range × 1.1/12 S1 = C − Range × 1.1/12
R2 = C + Range × 1.1/6 S2 = C − Range × 1.1/6
R3 = C + Range × 1.1/4 S3 = C − Range × 1.1/4
R4 = C + Range × 1.1/2 S4 = C − Range × 1.1/2
R5 = R4 + 1.168 × (R4 − R3) S5 = S4 − 1.168 × (S3 − S4)
R6 = (High / Low) × C S6 = C − (R6 − C)
Note for anyone comparing against other Camarilla scripts: in the five-level version, the (H/L) × C calculation is labelled H5. In the six-level set used here it is R6, and R5 is the separate 1.168 extension of the R3–R4 leg. If the outer line looks misnamed against another indicator, this is why.
**Session basis — the part that usually causes mismatched levels**
Camarilla levels are only as good as the prior high, low and close feeding them, and on an intraday chart with extended hours enabled it is easy to end up mixing sessions without noticing. This script pins the calculation explicitly. The Session basis input rebuilds the data request on regular-hours data (the default, matching most execution platforms), extended-hours data, or whatever your chart is currently set to. The levels stay on that basis regardless of your chart's extended-hours toggle.
The developing period's open, high and low are requested from that same source, so both sides of every inside/outside comparison are measured on one session. The period boundary is taken from the higher-timeframe bar's own timestamp rather than the chart's calendar-day roll, which matters on extended-hours charts where the chart day rolls before the daily bar has advanced.
A Prior H/L/C row in the dashboard shows the three numbers actually being used. Check those against your broker or platform for the same date — if they match, every level below them matches by construction.
**Timeframe handling**
Auto resolves to daily levels on every intraday chart and on the daily chart itself, weekly on a weekly chart, yearly on monthly. Keeping daily pivots on the daily chart is deliberate: each daily candle is then drawn against the prior day's level set, so a run of inside and outside days reads directly off the staircase. Raise "Periods shown" to 10–20 for that view and leave it at 1–2 intraday. Daily, weekly, monthly and a free custom timeframe can also be selected manually.
**Opacity gradient**
Transparency steps down as levels move away from the pivot. The inner S3–R3 band is the most transparent so price action stays readable through it, R4/S4 and R5/S5 grow progressively more solid, and R6/S6 are the darkest and heaviest lines on the chart. Starting transparency and the per-band step are both inputs, so the gradient can be flattened or exaggerated. R and S levels have separate colour inputs.
**Day type dashboard**
Open type — where the period opened relative to the prior band. Inside S3–R3 suggests rotation and levels worth fading; between R3 and R4 (or S3 and S4) marks a gap that often reverts to the band; beyond R4/S4 flags a breakout open that should not be faded.
Range — the containment read. INSIDE when the developing high and low sit within the prior range, OUTSIDE when they engulf it, otherwise a one-sided extension.
Range vs prior — developing range as a percentage of the previous one. A contraction and expansion gauge: a low reading through the middle of the session supports mean reversion at the bands, above 100% says the session is in expansion.
Price in — which band price currently occupies, from above R6 down to below S6.
An optional background tint marks inside and outside periods on the chart itself.
**Alerts**
Crossings of R3/S3 and R4/S4 in both directions, rejection back inside the R3/S3 band, and tags of R6/S6.
**Notes on repainting**
Prior-period values use a bar offset so the levels lock in when the period closes and do not repaint. The developing period is requested without lookahead, so it updates bar by bar without using future data. That does mean the Range and Range-vs-prior rows are live reads that can change until the period closes — a day showing INSIDE at midday can finish as an outside day. When regular-hours levels are selected and the session has not opened yet, the dashboard reports that state rather than computing a range against the prior day's own numbers.
Works on any symbol and any chart timeframe at or below the pivot timeframe; a warning label appears if the chart timeframe is higher than the selected pivot timeframe.
Open source. The level maths is the standard published Camarilla set; the code is commented throughout for anyone who wants to adapt it.
## Short title
Camarilla S6-R6 + Day Type
---
## Description
Camarilla pivots plotted with the full six-level set (S6 through R6 plus the central pivot), using the level naming most execution platforms display, with a session-locked calculation and a dashboard that classifies the developing period as a rotation day or a breakout day.
**Levels**
All levels derive from the previous completed period's high, low and close:
Range = prior High − prior Low
PP = (H + L + C) / 3
R1 = C + Range × 1.1/12 S1 = C − Range × 1.1/12
R2 = C + Range × 1.1/6 S2 = C − Range × 1.1/6
R3 = C + Range × 1.1/4 S3 = C − Range × 1.1/4
R4 = C + Range × 1.1/2 S4 = C − Range × 1.1/2
R5 = R4 + 1.168 × (R4 − R3) S5 = S4 − 1.168 × (S3 − S4)
R6 = (High / Low) × C S6 = C − (R6 − C)
Note for anyone comparing against other Camarilla scripts: in the five-level version, the (H/L) × C calculation is labelled H5. In the six-level set used here it is R6, and R5 is the separate 1.168 extension of the R3–R4 leg. If the outer line looks misnamed against another indicator, this is why.
**Session basis — the part that usually causes mismatched levels**
Camarilla levels are only as good as the prior high, low and close feeding them, and on an intraday chart with extended hours enabled it is easy to end up mixing sessions without noticing. This script pins the calculation explicitly. The Session basis input rebuilds the data request on regular-hours data (the default, matching most execution platforms), extended-hours data, or whatever your chart is currently set to. The levels stay on that basis regardless of your chart's extended-hours toggle.
The developing period's open, high and low are requested from that same source, so both sides of every inside/outside comparison are measured on one session. The period boundary is taken from the higher-timeframe bar's own timestamp rather than the chart's calendar-day roll, which matters on extended-hours charts where the chart day rolls before the daily bar has advanced.
A Prior H/L/C row in the dashboard shows the three numbers actually being used. Check those against your broker or platform for the same date — if they match, every level below them matches by construction.
**Timeframe handling**
Auto resolves to daily levels on every intraday chart and on the daily chart itself, weekly on a weekly chart, yearly on monthly. Keeping daily pivots on the daily chart is deliberate: each daily candle is then drawn against the prior day's level set, so a run of inside and outside days reads directly off the staircase. Raise "Periods shown" to 10–20 for that view and leave it at 1–2 intraday. Daily, weekly, monthly and a free custom timeframe can also be selected manually.
**Opacity gradient**
Transparency steps down as levels move away from the pivot. The inner S3–R3 band is the most transparent so price action stays readable through it, R4/S4 and R5/S5 grow progressively more solid, and R6/S6 are the darkest and heaviest lines on the chart. Starting transparency and the per-band step are both inputs, so the gradient can be flattened or exaggerated. R and S levels have separate colour inputs.
**Day type dashboard**
Open type — where the period opened relative to the prior band. Inside S3–R3 suggests rotation and levels worth fading; between R3 and R4 (or S3 and S4) marks a gap that often reverts to the band; beyond R4/S4 flags a breakout open that should not be faded.
Range — the containment read. INSIDE when the developing high and low sit within the prior range, OUTSIDE when they engulf it, otherwise a one-sided extension.
Range vs prior — developing range as a percentage of the previous one. A contraction and expansion gauge: a low reading through the middle of the session supports mean reversion at the bands, above 100% says the session is in expansion.
Price in — which band price currently occupies, from above R6 down to below S6.
An optional background tint marks inside and outside periods on the chart itself.
**Alerts**
Crossings of R3/S3 and R4/S4 in both directions, rejection back inside the R3/S3 band, and tags of R6/S6.
**Notes on repainting**
Prior-period values use a bar offset so the levels lock in when the period closes and do not repaint. The developing period is requested without lookahead, so it updates bar by bar without using future data. That does mean the Range and Range-vs-prior rows are live reads that can change until the period closes — a day showing INSIDE at midday can finish as an outside day. When regular-hours levels are selected and the session has not opened yet, the dashboard reports that state rather than computing a range against the prior day's own numbers.
Works on any symbol and any chart timeframe at or below the pivot timeframe; a warning label appears if the chart timeframe is higher than the selected pivot timeframe.
Open source. The level maths is the standard published Camarilla set; the code is commented throughout for anyone who wants to adapt it.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.