Camarilla Pivot Points Day Trading System For ThinkOrSwim

Wiinii

Member
This is a complete trading strategy indicator built around Thor Young's book A Complete Day Trading System.

It includes:
  • Camarilla Pivot Points - Both with and without premarket data.
  • Label on chart showing whether to use cams with or without PMD. See animated gif.
  • Auto option shows only the cams needed based on the above! Optionally show both cams with and without PMD at all times, or only one or the other. NOTE: You need at least 2 days data on your charts for w/PMD cams (3 on 3-day holiday weekends).
  • Floor Pivots 3, 4, and Central. (Can be toggled on and off). They are labeled as FS4, FS3, FR4 and FR3.
  • Option to hide cam levels 1, 2 and 5 (hidden by default).
  • Options for Daily, Weekly, and Monthly. Yes, you can see the monthly cams on your intraday chart!
  • S/R4a and S/R4wa are optional, but it allows the dual colors for those levels which you'll see by default. I recommend making the green S4 lines slightly thicker than the red (ex. red 1 green 2) for it to look best.
  • IMPORTANT NOTE: Because Thor relies heavily on DAS, I want to clarify that DAS cams for futures are WRONG! They are not calculated from 1800 open to 1700 close which is how cams are properly calculated for futures and calculated by default in ToS. Also ETFs (SPY and QQQ) trade for much longer than DAS calculates, which is why the w/PMD cams for them won't match either, because theirs too are wrong. Which means these are more accurate (since they calculate using the correct timeframe and use all the data). More info. This is also why the VWAP won't be in the same place for futures on DAS and ToS either.
UPDATE: 1.5 - 4/7/23
  • Bubbles now have the option to be placed in the expansion area or at a specified time (don't use time on the daily chart of course). To see it in the expansion area, click on the gear above the chart > go to Time Axis and change the Expansion area to a number that keeps them off your charts (this will vary depending on timeframe and zoom level).
Shared Link: http://tos.mx/XiBac3J (or use code below). Click here for --> Easiest way to load shared links

To complement this, I've also created the Reversal Candle Anomaly Detector w/Volume-Colored VPA Candles!

Scanners and Watchlist Columns are at the bottom of this post!


Other indicators I also use/recommend:

5TQFguI.png


DiedphP.png


Code:
# Thor's Camarilla Pivot Points
# Wiinii
# v1.5
# Based on Thor's book 'A Complete Day Trading System' to include R5 & S5, levels colored accordingly, CAMS with pre-market data, Central Pivot + Floor Pivots 3&4, and label to easily tell you if you should use With or W/O Premarket Data and option only to show the cams based on that!
# Some code based on code by SleepyZ & Nube
# https://usethinkscript.com/threads/pivot-day-trading-system-for-thinkorswim.12988/

declare once_per_bar;

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 1;
input ShowBubbles = yes;
input ShowPricesInBubbles = yes;
input locate_bubbles_at = {default Expansion, Time};
input locate_bubbles_at_time = 600;
input BarsFromExpansion = 1;
input PMD_Indicator_Label = yes;
input ShowCams = {default "Auto", "w/o Only", "Both", "w/Only"};
input hide_Floor_Pivots = no;
input hide_s4a_r4a = no;
input hide_s1_r1 = yes;
input hide_s2_r2 = yes;
input hide_s5_r5 = yes;
input lines = {default horizontal, dashes, points, triangles, squares};
input HasNoGlobeX = no;

Assert(length > 0, "'length' should be positive: " + length);

def timeopen = SecondsFromTime(locate_bubbles_at_time) == 0;
def isExpansion = locate_bubbles_at == locate_bubbles_at.Expansion and IsNaN(close);
def firstExpansionBar = if !IsNaN(close[-1]) and isExpansion then 1 else if isExpansion then firstExpansionBar[1] + 1 else 0;
def BubbleLocation = if locate_bubbles_at == locate_bubbles_at.Time then timeopen else isExpansion and firstExpansionBar == BarsFromExpansion;

def yyyymmdd = GetYYYYMMDD();
def month = GetYear() * 12 + GetMonth();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period;
switch (aggregationPeriod) {
case DAY:
    period = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
    period = Floor(day_number / 7);
case MONTH:
    period = Floor(month - First(month));
}
def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % length else count[1], 0);
def start =  CompoundValue(1, count < count[1] + period - period[1], yes);
def highValue = if start then Highest(high(period = aggregationPeriod), length)[1] else if highValue[1] != 0 then highValue[1] else Double.NaN;
def lowValue = if start then Lowest(low(period = aggregationPeriod), length)[1] else if lowValue[1] != 0 then lowValue[1] else Double.NaN;
def closeValue = if start then close(period = aggregationPeriod)[1] else closeValue[1];
def range = highValue - lowValue;

#PMD Indicator Label on Chart ----------------------------------------------

def na = Double.NaN;
def bn = BarNumber();
def h  = high;
def l  = low;

Script prior {
# subscript for getting prior value of a BarNumber() defined variable
    input prior = close;
    def   priorOf = if prior != prior[1] then prior[1] else priorOf[1];
    plot  priorBar = priorOf;
}
 
   # variables
def cb   = HighestAll(if !IsNaN(h) then bn else na);
def time = GetTime();
def rts  = RegularTradingStart(GetYYYYMMDD());
def rte  = RegularTradingEnd(GetYYYYMMDD());

def RTH = if   time crosses above rts
          then bn else if time <= rts then bn else RTH[1];

def globex = if   time crosses below rte
             then bn else globex[1];

def priorRTH    = prior(RTH);
def priorGlobex = prior(globex);
def hRTH  = HighestAll(RTH);
def hGX   = HighestAll(globex);
def hPRTH = HighestAll(priorRTH);
def hPGX  = HighestAll(priorGlobex);

def gXhigh = HighestAll(if   bn >= hGX && bn < hRTH
                        then h else if hRTH < hGX && bn >= hGX
                                    then h else na);
def gXlow = LowestAll(if   bn >= hGX && bn < hRTH
                      then l else if hRTH < hGX && bn >= hGX
                                  then l else na);

def priorGBXhigh = HighestAll(if   bn >= hPGX
                              &&   bn <  if   hGX < hRTH
                                         then hGX
                                         else hPGX
                              then h else na);
def priorGBXlow = LowestAll(if   bn >= hPGX
                            &&   bn <  if   hGX < hRTH
                                       then hGX
                                       else hPGX
                            then l else na);
 
def displace = -1;
def PDHigh = Highest(high(period = aggregationPeriod)[-displace], length);
def PDLow = Lowest(low(period = aggregationPeriod)[-displace], length);
def PD_Close = close(period = aggregationPeriod)[1];

def tm = SecondsFromTime(00);
Def gxClose = if tm crosses below tm[1] then close[1] else gxClose[1];

def wPMD = if (HasNoGlobeX and gxclose == PD_Close) then 0 else if gXhigh > PDHigh or gXlow < PDLow then 1 else 0;

AddLabel (PMD_Indicator_Label, if wPMD then "w/PMD" else "w/o PMD", if wPMD then Color.GREEN else Color.PINK);


#WITHOUT PM DATA ----------------------------------------------------------

plot R6 = (highValue / lowValue) * closeValue;
plot R5 = (closeValue + range * (1.1) / 2) + 1.168 * ((closeValue + range * (1.1) / 2) – (closeValue + range * (1.1) / 4));
plot R4a = closeValue + range * (1.098) / 2;
plot R4 = closeValue + range * (1.1) / 2;
plot R3 = closeValue + range * (1.1) / 4;
plot R2 = closeValue + range * (1.1) / 6;
plot R1 = closeValue + range * (1.1) / 12;
plot S1 = closeValue - range * (1.1) / 12;
plot S2 = closeValue - range * (1.1) / 6;
plot S3 = closeValue - range * (1.1) / 4;
plot S4 = closeValue - range * (1.1) / 2;
plot S4a = closeValue - range * (1.098) / 2;
plot S5 = (closeValue - range * (1.1) / 2) - 1.168 * ((closeValue - range * (1.1) / 4) - (closeValue - range * (1.1) / 2));
plot S6 = (closeValue - (R6 - closeValue));

def hidewo = ShowCams == ShowCams."w/Only" or (ShowCams == ShowCams."Auto" and wPMD is true);
R6.SetHiding(hidewo);
R5.SetHiding(hide_s5_r5 or hidewo);
R4.SetHiding(hidewo);
R4a.SetHiding(hide_s4a_r4a or hidewo);
R3.SetHiding(hidewo);
R2.SetHiding(hide_s2_r2 or hidewo);
R1.SetHiding(hide_s1_r1 or hidewo);
S1.SetHiding(hide_s1_r1 or hidewo);
S2.SetHiding(hide_s2_r2 or hidewo);
S3.SetHiding(hidewo);
S4.SetHiding(hidewo);
S4a.SetHiding(hidewo);
S5.SetHiding(hide_s5_r5 or hidewo);
S6.SetHiding(hidewo);

R6.SetDefaultColor(Color.RED);
R5.SetDefaultColor(GetColor(7));
R4.SetDefaultColor(Color.GREEN);
R4a.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(GetColor(7));
R1.SetDefaultColor(GetColor(7));
S1.SetDefaultColor(GetColor(7));
S2.SetDefaultColor(GetColor(7));
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.RED);
S4a.SetDefaultColor(Color.GREEN);
S5.SetDefaultColor(GetColor(7));
S6.SetDefaultColor(Color.GREEN);

def paintingStrategy = if lines == lines.points then PaintingStrategy.POINTS else if lines == lines.triangles then PaintingStrategy.TRIANGLES else if lines == lines.dashes then PaintingStrategy.DASHES else if lines == lines.horizontal then PaintingStrategy.HORIZONTAL else PaintingStrategy.SQUARES;

R6.SetPaintingStrategy(paintingStrategy);
R5.SetPaintingStrategy(paintingStrategy);
R4.SetPaintingStrategy(paintingStrategy);
R4a.SetPaintingStrategy(paintingStrategy);
R3.SetPaintingStrategy(paintingStrategy);
R2.SetPaintingStrategy(paintingStrategy);
R1.SetPaintingStrategy(paintingStrategy);
S1.SetPaintingStrategy(paintingStrategy);
S2.SetPaintingStrategy(paintingStrategy);
S3.SetPaintingStrategy(paintingStrategy);
S4.SetPaintingStrategy(paintingStrategy);
S4a.SetPaintingStrategy(paintingStrategy);
S5.SetPaintingStrategy(paintingStrategy);
S6.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/o Premarket Data --------------------------------------


def StartPlot = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and !wPMD is true or  aggregationPeriod != aggregationPeriod."DAY") or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/o Only") then BubbleLocation else Double.NaN;

AddChartBubble(StartPlot, R6, "R6 " + (if ShowPricesInBubbles then AsText(R6) else ""), Color.PINK,   if close > R6 then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, R5, "R5 " + (if ShowPricesInBubbles then AsText(R5) else ""), Color.GRAY,   if close > R5 then no else yes);
AddChartBubble(StartPlot, R4, "R4 " + (if ShowPricesInBubbles then AsText(R4) else ""), Color.ORANGE,   if close > R4 then no else yes);
AddChartBubble(StartPlot, R3, "R3 " + (if ShowPricesInBubbles then AsText(R3) else ""), Color.PINK,   if close > R3 then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, R2, "R2 " + (if ShowPricesInBubbles then AsText(R2) else ""), Color.GRAY,   if close > R2 then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, R1, "R1 " + (if ShowPricesInBubbles then AsText(R1) else ""), Color.GRAY,   if close > R1 then no else yes);
AddChartBubble(StartPlot, S6, "S6 " + (if ShowPricesInBubbles then AsText(S6) else ""), Color.LIGHT_GREEN, if close > S6 then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, S5, "S5 " + (if ShowPricesInBubbles then AsText(S5) else ""), Color.GRAY, if close > S5 then no else yes);
AddChartBubble(StartPlot, S4, "S4 " + (if ShowPricesInBubbles then AsText(S4) else ""), Color.ORANGE, if close > S4 then no else yes);
AddChartBubble(StartPlot, S3, "S3 " + (if ShowPricesInBubbles then AsText(S3) else ""), Color.LIGHT_GREEN, if close > S3 then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, S2, "S2 " + (if ShowPricesInBubbles then AsText(S2) else ""), Color.GRAY, if close > S2 then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, S1, "S1 " + (if ShowPricesInBubbles then AsText(S1) else ""), Color.GRAY, if close > S1 then no else yes);

R1.HideBubble();
R2.HideBubble();
R3.HideBubble();
R4.HideBubble();
R4a.HideBubble();
R5.HideBubble();
R6.HideBubble();

S1.HideBubble();
S2.HideBubble();
S3.HideBubble();
S4.HideBubble();
S4a.HideBubble();
S5.HideBubble();
S6.HideBubble();

R1.HideTitle();
R2.HideTitle();
R3.HideTitle();
R4.HideTitle();
R4a.HideTitle();
R5.HideTitle();
R6.HideTitle();

S1.HideTitle();
S2.HideTitle();
S3.HideTitle();
S4.HideTitle();
S4a.HideTitle();
S5.HideTitle();
S6.HideTitle();

#WITH PREMARKET DATA-------------------------------------------------------

#plot ExtClose = gxClose;
#plot
#PreviousHighGBX = priorGBXhigh;
#PreviousHighGBX.SetDefaultColor(Color.green);
#plot
#PreviousLowGPX  = priorGBXlow;
#PreviousLowGPX.SetDefaultColor(Color.red);
#plot
#gbxClose = gxClose;
#gbxClose.SetDefaultColor(Color.white);
#AddChartBubble(ShowBubbles && bn == cb, priorGBXhigh, "pGBX High", Color.light_green);
#AddChartBubble(ShowBubbles  && bn == cb, priorGBXlow, "pGBX Low", Color.pink,0);
#AddChartBubble(ShowBubbles  && bn == cb, gxClose, "pGBX close", Color.white,0);

#Plotting
def rangew = priorGBXhigh - priorGBXlow;
plot R6w = (priorGBXhigh / priorGBXlow) * gxClose;
plot R5w = (gxClose + rangew * (1.1) / 2) + 1.168 * ((gxClose + rangew * (1.1) / 2) – (gxClose + rangew * (1.1) / 4));
plot R4wa = gxClose + rangew * (1.098) / 2;
plot R4w = gxClose + rangew * (1.1) / 2;
plot R3w = gxClose + rangew * (1.1) / 4;
plot R2w = gxClose + rangew * (1.1) / 6;
plot R1w = gxClose + rangew * (1.1) / 12;
plot S1w = gxClose - rangew * (1.1) / 12;
plot S2w = gxClose - rangew * (1.1) / 6;
plot S3w = gxClose - rangew * (1.1) / 4;
plot S4w = gxClose - rangew * (1.1) / 2;
plot S4wa = gxClose - rangew * (1.098) / 2;
plot S5w = (gxClose - rangew * (1.1) / 2) - 1.168 * ((gxClose - range * (1.1) / 4) - (gxClose - rangew * (1.1) / 2));
plot S6w = (gxClose - (R6w - gxClose));

def hidew = ShowCams == ShowCams."w/o Only" or (ShowCams == ShowCams."Auto" and !wPMD);
R6w.SetHiding(hidew);
R5w.SetHiding(hide_s5_r5 or hidew);
R4w.SetHiding(hidew);
R4wa.SetHiding(hidew);
R3w.SetHiding(hidew);
R2w.SetHiding(hide_s2_r2 or hidew);
R1w.SetHiding(hide_s1_r1 or hidew);
S1w.SetHiding(hide_s1_r1 or hidew);
S2w.SetHiding(hide_s2_r2 or hidew);
S3w.SetHiding(hidew);
S4w.SetHiding(hidew);
S4wa.SetHiding(hide_s4a_r4a or hidew);
S5w.SetHiding(hide_s5_r5 or hidew);
S6w.SetHiding(hidew);

R6w.SetDefaultColor(Color.RED);
R5w.SetDefaultColor(GetColor(7));
R4w.SetDefaultColor(Color.GREEN);
R4wa.SetDefaultColor(Color.RED);
R3w.SetDefaultColor(Color.RED);
R2w.SetDefaultColor(GetColor(7));
R1w.SetDefaultColor(GetColor(7));
S1w.SetDefaultColor(GetColor(7));
S2w.SetDefaultColor(GetColor(7));
S3w.SetDefaultColor(Color.GREEN);
S4w.SetDefaultColor(Color.RED);
S4wa.SetDefaultColor(Color.GREEN);
S5w.SetDefaultColor(GetColor(7));
S6w.SetDefaultColor(Color.GREEN);

R6w.SetPaintingStrategy(paintingStrategy);
R5w.SetPaintingStrategy(paintingStrategy);
R4w.SetPaintingStrategy(paintingStrategy);
R4wa.SetPaintingStrategy(paintingStrategy);
R3w.SetPaintingStrategy(paintingStrategy);
R2w.SetPaintingStrategy(paintingStrategy);
R1w.SetPaintingStrategy(paintingStrategy);
S1w.SetPaintingStrategy(paintingStrategy);
S2w.SetPaintingStrategy(paintingStrategy);
S3w.SetPaintingStrategy(paintingStrategy);
S4w.SetPaintingStrategy(paintingStrategy);
S4wa.SetPaintingStrategy(paintingStrategy);
S5w.SetPaintingStrategy(paintingStrategy);
S6w.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/Premarket Data ------------------------------------


def StartPlot2 = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and wPMD) or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/Only") then BubbleLocation else Double.NaN;

AddChartBubble(StartPlot2, R6w, "R6w " + (if ShowPricesInBubbles then AsText(R6w) else ""), Color.PINK,   if close > R6w then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, R5w, "R5w " + (if ShowPricesInBubbles then AsText(R5w) else ""), Color.GRAY,   if close > R5w then no else yes);
AddChartBubble(StartPlot2, R4w, "R4w " + (if ShowPricesInBubbles then AsText(R4w) else ""), Color.ORANGE,   if close > R4w then no else yes);
AddChartBubble(StartPlot2, R3w, "R3w " + (if ShowPricesInBubbles then AsText(R3w) else ""), Color.PINK,   if close > R3w then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, R2w, "R2w " + (if ShowPricesInBubbles then AsText(R2w) else ""), Color.GRAY,   if close > R2w then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, R1w, "R1w " + (if ShowPricesInBubbles then AsText(R1w) else ""), Color.GRAY,   if close > R1w then no else yes);

AddChartBubble(StartPlot2, S6w, "S6w " + (if ShowPricesInBubbles then AsText(S6w) else ""), Color.LIGHT_GREEN, if close > S6w then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, S5w, "S5w " + (if ShowPricesInBubbles then AsText(S5w) else ""), Color.GRAY, if close > S5w then no else yes);
AddChartBubble(StartPlot2, S4w, "S4w " + (if ShowPricesInBubbles then AsText(S4w) else ""), Color.ORANGE, if close > S4w then no else yes);
AddChartBubble(StartPlot2, S3w, "S3w " + (if ShowPricesInBubbles then AsText(S3w) else ""), Color.LIGHT_GREEN, if close > S3w then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, S2w, "S2w " + (if ShowPricesInBubbles then AsText(S2w) else ""), Color.GRAY, if close > S2w then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, S1w, "S1w " + (if ShowPricesInBubbles then AsText(S1w) else ""), Color.GRAY, if close > S1w then no else yes);

R1w.HideBubble();
R2w.HideBubble();
R3w.HideBubble();
R4w.HideBubble();
R4wa.HideBubble();
R5w.HideBubble();
R6w.HideBubble();

S1w.HideBubble();
S2w.HideBubble();
S3w.HideBubble();
S4w.HideBubble();
S4wa.HideBubble();
S5w.HideBubble();
S6w.HideBubble();

R1w.HideTitle();
R2w.HideTitle();
R3w.HideTitle();
R4w.HideTitle();
R4wa.HideTitle();
R5w.HideTitle();
R6w.HideTitle();

S1w.HideTitle();
S2w.HideTitle();
S3w.HideTitle();
S4w.HideTitle();
S4wa.HideTitle();
S5w.HideTitle();
S6w.HideTitle();

#Floor Pivots Add-on------------------------------------------------------------------
def PH = high(period = aggregationPeriod)[1];
def PL = low(period = aggregationPeriod)[1];
def PC = close(period = aggregationPeriod)[1];
def PP = (PH + PL + PC) / 3.0;
def bc = (PH + PL) / 2.0;
def tc = (PP - bc) + PP;

plot FR4 = PH + (3 * (PP - PL));
plot FR3 = PH + (2 * (PP - PL));
plot CP = PP;
plot FS3 = PL - (2 * (PH - PP));
plot FS4 = PL - (3 * (PH - PP));


FR4.SetHiding(hide_Floor_Pivots);
FR3.SetHiding(hide_Floor_Pivots);
CP.SetHiding(hide_Floor_Pivots);
FS3.SetHiding(hide_Floor_Pivots);
FS4.SetHiding(hide_Floor_Pivots);

FR4.SetDefaultColor(CreateColor(102, 0, 204));
FR3.SetDefaultColor(Color.MAGENTA);
CP.SetDefaultColor(Color.YELLOW);
FS3.SetDefaultColor(Color.MAGENTA);
FS4.SetDefaultColor(CreateColor(102, 0, 204));

FR4.SetPaintingStrategy(paintingStrategy);
FR3.SetPaintingStrategy(paintingStrategy);
CP.SetPaintingStrategy(paintingStrategy);
FS3.SetPaintingStrategy(paintingStrategy);
FS4.SetPaintingStrategy(paintingStrategy);

def StartPlot3 = if ShowBubbles == yes and hide_Floor_Pivots == no then BubbleLocation else Double.NaN;

AddChartBubble(StartPlot3, CP, "CP " + (if ShowPricesInBubbles then AsText(CP) else ""), Color.YELLOW,   if close > CP then no else yes);
AddChartBubble(StartPlot3, FR4, "FR4 " + (if ShowPricesInBubbles then AsText(FR4) else ""), (CreateColor(102, 0, 204)), if close > FR4 then no else yes);
AddChartBubble(StartPlot3, FR3, "FR3 " + (if ShowPricesInBubbles then AsText(FR3) else ""), Color.MAGENTA,   if close > FR3 then no else yes);
AddChartBubble(StartPlot3, FS4, "FS4 " + (if ShowPricesInBubbles then AsText(FS4) else ""), (CreateColor(102, 0, 204)), if close > FS4 then no else yes);
AddChartBubble(StartPlot3, FS3, "FS3 " + (if ShowPricesInBubbles then AsText(FS3) else ""), Color.MAGENTA, if close > FS3 then no else yes);

FR4.HideBubble();
FR3.HideBubble();
CP.HideBubble();
FS3.HideBubble();
FS4.HideBubble();

FR4.HideTitle();
FR3.HideTitle();
CP.HideTitle();
FS3.HideTitle();
FS4.HideTitle();

Scanners and Watchlist Columns:
To change the % of how close to or far from a cam level to scan or have your watchlist column turn green, just change the 'z <= .2 and z >= -.2' to whatever you please. Note that the codes below are based on the built-in ToS cam study, to scan mine instead just change the 'CamarillaPoints' in the codes to whatever you named my study.

Scanners:
Near Daily cam levels.
Near Monthly cam levels

Watchlist Columns:
Rather than posting 8 watchlist columns, I'm going to share an example of each. Just change all 4 places in the code to other cam levels like R4 or whatnot.

Daily S4:
Code:
def s4 = CamarillaPoints(length = 1).s4 ;
def diff = close - s4 ;
def diff_per = round(100 * diff/s4, 1);

plot z = diff_per;
assignBackgroundColor(if z <= .2 and z >= -.2 then color.dark_green else color.dark_red)

Montly S4:
Code:
def s4 = CamarillaPoints("aggregation period" = "MONTH", "length" = 1).s4 ;
def diff = close - s4 ;
def diff_per = round(100 * diff/s4, 1);

plot z = diff_per;
assignBackgroundColor(if z <= 1 and z >= -1 then color.dark_green else color.dark_red);


gspIimW.png
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

This is a complete trading strategy indicator built around Thor Young's book A Complete Day Trading System.

It includes:
  • Camarilla Pivot Points - Both with and without premarket data.
  • Label on chart showing whether to use cams with or without PMD. See animated gif.
  • Auto option shows only the cams needed based on the above!
  • Optionally show both cams with and without PMD at all times, or only one or the other.
  • Floor Pivots 3, 4, and Central. (Can be toggled on and off).
  • Option to hide cam levels 1, 2 and 5 (hidden by default).
  • Use the bubblemover settings to put the bubbles where you want them on the chart (w one is for w/PMD).
  • S/R4a and S/R4wa are optional, but it allows the dual colors for those levels which you'll see by default. I recommend making the green S4 lines slightly thicker than the red (ex. red 1 green 2) for it to look best.
Download here (or use code below).

I HIGHLY suggest becoming a VIP member here and getting MerryDay's Market Phase / VPA Indicator which complements this perfectly, showing the phases just as Thor teaches them!

Other indicators I also use/recommend:

3TbBZow.png


3TeUn0c.png


Code:
# TD Ameritrade IP Company, Inc. (c) 2013-2021
# Some code based on code by SleepyZ & Nube
# Built by Wiinii and based on Thor's book 'A Complete Day Trading System' to include R5 & S5, levels colored accordingly, CAMS with pre-market data, Central Pivot + Floor Pivots 3&4, and label to easily tell you if you should use With or W/O Premarket Data and option only to show the cams based on that!
# https://usethinkscript.com/threads/pivot-day-trading-system-for-thinkorswim.12988/

declare once_per_bar;

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 1;
input ShowBubbles = yes;
input ShowPricesInBubbles = yes;
input PMD_Indicator_Label = yes;
input ShowCams = {default "Auto", "Both", "w/o Only", "w/Only"};
input hide_Floor_Pivots = no;
input hide_s4a_r4a = no;
input hide_s1_r1 = yes;
input hide_s2_r2 = yes;
input hide_s5_r5 = yes;
input lines = {default horizontal, dashes, points, triangles, squares};

Assert(length > 0, "'length' should be positive: " + length);

def yyyymmdd = GetYYYYMMDD();
def month = GetYear() * 12 + GetMonth();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period;
switch (aggregationPeriod) {
case DAY:
    period = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
    period = Floor(day_number / 7);
case MONTH:
    period = Floor(month - First(month));
}
def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % length else count[1], 0);
def start =  CompoundValue(1, count < count[1] + period - period[1], yes);
def highValue = if start then Highest(high(period = aggregationPeriod), length)[1] else if highValue[1] != 0 then highValue[1] else Double.NaN;
def lowValue = if start then Lowest(low(period = aggregationPeriod), length)[1] else if lowValue[1] != 0 then lowValue[1] else Double.NaN;
def closeValue = if start then close(period = aggregationPeriod)[1] else closeValue[1];
def range = highValue - lowValue;

#PMD Indicator Label on Chart ----------------------------------------------

def na = Double.NaN;
def bn = BarNumber();
def h  = high;
def l  = low;

Script prior {
# subscript for getting prior value of a BarNumber() defined variable
    input prior = close;
    def   priorOf = if prior != prior[1] then prior[1] else priorOf[1];
    plot  priorBar = priorOf;
}
 
   # variables
def cb   = HighestAll(if !IsNaN(h) then bn else na);
def time = GetTime();
def rts  = RegularTradingStart(GetYYYYMMDD());
def rte  = RegularTradingEnd(GetYYYYMMDD());

def RTH = if   time crosses above rts
          then bn else if time <= rts then bn else RTH[1];

def globex = if   time crosses below rte
             then bn else globex[1];

def priorRTH    = prior(RTH);
def priorGlobex = prior(globex);
def hRTH  = HighestAll(RTH);
def hGX   = HighestAll(globex);
def hPRTH = HighestAll(priorRTH);
def hPGX  = HighestAll(priorGlobex);

def gXhigh = HighestAll(if   bn >= hGX && bn < hRTH
                        then h else if hRTH < hGX && bn >= hGX
                                    then h else na);
def gXlow = LowestAll(if   bn >= hGX && bn < hRTH
                      then l else if hRTH < hGX && bn >= hGX
                                  then l else na);

def priorGBXhigh = HighestAll(if   bn >= hPGX
                              &&   bn <  if   hGX < hRTH
                                         then hGX
                                         else hPGX
                              then h else na);
def priorGBXlow = LowestAll(if   bn >= hPGX
                            &&   bn <  if   hGX < hRTH
                                       then hGX
                                       else hPGX
                            then l else na);
         
def wPMD = if gXhigh > priorGBXhigh or gXlow < priorGBXlow then 1 else 0;

AddLabel (PMD_Indicator_Label, if wPMD then "w/PMD" else "w/o PMD", if wPMD then Color.GREEN else Color.PINK);


#WITHOUT PM DATA ----------------------------------------------------------

plot R6 = (highValue / lowValue) * closeValue;
plot R5 = (closeValue + range * (1.1) / 2) + 1.168 * ((closeValue + range * (1.1) / 2) – (closeValue + range * (1.1) / 4));
plot R4a = closeValue + range * (1.098) / 2;
plot R4 = closeValue + range * (1.1) / 2;
plot R3 = closeValue + range * (1.1) / 4;
plot R2 = closeValue + range * (1.1) / 6;
plot R1 = closeValue + range * (1.1) / 12;
plot S1 = closeValue - range * (1.1) / 12;
plot S2 = closeValue - range * (1.1) / 6;
plot S3 = closeValue - range * (1.1) / 4;
plot S4 = closeValue - range * (1.1) / 2;
plot S4a = closeValue - range * (1.098) / 2;
plot S5 = (closeValue - range * (1.1) / 2) - 1.168 * ((closeValue - range * (1.1) / 4) - (closeValue - range * (1.1) / 2));
plot S6 = (closeValue - (R6 - closeValue));

def hidewo = ShowCams == ShowCams."w/Only" or (ShowCams == ShowCams."Auto" and wPMD is true);
R6.SetHiding(hidewo);
R5.SetHiding(hide_s5_r5 or hidewo);
R4.SetHiding(hidewo);
R4a.SetHiding(hide_s4a_r4a or hidewo);
R3.SetHiding(hidewo);
R2.SetHiding(hide_s2_r2 or hidewo);
R1.SetHiding(hide_s1_r1 or hidewo);
S1.SetHiding(hide_s1_r1 or hidewo);
S2.SetHiding(hide_s2_r2 or hidewo);
S3.SetHiding(hidewo);
S4.SetHiding(hidewo);
S4a.SetHiding(hidewo);
S5.SetHiding(hide_s5_r5 or hidewo);
S6.SetHiding(hidewo);

R6.SetDefaultColor(Color.RED);
R5.SetDefaultColor(GetColor(7));
R4.SetDefaultColor(Color.GREEN);
R4a.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(GetColor(7));
R1.SetDefaultColor(GetColor(7));
S1.SetDefaultColor(GetColor(7));
S2.SetDefaultColor(GetColor(7));
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.RED);
S4a.SetDefaultColor(Color.GREEN);
S5.SetDefaultColor(GetColor(7));
S6.SetDefaultColor(Color.GREEN);

def paintingStrategy = if lines == lines.points then PaintingStrategy.POINTS else if lines == lines.triangles then PaintingStrategy.TRIANGLES else if lines == lines.dashes then PaintingStrategy.DASHES else if lines == lines.horizontal then PaintingStrategy.HORIZONTAL else PaintingStrategy.SQUARES;

R6.SetPaintingStrategy(paintingStrategy);
R5.SetPaintingStrategy(paintingStrategy);
R4.SetPaintingStrategy(paintingStrategy);
R4a.SetPaintingStrategy(paintingStrategy);
R3.SetPaintingStrategy(paintingStrategy);
R2.SetPaintingStrategy(paintingStrategy);
R1.SetPaintingStrategy(paintingStrategy);
S1.SetPaintingStrategy(paintingStrategy);
S2.SetPaintingStrategy(paintingStrategy);
S3.SetPaintingStrategy(paintingStrategy);
S4.SetPaintingStrategy(paintingStrategy);
S4a.SetPaintingStrategy(paintingStrategy);
S5.SetPaintingStrategy(paintingStrategy);
S6.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/o Premarket Data --------------------------------------

input bubblemover = -20;
def n = bubblemover;
def n1 = n + 1;

def StartPlot = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and !wPMD is true or  aggregationPeriod != aggregationPeriod."DAY") or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/o Only") then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;

AddChartBubble(StartPlot, R6[n1], "R6 " + (if ShowPricesInBubbles then AsText(R6[n1]) else ""), Color.PINK,   if close[n1] > R6[n1] then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, R5[n1], "R5 " + (if ShowPricesInBubbles then AsText(R5[n1]) else ""), Color.GRAY,   if close[n1] > R5[n1] then no else yes);
AddChartBubble(StartPlot, R4[n1], "R4 " + (if ShowPricesInBubbles then AsText(R4[n1]) else ""), Color.ORANGE,   if close[n1] > R4[n1] then no else yes);
AddChartBubble(StartPlot, R3[n1], "R3 " + (if ShowPricesInBubbles then AsText(R3[n1]) else ""), Color.PINK,   if close[n1] > R3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, R2[n1], "R2 " + (if ShowPricesInBubbles then AsText(R2[n1]) else ""), Color.GRAY,   if close[n1] > R2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, R1[n1], "R1 " + (if ShowPricesInBubbles then AsText(R1[n1]) else ""), Color.GRAY,   if close[n1] > R1[n1] then no else yes);
AddChartBubble(StartPlot, S6[n1], "S6 " + (if ShowPricesInBubbles then AsText(S6[n1]) else ""), Color.LIGHT_GREEN, if close[n1] > S6[n1] then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, S5[n1], "S5 " + (if ShowPricesInBubbles then AsText(S5[n1]) else ""), Color.GRAY, if close[n1] > S5[n1] then no else yes);
AddChartBubble(StartPlot, S4[n1], "S4 " + (if ShowPricesInBubbles then AsText(S4[n1]) else ""), Color.ORANGE, if close[n1] > S4[n1] then no else yes);
AddChartBubble(StartPlot, S3[n1], "S3 " + (if ShowPricesInBubbles then AsText(S3[n1]) else ""), Color.LIGHT_GREEN, if close[n1] > S3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, S2[n1], "S2 " + (if ShowPricesInBubbles then AsText(S2[n1]) else ""), Color.GRAY, if close[n1] > S2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, S1[n1], "S1 " + (if ShowPricesInBubbles then AsText(S1[n1]) else ""), Color.GRAY, if close[n1] > S1[n1] then no else yes);

R1.HideBubble();
R2.HideBubble();
R3.HideBubble();
R4.HideBubble();
R4a.HideBubble();
R5.HideBubble();
R6.HideBubble();

S1.HideBubble();
S2.HideBubble();
S3.HideBubble();
S4.HideBubble();
S4a.HideBubble();
S5.HideBubble();
S6.HideBubble();

#WITH PREMAREKET DATA-------------------------------------------------------

def tm = SecondsFromTime(00);
Def gxClose = if tm crosses below tm[1] then close[1] else gxClose[1];

#plot ExtClose = gxClose;
#plot
#PreviousHighGBX = priorGBXhigh;
#PreviousHighGBX.SetDefaultColor(Color.green);
#plot
#PreviousLowGPX  = priorGBXlow;
#PreviousLowGPX.SetDefaultColor(Color.red);
#plot
#gbxClose = gxClose;
#gbxClose.SetDefaultColor(Color.white);
#AddChartBubble(ShowBubbles && bn == cb, priorGBXhigh, "pGBX High", Color.light_green);
#AddChartBubble(ShowBubbles  && bn == cb, priorGBXlow, "pGBX Low", Color.pink,0);
#AddChartBubble(ShowBubbles  && bn == cb, gxClose, "pGBX close", Color.white,0);

#Plotting
def rangew = priorGBXhigh - priorGBXlow;
plot R6w = (priorGBXhigh / priorGBXlow) * gxClose;
plot R5w = (gxClose + rangew * (1.1) / 2) + 1.168 * ((gxClose + rangew * (1.1) / 2) – (gxClose + rangew * (1.1) / 4));
plot R4wa = gxClose + rangew * (1.098) / 2;
plot R4w = gxClose + rangew * (1.1) / 2;
plot R3w = gxClose + rangew * (1.1) / 4;
plot R2w = gxClose + rangew * (1.1) / 6;
plot R1w = gxClose + rangew * (1.1) / 12;
plot S1w = gxClose - rangew * (1.1) / 12;
plot S2w = gxClose - rangew * (1.1) / 6;
plot S3w = gxClose - rangew * (1.1) / 4;
plot S4w = gxClose - rangew * (1.1) / 2;
plot S4wa = gxClose - rangew * (1.098) / 2;
plot S5w = (gxClose - rangew * (1.1) / 2) - 1.168 * ((gxClose - range * (1.1) / 4) - (gxClose - rangew * (1.1) / 2));
plot S6w = (gxClose - (R6w - gxClose));

def hidew = ShowCams == ShowCams."w/o Only" or (ShowCams == ShowCams."Auto" and !wPMD);
R6w.SetHiding(hidew);
R5w.SetHiding(hide_s5_r5 or hidew);
R4w.SetHiding(hidew);
R4wa.SetHiding(hidew);
R3w.SetHiding(hidew);
R2w.SetHiding(hide_s2_r2 or hidew);
R1w.SetHiding(hide_s1_r1 or hidew);
S1w.SetHiding(hide_s1_r1 or hidew);
S2w.SetHiding(hide_s2_r2 or hidew);
S3w.SetHiding(hidew);
S4w.SetHiding(hidew);
S4wa.SetHiding(hide_s4a_r4a or hidew);
S5w.SetHiding(hide_s5_r5 or hidew);
S6w.SetHiding(hidew);

R6w.SetDefaultColor(Color.RED);
R5w.SetDefaultColor(GetColor(7));
R4w.SetDefaultColor(Color.GREEN);
R4wa.SetDefaultColor(Color.RED);
R3w.SetDefaultColor(Color.RED);
R2w.SetDefaultColor(GetColor(7));
R1w.SetDefaultColor(GetColor(7));
S1w.SetDefaultColor(GetColor(7));
S2w.SetDefaultColor(GetColor(7));
S3w.SetDefaultColor(Color.GREEN);
S4w.SetDefaultColor(Color.RED);
S4wa.SetDefaultColor(Color.GREEN);
S5w.SetDefaultColor(GetColor(7));
S6w.SetDefaultColor(Color.GREEN);

R6w.SetPaintingStrategy(paintingStrategy);
R5w.SetPaintingStrategy(paintingStrategy);
R4w.SetPaintingStrategy(paintingStrategy);
R4wa.SetPaintingStrategy(paintingStrategy);
R3w.SetPaintingStrategy(paintingStrategy);
R2w.SetPaintingStrategy(paintingStrategy);
R1w.SetPaintingStrategy(paintingStrategy);
S1w.SetPaintingStrategy(paintingStrategy);
S2w.SetPaintingStrategy(paintingStrategy);
S3w.SetPaintingStrategy(paintingStrategy);
S4w.SetPaintingStrategy(paintingStrategy);
S4wa.SetPaintingStrategy(paintingStrategy);
S5w.SetPaintingStrategy(paintingStrategy);
S6w.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/Premarket Data ------------------------------------

input w_bubblemover = -50;
def n2 = w_bubblemover;
def n3 = n2 + 1;

def StartPlot2 = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and wPMD) or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/Only") then (IsNaN(close[n2]) and !IsNaN(close[n3])) else Double.NaN;

AddChartBubble(StartPlot2, R6w[n3], "R6w " + (if ShowPricesInBubbles then AsText(R6w[n3]) else ""), Color.PINK,   if close[n3] > R6w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, R5w[n3], "R5w " + (if ShowPricesInBubbles then AsText(R5w[n3]) else ""), Color.GRAY,   if close[n3] > R5w[n3] then no else yes);
AddChartBubble(StartPlot2, R4w[n3], "R4w " + (if ShowPricesInBubbles then AsText(R4w[n3]) else ""), Color.ORANGE,   if close[n3] > R4w[n3] then no else yes);
AddChartBubble(StartPlot2, R3w[n3], "R3w " + (if ShowPricesInBubbles then AsText(R3w[n3]) else ""), Color.PINK,   if close[n3] > R3w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, R2w[n3], "R2w " + (if ShowPricesInBubbles then AsText(R2w[n3]) else ""), Color.GRAY,   if close[n3] > R2w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, R1w[n3], "R1w " + (if ShowPricesInBubbles then AsText(R1w[n3]) else ""), Color.GRAY,   if close[n3] > R1w[n3] then no else yes);

AddChartBubble(StartPlot2, S6w[n3], "S6w " + (if ShowPricesInBubbles then AsText(S6w[n3]) else ""), Color.LIGHT_GREEN, if close[n3] > S6w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, S5w[n3], "S5w " + (if ShowPricesInBubbles then AsText(S5w[n3]) else ""), Color.GRAY, if close[n3] > S5w[n3] then no else yes);
AddChartBubble(StartPlot2, S4w[n3], "S4w " + (if ShowPricesInBubbles then AsText(S4w[n3]) else ""), Color.ORANGE, if close[n3] > S4w[n3] then no else yes);
AddChartBubble(StartPlot2, S3w[n3], "S3w " + (if ShowPricesInBubbles then AsText(S3w[n3]) else ""), Color.LIGHT_GREEN, if close[n3] > S3w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, S2w[n3], "S2w " + (if ShowPricesInBubbles then AsText(S2w[n3]) else ""), Color.GRAY, if close[n3] > S2w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, S1w[n3], "S1w " + (if ShowPricesInBubbles then AsText(S1w[n3]) else ""), Color.GRAY, if close[n3] > S1w[n3] then no else yes);

R1w.HideBubble();
R2w.HideBubble();
R3w.HideBubble();
R4w.HideBubble();
R4wa.HideBubble();
R5w.HideBubble();
R6w.HideBubble();

S1w.HideBubble();
S2w.HideBubble();
S3w.HideBubble();
S4w.HideBubble();
S4wa.HideBubble();
S5w.HideBubble();
S6w.HideBubble();

#Floor Pivots Add-on------------------------------------------------------------------
def PH = high(period = aggregationPeriod)[1];
def PL = low(period = aggregationPeriod)[1];
def PC = close(period = aggregationPeriod)[1];
def PP = (PH + PL + PC) / 3.0;
def bc = (PH + PL) / 2.0;
def tc = (PP - bc) + PP;

plot FR4 = PH + (3 * (PP - PL));
plot FR3 = PH + (2 * (PP - PL));
plot CP = PP;
plot FS3 = PL - (2 * (PH - PP));
plot FS4 = PL - (3 * (PH - PP));


FR4.SetHiding(hide_Floor_Pivots);
FR3.SetHiding(hide_Floor_Pivots);
CP.SetHiding(hide_Floor_Pivots);
FS3.SetHiding(hide_Floor_Pivots);
FS4.SetHiding(hide_Floor_Pivots);

FR4.SetDefaultColor(CreateColor(102, 0, 204));
FR3.SetDefaultColor(Color.MAGENTA);
CP.SetDefaultColor(Color.YELLOW);
FS3.SetDefaultColor(Color.MAGENTA);
FS4.SetDefaultColor(CreateColor(102, 0, 204));

FR4.SetPaintingStrategy(paintingStrategy);
FR3.SetPaintingStrategy(paintingStrategy);
CP.SetPaintingStrategy(paintingStrategy);
FS3.SetPaintingStrategy(paintingStrategy);
FS4.SetPaintingStrategy(paintingStrategy);

def StartPlot3 = if ShowBubbles == yes and hide_Floor_Pivots == no then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;

AddChartBubble(StartPlot3, CP[n1], "CP " + (if ShowPricesInBubbles then AsText(CP[n1]) else ""), Color.YELLOW,   if close[n1] > CP[n1] then no else yes);
AddChartBubble(StartPlot3, FR4[n1], "FR4 " + (if ShowPricesInBubbles then AsText(FR4[n1]) else ""), (CreateColor(102, 0, 204)), if close[n1] > FR4[n1] then no else yes);
AddChartBubble(StartPlot3, FR3[n1], "FR3 " + (if ShowPricesInBubbles then AsText(FR3[n1]) else ""), Color.MAGENTA,   if close[n1] > FR3[n1] then no else yes);
AddChartBubble(StartPlot3, FS4[n1], "FS4 " + (if ShowPricesInBubbles then AsText(FS4[n1]) else ""), (CreateColor(102, 0, 204)), if close[n1] > FS4[n1] then no else yes);
AddChartBubble(StartPlot3, FS3[n1], "FS3 " + (if ShowPricesInBubbles then AsText(FS3[n1]) else ""), Color.MAGENTA, if close[n1] > FS3[n1] then no else yes);

FR4.HideBubble();
FR3.HideBubble();
CP.HideBubble();
FS3.HideBubble();
FS4.HideBubble();
Hi @Wiinii - I trade camarillas, floor pivots, and money zone inspired by Frank Ochoa. I like this indicator you've put together, and am especially interested in the Auto mode that chooses whether to use pre-market data or not. Would you be willing to describe the logic/thought process/theory that goes into determining whether to use to the premarket data in the calculations or not? I struggled for a long time with whether to use globex in the calclulations or not and would love to learn more on this.

Great job pulling all of this together while keeping it simple enough to be of great use!
 
@bigboss If the stock goes above or below the previous day's high or low during after-hours the night before or in today's premarket. When a huge gap happens the regular cams won't even be useful.
 
@Wiinii: Thank you sharing the indicator. I am a new trader and exploring different indicators and strategy in this awesome community. I am looking to scalp/day trade options.
If you don't mind can you share how use this points? I didn't understand what is the strategy here. ( I am newbie so might have missed it)
Thanks again!
 
@Kislayakanan I'm afraid that's a whole book or several to explain, too much to put here. This won't do anything for scalping, it's mainly for trend/reversal trading.
 
Last edited by a moderator:
@Wiinii: Thank you sharing the indicator. I am a new trader and exploring different indicators and strategy in this awesome community. I am looking to scalp/day trade options.
If you don't mind can you share how use this points? I didn't understand what is the strategy here. ( I am newbie so might have missed it)
Thanks again!
There has been some discussion of Camarilla-style trading in this thread:
https://usethinkscript.com/threads/camarilla-pivot-points-for-thinkorswim.696/

But it would be better for you to first read and understand the indicator on the web:
https://www.google.com/search?q=cam...75i199i512.4309j0j15&sourceid=chrome&ie=UTF-8

and then come back and ask specific questions about this strategy.
 
This is a complete trading strategy indicator built around Thor Young's book A Complete Day Trading System.

It includes:
  • Camarilla Pivot Points - Both with and without premarket data.
  • Label on chart showing whether to use cams with or without PMD. See animated gif.
  • Auto option shows only the cams needed based on the above!
  • Optionally show both cams with and without PMD at all times, or only one or the other.
  • Floor Pivots 3, 4, and Central. (Can be toggled on and off).
  • Option to hide cam levels 1, 2 and 5 (hidden by default).
  • Use the bubblemover settings to put the bubbles where you want them on the chart (w one is for w/PMD).
  • S/R4a and S/R4wa are optional, but it allows the dual colors for those levels which you'll see by default. I recommend making the green S4 lines slightly thicker than the red (ex. red 1 green 2) for it to look best.
Shared Link: http://tos.mx/ZSLIuJR (or use code below). Click here for --> Easiest way to load shared links

I HIGHLY suggest becoming a VIP member here and getting MerryDay's Market Phase / VPA Indicator which complements this perfectly, showing the phases just as Thor teaches them!

Other indicators I also use/recommend:

3TbBZow.png


3TeUn0c.png


Code:
# TD Ameritrade IP Company, Inc. (c) 2013-2021
# Some code based on code by SleepyZ & Nube
# Built by Wiinii and based on Thor's book 'A Complete Day Trading System' to include R5 & S5, levels colored accordingly, CAMS with pre-market data, Central Pivot + Floor Pivots 3&4, and label to easily tell you if you should use With or W/O Premarket Data and option only to show the cams based on that!
# https://usethinkscript.com/threads/pivot-day-trading-system-for-thinkorswim.12988/

declare once_per_bar;

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 1;
input ShowBubbles = yes;
input ShowPricesInBubbles = yes;
input PMD_Indicator_Label = yes;
input ShowCams = {default "Auto", "Both", "w/o Only", "w/Only"};
input hide_Floor_Pivots = no;
input hide_s4a_r4a = no;
input hide_s1_r1 = yes;
input hide_s2_r2 = yes;
input hide_s5_r5 = yes;
input lines = {default horizontal, dashes, points, triangles, squares};

Assert(length > 0, "'length' should be positive: " + length);

def yyyymmdd = GetYYYYMMDD();
def month = GetYear() * 12 + GetMonth();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period;
switch (aggregationPeriod) {
case DAY:
    period = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
    period = Floor(day_number / 7);
case MONTH:
    period = Floor(month - First(month));
}
def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % length else count[1], 0);
def start =  CompoundValue(1, count < count[1] + period - period[1], yes);
def highValue = if start then Highest(high(period = aggregationPeriod), length)[1] else if highValue[1] != 0 then highValue[1] else Double.NaN;
def lowValue = if start then Lowest(low(period = aggregationPeriod), length)[1] else if lowValue[1] != 0 then lowValue[1] else Double.NaN;
def closeValue = if start then close(period = aggregationPeriod)[1] else closeValue[1];
def range = highValue - lowValue;

#PMD Indicator Label on Chart ----------------------------------------------

def na = Double.NaN;
def bn = BarNumber();
def h  = high;
def l  = low;

Script prior {
# subscript for getting prior value of a BarNumber() defined variable
    input prior = close;
    def   priorOf = if prior != prior[1] then prior[1] else priorOf[1];
    plot  priorBar = priorOf;
}
 
   # variables
def cb   = HighestAll(if !IsNaN(h) then bn else na);
def time = GetTime();
def rts  = RegularTradingStart(GetYYYYMMDD());
def rte  = RegularTradingEnd(GetYYYYMMDD());

def RTH = if   time crosses above rts
          then bn else if time <= rts then bn else RTH[1];

def globex = if   time crosses below rte
             then bn else globex[1];

def priorRTH    = prior(RTH);
def priorGlobex = prior(globex);
def hRTH  = HighestAll(RTH);
def hGX   = HighestAll(globex);
def hPRTH = HighestAll(priorRTH);
def hPGX  = HighestAll(priorGlobex);

def gXhigh = HighestAll(if   bn >= hGX && bn < hRTH
                        then h else if hRTH < hGX && bn >= hGX
                                    then h else na);
def gXlow = LowestAll(if   bn >= hGX && bn < hRTH
                      then l else if hRTH < hGX && bn >= hGX
                                  then l else na);

def priorGBXhigh = HighestAll(if   bn >= hPGX
                              &&   bn <  if   hGX < hRTH
                                         then hGX
                                         else hPGX
                              then h else na);
def priorGBXlow = LowestAll(if   bn >= hPGX
                            &&   bn <  if   hGX < hRTH
                                       then hGX
                                       else hPGX
                            then l else na);
         
def displace = -1;
def PDHigh = Highest(high(period = aggregationPeriod)[-displace], length);
def PDLow = Lowest(low(period = aggregationPeriod)[-displace], length);
def PD_Close = close(period = aggregationPeriod)[1];

def tm = SecondsFromTime(00);
Def gxClose = if tm crosses below tm[1] then close[1] else gxClose[1];

def wPMD = if gxclose == PD_Close then 0 else if gXhigh > PDHigh or gXlow < PDLow then 1 else 0;

AddLabel (PMD_Indicator_Label, if wPMD then "w/PMD" else "w/o PMD", if wPMD then Color.GREEN else Color.PINK);


#WITHOUT PM DATA ----------------------------------------------------------

plot R6 = (highValue / lowValue) * closeValue;
plot R5 = (closeValue + range * (1.1) / 2) + 1.168 * ((closeValue + range * (1.1) / 2) – (closeValue + range * (1.1) / 4));
plot R4a = closeValue + range * (1.098) / 2;
plot R4 = closeValue + range * (1.1) / 2;
plot R3 = closeValue + range * (1.1) / 4;
plot R2 = closeValue + range * (1.1) / 6;
plot R1 = closeValue + range * (1.1) / 12;
plot S1 = closeValue - range * (1.1) / 12;
plot S2 = closeValue - range * (1.1) / 6;
plot S3 = closeValue - range * (1.1) / 4;
plot S4 = closeValue - range * (1.1) / 2;
plot S4a = closeValue - range * (1.098) / 2;
plot S5 = (closeValue - range * (1.1) / 2) - 1.168 * ((closeValue - range * (1.1) / 4) - (closeValue - range * (1.1) / 2));
plot S6 = (closeValue - (R6 - closeValue));

def hidewo = ShowCams == ShowCams."w/Only" or (ShowCams == ShowCams."Auto" and wPMD is true);
R6.SetHiding(hidewo);
R5.SetHiding(hide_s5_r5 or hidewo);
R4.SetHiding(hidewo);
R4a.SetHiding(hide_s4a_r4a or hidewo);
R3.SetHiding(hidewo);
R2.SetHiding(hide_s2_r2 or hidewo);
R1.SetHiding(hide_s1_r1 or hidewo);
S1.SetHiding(hide_s1_r1 or hidewo);
S2.SetHiding(hide_s2_r2 or hidewo);
S3.SetHiding(hidewo);
S4.SetHiding(hidewo);
S4a.SetHiding(hidewo);
S5.SetHiding(hide_s5_r5 or hidewo);
S6.SetHiding(hidewo);

R6.SetDefaultColor(Color.RED);
R5.SetDefaultColor(GetColor(7));
R4.SetDefaultColor(Color.GREEN);
R4a.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(GetColor(7));
R1.SetDefaultColor(GetColor(7));
S1.SetDefaultColor(GetColor(7));
S2.SetDefaultColor(GetColor(7));
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.RED);
S4a.SetDefaultColor(Color.GREEN);
S5.SetDefaultColor(GetColor(7));
S6.SetDefaultColor(Color.GREEN);

def paintingStrategy = if lines == lines.points then PaintingStrategy.POINTS else if lines == lines.triangles then PaintingStrategy.TRIANGLES else if lines == lines.dashes then PaintingStrategy.DASHES else if lines == lines.horizontal then PaintingStrategy.HORIZONTAL else PaintingStrategy.SQUARES;

R6.SetPaintingStrategy(paintingStrategy);
R5.SetPaintingStrategy(paintingStrategy);
R4.SetPaintingStrategy(paintingStrategy);
R4a.SetPaintingStrategy(paintingStrategy);
R3.SetPaintingStrategy(paintingStrategy);
R2.SetPaintingStrategy(paintingStrategy);
R1.SetPaintingStrategy(paintingStrategy);
S1.SetPaintingStrategy(paintingStrategy);
S2.SetPaintingStrategy(paintingStrategy);
S3.SetPaintingStrategy(paintingStrategy);
S4.SetPaintingStrategy(paintingStrategy);
S4a.SetPaintingStrategy(paintingStrategy);
S5.SetPaintingStrategy(paintingStrategy);
S6.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/o Premarket Data --------------------------------------

input bubblemover = -20;
def n = bubblemover;
def n1 = n + 1;

def StartPlot = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and !wPMD is true or  aggregationPeriod != aggregationPeriod."DAY") or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/o Only") then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;

AddChartBubble(StartPlot, R6[n1], "R6 " + (if ShowPricesInBubbles then AsText(R6[n1]) else ""), Color.PINK,   if close[n1] > R6[n1] then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, R5[n1], "R5 " + (if ShowPricesInBubbles then AsText(R5[n1]) else ""), Color.GRAY,   if close[n1] > R5[n1] then no else yes);
AddChartBubble(StartPlot, R4[n1], "R4 " + (if ShowPricesInBubbles then AsText(R4[n1]) else ""), Color.ORANGE,   if close[n1] > R4[n1] then no else yes);
AddChartBubble(StartPlot, R3[n1], "R3 " + (if ShowPricesInBubbles then AsText(R3[n1]) else ""), Color.PINK,   if close[n1] > R3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, R2[n1], "R2 " + (if ShowPricesInBubbles then AsText(R2[n1]) else ""), Color.GRAY,   if close[n1] > R2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, R1[n1], "R1 " + (if ShowPricesInBubbles then AsText(R1[n1]) else ""), Color.GRAY,   if close[n1] > R1[n1] then no else yes);
AddChartBubble(StartPlot, S6[n1], "S6 " + (if ShowPricesInBubbles then AsText(S6[n1]) else ""), Color.LIGHT_GREEN, if close[n1] > S6[n1] then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, S5[n1], "S5 " + (if ShowPricesInBubbles then AsText(S5[n1]) else ""), Color.GRAY, if close[n1] > S5[n1] then no else yes);
AddChartBubble(StartPlot, S4[n1], "S4 " + (if ShowPricesInBubbles then AsText(S4[n1]) else ""), Color.ORANGE, if close[n1] > S4[n1] then no else yes);
AddChartBubble(StartPlot, S3[n1], "S3 " + (if ShowPricesInBubbles then AsText(S3[n1]) else ""), Color.LIGHT_GREEN, if close[n1] > S3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, S2[n1], "S2 " + (if ShowPricesInBubbles then AsText(S2[n1]) else ""), Color.GRAY, if close[n1] > S2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, S1[n1], "S1 " + (if ShowPricesInBubbles then AsText(S1[n1]) else ""), Color.GRAY, if close[n1] > S1[n1] then no else yes);

R1.HideBubble();
R2.HideBubble();
R3.HideBubble();
R4.HideBubble();
R4a.HideBubble();
R5.HideBubble();
R6.HideBubble();

S1.HideBubble();
S2.HideBubble();
S3.HideBubble();
S4.HideBubble();
S4a.HideBubble();
S5.HideBubble();
S6.HideBubble();

#WITH PREMAREKET DATA-------------------------------------------------------

#plot ExtClose = gxClose;
#plot
#PreviousHighGBX = priorGBXhigh;
#PreviousHighGBX.SetDefaultColor(Color.green);
#plot
#PreviousLowGPX  = priorGBXlow;
#PreviousLowGPX.SetDefaultColor(Color.red);
#plot
#gbxClose = gxClose;
#gbxClose.SetDefaultColor(Color.white);
#AddChartBubble(ShowBubbles && bn == cb, priorGBXhigh, "pGBX High", Color.light_green);
#AddChartBubble(ShowBubbles  && bn == cb, priorGBXlow, "pGBX Low", Color.pink,0);
#AddChartBubble(ShowBubbles  && bn == cb, gxClose, "pGBX close", Color.white,0);

#Plotting
def rangew = priorGBXhigh - priorGBXlow;
plot R6w = (priorGBXhigh / priorGBXlow) * gxClose;
plot R5w = (gxClose + rangew * (1.1) / 2) + 1.168 * ((gxClose + rangew * (1.1) / 2) – (gxClose + rangew * (1.1) / 4));
plot R4wa = gxClose + rangew * (1.098) / 2;
plot R4w = gxClose + rangew * (1.1) / 2;
plot R3w = gxClose + rangew * (1.1) / 4;
plot R2w = gxClose + rangew * (1.1) / 6;
plot R1w = gxClose + rangew * (1.1) / 12;
plot S1w = gxClose - rangew * (1.1) / 12;
plot S2w = gxClose - rangew * (1.1) / 6;
plot S3w = gxClose - rangew * (1.1) / 4;
plot S4w = gxClose - rangew * (1.1) / 2;
plot S4wa = gxClose - rangew * (1.098) / 2;
plot S5w = (gxClose - rangew * (1.1) / 2) - 1.168 * ((gxClose - range * (1.1) / 4) - (gxClose - rangew * (1.1) / 2));
plot S6w = (gxClose - (R6w - gxClose));

def hidew = ShowCams == ShowCams."w/o Only" or (ShowCams == ShowCams."Auto" and !wPMD);
R6w.SetHiding(hidew);
R5w.SetHiding(hide_s5_r5 or hidew);
R4w.SetHiding(hidew);
R4wa.SetHiding(hidew);
R3w.SetHiding(hidew);
R2w.SetHiding(hide_s2_r2 or hidew);
R1w.SetHiding(hide_s1_r1 or hidew);
S1w.SetHiding(hide_s1_r1 or hidew);
S2w.SetHiding(hide_s2_r2 or hidew);
S3w.SetHiding(hidew);
S4w.SetHiding(hidew);
S4wa.SetHiding(hide_s4a_r4a or hidew);
S5w.SetHiding(hide_s5_r5 or hidew);
S6w.SetHiding(hidew);

R6w.SetDefaultColor(Color.RED);
R5w.SetDefaultColor(GetColor(7));
R4w.SetDefaultColor(Color.GREEN);
R4wa.SetDefaultColor(Color.RED);
R3w.SetDefaultColor(Color.RED);
R2w.SetDefaultColor(GetColor(7));
R1w.SetDefaultColor(GetColor(7));
S1w.SetDefaultColor(GetColor(7));
S2w.SetDefaultColor(GetColor(7));
S3w.SetDefaultColor(Color.GREEN);
S4w.SetDefaultColor(Color.RED);
S4wa.SetDefaultColor(Color.GREEN);
S5w.SetDefaultColor(GetColor(7));
S6w.SetDefaultColor(Color.GREEN);

R6w.SetPaintingStrategy(paintingStrategy);
R5w.SetPaintingStrategy(paintingStrategy);
R4w.SetPaintingStrategy(paintingStrategy);
R4wa.SetPaintingStrategy(paintingStrategy);
R3w.SetPaintingStrategy(paintingStrategy);
R2w.SetPaintingStrategy(paintingStrategy);
R1w.SetPaintingStrategy(paintingStrategy);
S1w.SetPaintingStrategy(paintingStrategy);
S2w.SetPaintingStrategy(paintingStrategy);
S3w.SetPaintingStrategy(paintingStrategy);
S4w.SetPaintingStrategy(paintingStrategy);
S4wa.SetPaintingStrategy(paintingStrategy);
S5w.SetPaintingStrategy(paintingStrategy);
S6w.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/Premarket Data ------------------------------------

input w_bubblemover = -50;
def n2 = w_bubblemover;
def n3 = n2 + 1;

def StartPlot2 = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and wPMD) or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/Only") then (IsNaN(close[n2]) and !IsNaN(close[n3])) else Double.NaN;

AddChartBubble(StartPlot2, R6w[n3], "R6w " + (if ShowPricesInBubbles then AsText(R6w[n3]) else ""), Color.PINK,   if close[n3] > R6w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, R5w[n3], "R5w " + (if ShowPricesInBubbles then AsText(R5w[n3]) else ""), Color.GRAY,   if close[n3] > R5w[n3] then no else yes);
AddChartBubble(StartPlot2, R4w[n3], "R4w " + (if ShowPricesInBubbles then AsText(R4w[n3]) else ""), Color.ORANGE,   if close[n3] > R4w[n3] then no else yes);
AddChartBubble(StartPlot2, R3w[n3], "R3w " + (if ShowPricesInBubbles then AsText(R3w[n3]) else ""), Color.PINK,   if close[n3] > R3w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, R2w[n3], "R2w " + (if ShowPricesInBubbles then AsText(R2w[n3]) else ""), Color.GRAY,   if close[n3] > R2w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, R1w[n3], "R1w " + (if ShowPricesInBubbles then AsText(R1w[n3]) else ""), Color.GRAY,   if close[n3] > R1w[n3] then no else yes);

AddChartBubble(StartPlot2, S6w[n3], "S6w " + (if ShowPricesInBubbles then AsText(S6w[n3]) else ""), Color.LIGHT_GREEN, if close[n3] > S6w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, S5w[n3], "S5w " + (if ShowPricesInBubbles then AsText(S5w[n3]) else ""), Color.GRAY, if close[n3] > S5w[n3] then no else yes);
AddChartBubble(StartPlot2, S4w[n3], "S4w " + (if ShowPricesInBubbles then AsText(S4w[n3]) else ""), Color.ORANGE, if close[n3] > S4w[n3] then no else yes);
AddChartBubble(StartPlot2, S3w[n3], "S3w " + (if ShowPricesInBubbles then AsText(S3w[n3]) else ""), Color.LIGHT_GREEN, if close[n3] > S3w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, S2w[n3], "S2w " + (if ShowPricesInBubbles then AsText(S2w[n3]) else ""), Color.GRAY, if close[n3] > S2w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, S1w[n3], "S1w " + (if ShowPricesInBubbles then AsText(S1w[n3]) else ""), Color.GRAY, if close[n3] > S1w[n3] then no else yes);

R1w.HideBubble();
R2w.HideBubble();
R3w.HideBubble();
R4w.HideBubble();
R4wa.HideBubble();
R5w.HideBubble();
R6w.HideBubble();

S1w.HideBubble();
S2w.HideBubble();
S3w.HideBubble();
S4w.HideBubble();
S4wa.HideBubble();
S5w.HideBubble();
S6w.HideBubble();

#Floor Pivots Add-on------------------------------------------------------------------
def PH = high(period = aggregationPeriod)[1];
def PL = low(period = aggregationPeriod)[1];
def PC = close(period = aggregationPeriod)[1];
def PP = (PH + PL + PC) / 3.0;
def bc = (PH + PL) / 2.0;
def tc = (PP - bc) + PP;

plot FR4 = PH + (3 * (PP - PL));
plot FR3 = PH + (2 * (PP - PL));
plot CP = PP;
plot FS3 = PL - (2 * (PH - PP));
plot FS4 = PL - (3 * (PH - PP));


FR4.SetHiding(hide_Floor_Pivots);
FR3.SetHiding(hide_Floor_Pivots);
CP.SetHiding(hide_Floor_Pivots);
FS3.SetHiding(hide_Floor_Pivots);
FS4.SetHiding(hide_Floor_Pivots);

FR4.SetDefaultColor(CreateColor(102, 0, 204));
FR3.SetDefaultColor(Color.MAGENTA);
CP.SetDefaultColor(Color.YELLOW);
FS3.SetDefaultColor(Color.MAGENTA);
FS4.SetDefaultColor(CreateColor(102, 0, 204));

FR4.SetPaintingStrategy(paintingStrategy);
FR3.SetPaintingStrategy(paintingStrategy);
CP.SetPaintingStrategy(paintingStrategy);
FS3.SetPaintingStrategy(paintingStrategy);
FS4.SetPaintingStrategy(paintingStrategy);

def StartPlot3 = if ShowBubbles == yes and hide_Floor_Pivots == no then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;

AddChartBubble(StartPlot3, CP[n1], "CP " + (if ShowPricesInBubbles then AsText(CP[n1]) else ""), Color.YELLOW,   if close[n1] > CP[n1] then no else yes);
AddChartBubble(StartPlot3, FR4[n1], "FR4 " + (if ShowPricesInBubbles then AsText(FR4[n1]) else ""), (CreateColor(102, 0, 204)), if close[n1] > FR4[n1] then no else yes);
AddChartBubble(StartPlot3, FR3[n1], "FR3 " + (if ShowPricesInBubbles then AsText(FR3[n1]) else ""), Color.MAGENTA,   if close[n1] > FR3[n1] then no else yes);
AddChartBubble(StartPlot3, FS4[n1], "FS4 " + (if ShowPricesInBubbles then AsText(FS4[n1]) else ""), (CreateColor(102, 0, 204)), if close[n1] > FS4[n1] then no else yes);
AddChartBubble(StartPlot3, FS3[n1], "FS3 " + (if ShowPricesInBubbles then AsText(FS3[n1]) else ""), Color.MAGENTA, if close[n1] > FS3[n1] then no else yes);

FR4.HideBubble();
FR3.HideBubble();
CP.HideBubble();
FS3.HideBubble();
FS4.HideBubble();
Thanks for the work you've done on this! I am having an issue with my candles flattening to a barely perceptible height, even when I apply the native TOS Cam study. Any idea what I am doing wrong?
 
This is a complete trading strategy indicator built around Thor Young's book A Complete Day Trading System.

It includes:
  • Camarilla Pivot Points - Both with and without premarket data.
  • Label on chart showing whether to use cams with or without PMD. See animated gif.
  • Auto option shows only the cams needed based on the above!
  • Optionally show both cams with and without PMD at all times, or only one or the other.
  • Floor Pivots 3, 4, and Central. (Can be toggled on and off).
  • Option to hide cam levels 1, 2 and 5 (hidden by default).
  • Use the bubblemover settings to put the bubbles where you want them on the chart (w one is for w/PMD).
  • S/R4a and S/R4wa are optional, but it allows the dual colors for those levels which you'll see by default. I recommend making the green S4 lines slightly thicker than the red (ex. red 1 green 2) for it to look best.
Shared Link: http://tos.mx/ZSLIuJR (or use code below). Click here for --> Easiest way to load shared links

I HIGHLY suggest becoming a VIP member here and getting MerryDay's Market Phase / VPA Indicator which complements this perfectly, showing the phases just as Thor teaches them!

Other indicators I also use/recommend:

3TbBZow.png


3TeUn0c.png


Code:
# TD Ameritrade IP Company, Inc. (c) 2013-2021
# Some code based on code by SleepyZ & Nube
# Built by Wiinii and based on Thor's book 'A Complete Day Trading System' to include R5 & S5, levels colored accordingly, CAMS with pre-market data, Central Pivot + Floor Pivots 3&4, and label to easily tell you if you should use With or W/O Premarket Data and option only to show the cams based on that!
# https://usethinkscript.com/threads/pivot-day-trading-system-for-thinkorswim.12988/

declare once_per_bar;

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 1;
input ShowBubbles = yes;
input ShowPricesInBubbles = yes;
input PMD_Indicator_Label = yes;
input ShowCams = {default "Auto", "Both", "w/o Only", "w/Only"};
input hide_Floor_Pivots = no;
input hide_s4a_r4a = no;
input hide_s1_r1 = yes;
input hide_s2_r2 = yes;
input hide_s5_r5 = yes;
input lines = {default horizontal, dashes, points, triangles, squares};

Assert(length > 0, "'length' should be positive: " + length);

def yyyymmdd = GetYYYYMMDD();
def month = GetYear() * 12 + GetMonth();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period;
switch (aggregationPeriod) {
case DAY:
    period = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
    period = Floor(day_number / 7);
case MONTH:
    period = Floor(month - First(month));
}
def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % length else count[1], 0);
def start =  CompoundValue(1, count < count[1] + period - period[1], yes);
def highValue = if start then Highest(high(period = aggregationPeriod), length)[1] else if highValue[1] != 0 then highValue[1] else Double.NaN;
def lowValue = if start then Lowest(low(period = aggregationPeriod), length)[1] else if lowValue[1] != 0 then lowValue[1] else Double.NaN;
def closeValue = if start then close(period = aggregationPeriod)[1] else closeValue[1];
def range = highValue - lowValue;

#PMD Indicator Label on Chart ----------------------------------------------

def na = Double.NaN;
def bn = BarNumber();
def h  = high;
def l  = low;

Script prior {
# subscript for getting prior value of a BarNumber() defined variable
    input prior = close;
    def   priorOf = if prior != prior[1] then prior[1] else priorOf[1];
    plot  priorBar = priorOf;
}
 
   # variables
def cb   = HighestAll(if !IsNaN(h) then bn else na);
def time = GetTime();
def rts  = RegularTradingStart(GetYYYYMMDD());
def rte  = RegularTradingEnd(GetYYYYMMDD());

def RTH = if   time crosses above rts
          then bn else if time <= rts then bn else RTH[1];

def globex = if   time crosses below rte
             then bn else globex[1];

def priorRTH    = prior(RTH);
def priorGlobex = prior(globex);
def hRTH  = HighestAll(RTH);
def hGX   = HighestAll(globex);
def hPRTH = HighestAll(priorRTH);
def hPGX  = HighestAll(priorGlobex);

def gXhigh = HighestAll(if   bn >= hGX && bn < hRTH
                        then h else if hRTH < hGX && bn >= hGX
                                    then h else na);
def gXlow = LowestAll(if   bn >= hGX && bn < hRTH
                      then l else if hRTH < hGX && bn >= hGX
                                  then l else na);

def priorGBXhigh = HighestAll(if   bn >= hPGX
                              &&   bn <  if   hGX < hRTH
                                         then hGX
                                         else hPGX
                              then h else na);
def priorGBXlow = LowestAll(if   bn >= hPGX
                            &&   bn <  if   hGX < hRTH
                                       then hGX
                                       else hPGX
                            then l else na);
         
def displace = -1;
def PDHigh = Highest(high(period = aggregationPeriod)[-displace], length);
def PDLow = Lowest(low(period = aggregationPeriod)[-displace], length);
def PD_Close = close(period = aggregationPeriod)[1];

def tm = SecondsFromTime(00);
Def gxClose = if tm crosses below tm[1] then close[1] else gxClose[1];

def wPMD = if gxclose == PD_Close then 0 else if gXhigh > PDHigh or gXlow < PDLow then 1 else 0;

AddLabel (PMD_Indicator_Label, if wPMD then "w/PMD" else "w/o PMD", if wPMD then Color.GREEN else Color.PINK);


#WITHOUT PM DATA ----------------------------------------------------------

plot R6 = (highValue / lowValue) * closeValue;
plot R5 = (closeValue + range * (1.1) / 2) + 1.168 * ((closeValue + range * (1.1) / 2) – (closeValue + range * (1.1) / 4));
plot R4a = closeValue + range * (1.098) / 2;
plot R4 = closeValue + range * (1.1) / 2;
plot R3 = closeValue + range * (1.1) / 4;
plot R2 = closeValue + range * (1.1) / 6;
plot R1 = closeValue + range * (1.1) / 12;
plot S1 = closeValue - range * (1.1) / 12;
plot S2 = closeValue - range * (1.1) / 6;
plot S3 = closeValue - range * (1.1) / 4;
plot S4 = closeValue - range * (1.1) / 2;
plot S4a = closeValue - range * (1.098) / 2;
plot S5 = (closeValue - range * (1.1) / 2) - 1.168 * ((closeValue - range * (1.1) / 4) - (closeValue - range * (1.1) / 2));
plot S6 = (closeValue - (R6 - closeValue));

def hidewo = ShowCams == ShowCams."w/Only" or (ShowCams == ShowCams."Auto" and wPMD is true);
R6.SetHiding(hidewo);
R5.SetHiding(hide_s5_r5 or hidewo);
R4.SetHiding(hidewo);
R4a.SetHiding(hide_s4a_r4a or hidewo);
R3.SetHiding(hidewo);
R2.SetHiding(hide_s2_r2 or hidewo);
R1.SetHiding(hide_s1_r1 or hidewo);
S1.SetHiding(hide_s1_r1 or hidewo);
S2.SetHiding(hide_s2_r2 or hidewo);
S3.SetHiding(hidewo);
S4.SetHiding(hidewo);
S4a.SetHiding(hidewo);
S5.SetHiding(hide_s5_r5 or hidewo);
S6.SetHiding(hidewo);

R6.SetDefaultColor(Color.RED);
R5.SetDefaultColor(GetColor(7));
R4.SetDefaultColor(Color.GREEN);
R4a.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(GetColor(7));
R1.SetDefaultColor(GetColor(7));
S1.SetDefaultColor(GetColor(7));
S2.SetDefaultColor(GetColor(7));
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.RED);
S4a.SetDefaultColor(Color.GREEN);
S5.SetDefaultColor(GetColor(7));
S6.SetDefaultColor(Color.GREEN);

def paintingStrategy = if lines == lines.points then PaintingStrategy.POINTS else if lines == lines.triangles then PaintingStrategy.TRIANGLES else if lines == lines.dashes then PaintingStrategy.DASHES else if lines == lines.horizontal then PaintingStrategy.HORIZONTAL else PaintingStrategy.SQUARES;

R6.SetPaintingStrategy(paintingStrategy);
R5.SetPaintingStrategy(paintingStrategy);
R4.SetPaintingStrategy(paintingStrategy);
R4a.SetPaintingStrategy(paintingStrategy);
R3.SetPaintingStrategy(paintingStrategy);
R2.SetPaintingStrategy(paintingStrategy);
R1.SetPaintingStrategy(paintingStrategy);
S1.SetPaintingStrategy(paintingStrategy);
S2.SetPaintingStrategy(paintingStrategy);
S3.SetPaintingStrategy(paintingStrategy);
S4.SetPaintingStrategy(paintingStrategy);
S4a.SetPaintingStrategy(paintingStrategy);
S5.SetPaintingStrategy(paintingStrategy);
S6.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/o Premarket Data --------------------------------------

input bubblemover = -20;
def n = bubblemover;
def n1 = n + 1;

def StartPlot = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and !wPMD is true or  aggregationPeriod != aggregationPeriod."DAY") or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/o Only") then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;

AddChartBubble(StartPlot, R6[n1], "R6 " + (if ShowPricesInBubbles then AsText(R6[n1]) else ""), Color.PINK,   if close[n1] > R6[n1] then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, R5[n1], "R5 " + (if ShowPricesInBubbles then AsText(R5[n1]) else ""), Color.GRAY,   if close[n1] > R5[n1] then no else yes);
AddChartBubble(StartPlot, R4[n1], "R4 " + (if ShowPricesInBubbles then AsText(R4[n1]) else ""), Color.ORANGE,   if close[n1] > R4[n1] then no else yes);
AddChartBubble(StartPlot, R3[n1], "R3 " + (if ShowPricesInBubbles then AsText(R3[n1]) else ""), Color.PINK,   if close[n1] > R3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, R2[n1], "R2 " + (if ShowPricesInBubbles then AsText(R2[n1]) else ""), Color.GRAY,   if close[n1] > R2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, R1[n1], "R1 " + (if ShowPricesInBubbles then AsText(R1[n1]) else ""), Color.GRAY,   if close[n1] > R1[n1] then no else yes);
AddChartBubble(StartPlot, S6[n1], "S6 " + (if ShowPricesInBubbles then AsText(S6[n1]) else ""), Color.LIGHT_GREEN, if close[n1] > S6[n1] then no else yes);
AddChartBubble(StartPlot and hide_s5_r5 == no, S5[n1], "S5 " + (if ShowPricesInBubbles then AsText(S5[n1]) else ""), Color.GRAY, if close[n1] > S5[n1] then no else yes);
AddChartBubble(StartPlot, S4[n1], "S4 " + (if ShowPricesInBubbles then AsText(S4[n1]) else ""), Color.ORANGE, if close[n1] > S4[n1] then no else yes);
AddChartBubble(StartPlot, S3[n1], "S3 " + (if ShowPricesInBubbles then AsText(S3[n1]) else ""), Color.LIGHT_GREEN, if close[n1] > S3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, S2[n1], "S2 " + (if ShowPricesInBubbles then AsText(S2[n1]) else ""), Color.GRAY, if close[n1] > S2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, S1[n1], "S1 " + (if ShowPricesInBubbles then AsText(S1[n1]) else ""), Color.GRAY, if close[n1] > S1[n1] then no else yes);

R1.HideBubble();
R2.HideBubble();
R3.HideBubble();
R4.HideBubble();
R4a.HideBubble();
R5.HideBubble();
R6.HideBubble();

S1.HideBubble();
S2.HideBubble();
S3.HideBubble();
S4.HideBubble();
S4a.HideBubble();
S5.HideBubble();
S6.HideBubble();

#WITH PREMAREKET DATA-------------------------------------------------------

#plot ExtClose = gxClose;
#plot
#PreviousHighGBX = priorGBXhigh;
#PreviousHighGBX.SetDefaultColor(Color.green);
#plot
#PreviousLowGPX  = priorGBXlow;
#PreviousLowGPX.SetDefaultColor(Color.red);
#plot
#gbxClose = gxClose;
#gbxClose.SetDefaultColor(Color.white);
#AddChartBubble(ShowBubbles && bn == cb, priorGBXhigh, "pGBX High", Color.light_green);
#AddChartBubble(ShowBubbles  && bn == cb, priorGBXlow, "pGBX Low", Color.pink,0);
#AddChartBubble(ShowBubbles  && bn == cb, gxClose, "pGBX close", Color.white,0);

#Plotting
def rangew = priorGBXhigh - priorGBXlow;
plot R6w = (priorGBXhigh / priorGBXlow) * gxClose;
plot R5w = (gxClose + rangew * (1.1) / 2) + 1.168 * ((gxClose + rangew * (1.1) / 2) – (gxClose + rangew * (1.1) / 4));
plot R4wa = gxClose + rangew * (1.098) / 2;
plot R4w = gxClose + rangew * (1.1) / 2;
plot R3w = gxClose + rangew * (1.1) / 4;
plot R2w = gxClose + rangew * (1.1) / 6;
plot R1w = gxClose + rangew * (1.1) / 12;
plot S1w = gxClose - rangew * (1.1) / 12;
plot S2w = gxClose - rangew * (1.1) / 6;
plot S3w = gxClose - rangew * (1.1) / 4;
plot S4w = gxClose - rangew * (1.1) / 2;
plot S4wa = gxClose - rangew * (1.098) / 2;
plot S5w = (gxClose - rangew * (1.1) / 2) - 1.168 * ((gxClose - range * (1.1) / 4) - (gxClose - rangew * (1.1) / 2));
plot S6w = (gxClose - (R6w - gxClose));

def hidew = ShowCams == ShowCams."w/o Only" or (ShowCams == ShowCams."Auto" and !wPMD);
R6w.SetHiding(hidew);
R5w.SetHiding(hide_s5_r5 or hidew);
R4w.SetHiding(hidew);
R4wa.SetHiding(hidew);
R3w.SetHiding(hidew);
R2w.SetHiding(hide_s2_r2 or hidew);
R1w.SetHiding(hide_s1_r1 or hidew);
S1w.SetHiding(hide_s1_r1 or hidew);
S2w.SetHiding(hide_s2_r2 or hidew);
S3w.SetHiding(hidew);
S4w.SetHiding(hidew);
S4wa.SetHiding(hide_s4a_r4a or hidew);
S5w.SetHiding(hide_s5_r5 or hidew);
S6w.SetHiding(hidew);

R6w.SetDefaultColor(Color.RED);
R5w.SetDefaultColor(GetColor(7));
R4w.SetDefaultColor(Color.GREEN);
R4wa.SetDefaultColor(Color.RED);
R3w.SetDefaultColor(Color.RED);
R2w.SetDefaultColor(GetColor(7));
R1w.SetDefaultColor(GetColor(7));
S1w.SetDefaultColor(GetColor(7));
S2w.SetDefaultColor(GetColor(7));
S3w.SetDefaultColor(Color.GREEN);
S4w.SetDefaultColor(Color.RED);
S4wa.SetDefaultColor(Color.GREEN);
S5w.SetDefaultColor(GetColor(7));
S6w.SetDefaultColor(Color.GREEN);

R6w.SetPaintingStrategy(paintingStrategy);
R5w.SetPaintingStrategy(paintingStrategy);
R4w.SetPaintingStrategy(paintingStrategy);
R4wa.SetPaintingStrategy(paintingStrategy);
R3w.SetPaintingStrategy(paintingStrategy);
R2w.SetPaintingStrategy(paintingStrategy);
R1w.SetPaintingStrategy(paintingStrategy);
S1w.SetPaintingStrategy(paintingStrategy);
S2w.SetPaintingStrategy(paintingStrategy);
S3w.SetPaintingStrategy(paintingStrategy);
S4w.SetPaintingStrategy(paintingStrategy);
S4wa.SetPaintingStrategy(paintingStrategy);
S5w.SetPaintingStrategy(paintingStrategy);
S6w.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels w/Premarket Data ------------------------------------

input w_bubblemover = -50;
def n2 = w_bubblemover;
def n3 = n2 + 1;

def StartPlot2 = if ShowBubbles == yes and ((ShowCams == ShowCams."Auto" and wPMD) or ShowCams == ShowCams."Both" or ShowCams == ShowCams."w/Only") then (IsNaN(close[n2]) and !IsNaN(close[n3])) else Double.NaN;

AddChartBubble(StartPlot2, R6w[n3], "R6w " + (if ShowPricesInBubbles then AsText(R6w[n3]) else ""), Color.PINK,   if close[n3] > R6w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, R5w[n3], "R5w " + (if ShowPricesInBubbles then AsText(R5w[n3]) else ""), Color.GRAY,   if close[n3] > R5w[n3] then no else yes);
AddChartBubble(StartPlot2, R4w[n3], "R4w " + (if ShowPricesInBubbles then AsText(R4w[n3]) else ""), Color.ORANGE,   if close[n3] > R4w[n3] then no else yes);
AddChartBubble(StartPlot2, R3w[n3], "R3w " + (if ShowPricesInBubbles then AsText(R3w[n3]) else ""), Color.PINK,   if close[n3] > R3w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, R2w[n3], "R2w " + (if ShowPricesInBubbles then AsText(R2w[n3]) else ""), Color.GRAY,   if close[n3] > R2w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, R1w[n3], "R1w " + (if ShowPricesInBubbles then AsText(R1w[n3]) else ""), Color.GRAY,   if close[n3] > R1w[n3] then no else yes);

AddChartBubble(StartPlot2, S6w[n3], "S6w " + (if ShowPricesInBubbles then AsText(S6w[n3]) else ""), Color.LIGHT_GREEN, if close[n3] > S6w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s5_r5 == no, S5w[n3], "S5w " + (if ShowPricesInBubbles then AsText(S5w[n3]) else ""), Color.GRAY, if close[n3] > S5w[n3] then no else yes);
AddChartBubble(StartPlot2, S4w[n3], "S4w " + (if ShowPricesInBubbles then AsText(S4w[n3]) else ""), Color.ORANGE, if close[n3] > S4w[n3] then no else yes);
AddChartBubble(StartPlot2, S3w[n3], "S3w " + (if ShowPricesInBubbles then AsText(S3w[n3]) else ""), Color.LIGHT_GREEN, if close[n3] > S3w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s2_r2 == no, S2w[n3], "S2w " + (if ShowPricesInBubbles then AsText(S2w[n3]) else ""), Color.GRAY, if close[n3] > S2w[n3] then no else yes);
AddChartBubble(StartPlot2 and hide_s1_r1 == no, S1w[n3], "S1w " + (if ShowPricesInBubbles then AsText(S1w[n3]) else ""), Color.GRAY, if close[n3] > S1w[n3] then no else yes);

R1w.HideBubble();
R2w.HideBubble();
R3w.HideBubble();
R4w.HideBubble();
R4wa.HideBubble();
R5w.HideBubble();
R6w.HideBubble();

S1w.HideBubble();
S2w.HideBubble();
S3w.HideBubble();
S4w.HideBubble();
S4wa.HideBubble();
S5w.HideBubble();
S6w.HideBubble();

#Floor Pivots Add-on------------------------------------------------------------------
def PH = high(period = aggregationPeriod)[1];
def PL = low(period = aggregationPeriod)[1];
def PC = close(period = aggregationPeriod)[1];
def PP = (PH + PL + PC) / 3.0;
def bc = (PH + PL) / 2.0;
def tc = (PP - bc) + PP;

plot FR4 = PH + (3 * (PP - PL));
plot FR3 = PH + (2 * (PP - PL));
plot CP = PP;
plot FS3 = PL - (2 * (PH - PP));
plot FS4 = PL - (3 * (PH - PP));


FR4.SetHiding(hide_Floor_Pivots);
FR3.SetHiding(hide_Floor_Pivots);
CP.SetHiding(hide_Floor_Pivots);
FS3.SetHiding(hide_Floor_Pivots);
FS4.SetHiding(hide_Floor_Pivots);

FR4.SetDefaultColor(CreateColor(102, 0, 204));
FR3.SetDefaultColor(Color.MAGENTA);
CP.SetDefaultColor(Color.YELLOW);
FS3.SetDefaultColor(Color.MAGENTA);
FS4.SetDefaultColor(CreateColor(102, 0, 204));

FR4.SetPaintingStrategy(paintingStrategy);
FR3.SetPaintingStrategy(paintingStrategy);
CP.SetPaintingStrategy(paintingStrategy);
FS3.SetPaintingStrategy(paintingStrategy);
FS4.SetPaintingStrategy(paintingStrategy);

def StartPlot3 = if ShowBubbles == yes and hide_Floor_Pivots == no then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;

AddChartBubble(StartPlot3, CP[n1], "CP " + (if ShowPricesInBubbles then AsText(CP[n1]) else ""), Color.YELLOW,   if close[n1] > CP[n1] then no else yes);
AddChartBubble(StartPlot3, FR4[n1], "FR4 " + (if ShowPricesInBubbles then AsText(FR4[n1]) else ""), (CreateColor(102, 0, 204)), if close[n1] > FR4[n1] then no else yes);
AddChartBubble(StartPlot3, FR3[n1], "FR3 " + (if ShowPricesInBubbles then AsText(FR3[n1]) else ""), Color.MAGENTA,   if close[n1] > FR3[n1] then no else yes);
AddChartBubble(StartPlot3, FS4[n1], "FS4 " + (if ShowPricesInBubbles then AsText(FS4[n1]) else ""), (CreateColor(102, 0, 204)), if close[n1] > FS4[n1] then no else yes);
AddChartBubble(StartPlot3, FS3[n1], "FS3 " + (if ShowPricesInBubbles then AsText(FS3[n1]) else ""), Color.MAGENTA, if close[n1] > FS3[n1] then no else yes);

FR4.HideBubble();
FR3.HideBubble();
CP.HideBubble();
FS3.HideBubble();
FS4.HideBubble();
This is great..,but is it possible to place the chart bubbles for the Cam levels on the left of the chart?
 
@Wiinii Camarilla Pivot Points do not match Thor Young's formulas. The pivots are way way way off. I'm talking by many ticks. Can someone help create an indicator that will actually place the correct pivot points in TOS? I have mapped out the correct formulas but it won't let me post the Excel file so I will write them here. Should be fairly straightforward. I would be glad to Venmo or PayPal you some money for your time if you are successfully able to implement it.

R6 = (High / Low) * Close
R5 = R4 + 1.168 * (R4 - R3)
R4 = Close + (High - Low) * (1.1 / 2)
R3 = Close + (High - Low) * (1.1 / 4)
R2 = Close + (High - Low) * (1.1 / 6)
R1 = Close + (High - Low) * (1.1 / 12)
Center Pivot (CP) = Day's Opening Price
S1 = Close - (High - Low) * (1.1 / 2)
S2 = Close - (High - Low) * (1.1 / 4)
S3 = Close - (High - Low) * (1.1 / 6)
S4 = Close - (High - Low) * (1.1 / 12)
S5 = S4 - 1.168 * (S3 - S4)
S6 = Close - (R6 - Close)
There are many, many pivot indicators on this site. Many use this formula or minor variations on it. The issue with pivots being 'off' is due to the price returned when you retrieve yesterday's close via code. TOS provides you the settlement price vs what you see as the daily close. The only way around this to my knowledge is to manually input the close value to override that price. It can be done, you just have to remember to take that extra step each day to adjust the pivots.
I wrote a study that uses this 'manual close' override as an option. You can check it out here: Day Trading Pivot

Also, as I said, there are many other great pivot indicators on the site. Search for them via the helpful link below.
How to do your own searches:
https://usethinkscript.com/threads/search-the-forum.12626/
 
ToS and DAS don't use the exact same calculations because some stocks are open longer on ToS.


S5 and R5 are turned off by default, but you can turn them on in the options. PDC is a completely different study, see my links above to one I made.
 
Last edited by a moderator:
As someone stated above with ToS some stocks are open longer, which means more data, which could imply more accurate than DAS. It's a range anyhow. My calculations are accurate as you can see for yourself in the code.

Thanks for calling me out over and over tho.
 
@Wiinii Camarilla Pivot Points do not match Thor Young's formulas. The pivots are way way way off. I'm talking by many ticks. Can someone help create an indicator that will actually place the correct pivot points in TOS? I have mapped out the correct formulas but it won't let me post the Excel file so I will write them here. Should be fairly straightforward. I would be glad to Venmo or PayPal you some money for your time if you are successfully able to implement it.

R6 = (High / Low) * Close
R5 = R4 + 1.168 * (R4 - R3)
R4 = Close + (High - Low) * (1.1 / 2)
R3 = Close + (High - Low) * (1.1 / 4)
R2 = Close + (High - Low) * (1.1 / 6)
R1 = Close + (High - Low) * (1.1 / 12)
Center Pivot (CP) = Day's Opening Price
S1 = Close - (High - Low) * (1.1 / 2)
S2 = Close - (High - Low) * (1.1 / 4)
S3 = Close - (High - Low) * (1.1 / 6)
S4 = Close - (High - Low) * (1.1 / 12)
S5 = S4 - 1.168 * (S3 - S4)
S6 = Close - (R6 - Close)

These are STANDARD Camarilla pivot point calculations..as computed by DasTrader , which is used by all users of DAStrader.

You can see these exact formulae , published by DasTrader here,

https://dastrader.com/docs/how-to-view-the-pivot-point-indicator-on-the-chart/
 
Using it on multiple symbols limits how many setups I can take during the course of a week. It's definitely cumbersome and don't think I didn't try to do it myself in ThinkScript. I applaud you for creating what you did. I will maybe edit my post. I'm slightly autistic and my emotional hardware isn't wired like yours. I just state facts and need to consider repercussions better but I doubt that will change. Definitely sorry if I offended you and I will edit my posts better.
 
Using it on multiple symbols limits how many setups I can take during the course of a week. It's definitely cumbersome and don't think I didn't try to do it myself in ThinkScript. I applaud you for creating what you did. I will maybe edit my post. I'm slightly autistic and my emotional hardware isn't wired like yours. I just state facts and need to consider repercussions better but I doubt that will change. Definitely sorry if I offended you and I will edit my posts better.
All good, I appreciate the apology.

But again, you can look at my code to see the calculation for yourself. DAS is not the be-all-end-all only correct lines, because some ETFs and stocks continue trading but DAS stops and therefore doesn't use ALL of the data. So again, ToS is using ALL of the data from all of the time the stock is actually trading. If you don't believe me look at SPY how long it trades on ToS vs. DAS.

So back to the point here, my calculations are the correct ones, ToS just has more data so it could be considered MORE accurate.

And Thor himself has explained this difference in his mentorship, and also recommends people my ToS cams study.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
377 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top