2nd & 3rd Order pivots

ziongotoptions

Active member
Hello can someone code 2nd and third order pivots. 2nd order pivots are when you have pivot that inbetween two other pivots, the second order pivot high would be higher than the proceeding pivot on left and the future pivot on the right. And vice versa for the second order pivot low except it’s lower. Also third order pivot is a pivot that’s inbetween two second order pivots
 
Solution
Hello can someone code 2nd and third order pivots. 2nd order pivots are when you have pivot that inbetween two other pivots, the second order pivot high would be higher than the proceeding pivot on left and the future pivot on the right. And vice versa for the second order pivot low except it’s lower. Also third order pivot is a pivot that’s inbetween two second order pivots

Here is an indicator that Dilbert created and posted in the Thinkscript Lounge in 2017 that may be of interest.

Screenshot-2023-02-13-071135.png
Ruby:
#StudyName: Dilbert_1st2nd3rdOrderPivotFibs_V4
#Description: This script calculates first, second, and third order pivot points using the method described by Adam Grimes, and plots fib lines based on them.
#Author: Dilbert...
Hello can someone code 2nd and third order pivots. 2nd order pivots are when you have pivot that inbetween two other pivots, the second order pivot high would be higher than the proceeding pivot on left and the future pivot on the right. And vice versa for the second order pivot low except it’s lower. Also third order pivot is a pivot that’s inbetween two second order pivots

Here is an indicator that Dilbert created and posted in the Thinkscript Lounge in 2017 that may be of interest.

Screenshot-2023-02-13-071135.png
Ruby:
#StudyName: Dilbert_1st2nd3rdOrderPivotFibs_V4
#Description: This script calculates first, second, and third order pivot points using the method described by Adam Grimes, and plots fib lines based on them.
#Author: Dilbert
#Requested By: 
# Ver     Date     Auth      Change
# v4      012217   Dilbert   Fix 2nd order pivot logic, and 3rd order
# TOS.mx Link: http://tos.mx/nevlV6
# v3      010117   Dilbert   2nd order pivot logic appears to be right now.
# TOS.mx Link:
# v2      010117   Dilbert   Improvements to 2nd order logic, but still have a bug in it.  Not detecting a higher future 1st order pivot.  Changed dot offest logic to use ticksize.
# TOS.mx Link: http://tos.mx/EWHSQb
# v1      123016   Dilbert   code not complete yet.
# TOS.mx Link: http://tos.mx/NH8uTS
# Trading Notes:
#A cyan 1st order pivot on the high of a bar is when the bars before and after it both had lower highs

#A cyan 1st order pivot on the low of a bar is when the bars before and after it both had higher lows

#A yellow 2nd order pivot on the high of a bar is when the 1st order pivot highs anywhere before and anywhere after it both had lower highs

#A yellow 2nd order pivot on the low of a bar is when the 1st order pivot lows anywhere before and anywhere after it both had higher lows

#A magenta 3rd order pivot on the high of a bar is when the 2nd order pivot highs anywhere before and anywhere after it both had lower highs

#A magenta 3rd order pivot on the low of a bar is when the 2nd order pivot lows anywhere before and anywhere after it both had higher lows
input DotOffset = 2.0;
#Hint Debug: Turn debug plots and bubbles on and off;
input Debug = no;
#Hint _1stOHLLines: show lines connecting 1st order highs and lows
input _1stOHLLines = no;
#Hint _1stOZZLines: show zig zag like lines connecting 1st order highs and lows
input _1stOZZLines = no;
#Hint _2ndOHLLines: show lines connecting 2nd order highs and lows
input _2ndOHLLines = yes;
#Hint _2ndOZZLines: show zig zag like lines connecting 2nd order highs and lows
input _2ndOZZLines = yes;
input _3rdOHLLines = yes;
#Hint _3rdOZZLines: show zig zag like lines connecting 2nd order highs and lows
input _3rdOZZLines = yes;
def H = high;
def L = low;
def C = close;
def na = Double.NaN;
def BN = BarNumber();
#def HBN = HighestAll(BN);
#def BarstoEndChart =  if HBN - BN > 1 then HBN - BN else 1 ;
#def BarstoEndChart = HBN - BN;
def TS = TickSize();
#####################################################################################
# find first order pivot high
#####################################################################################
def _1stOrderPivotHigh = if H > H[1] and H > H[-1] then 1 else 0;
def _1stOrderPivotHighCount = if _1stOrderPivotHigh == 1
     then _1stOrderPivotHighCount[1] + 1 else _1stOrderPivotHighCount[1];
plot _1stOPH = if _1stOrderPivotHigh == 1 then H else na;
_1stOPH.SetPaintingStrategy(PaintingStrategy.POINTS);
_1stOPH.SetLineWeight(1);
_1stOPH.SetDefaultColor(Color.CYAN);
_1stOPH.HideBubble();
_1stOPH.HideTitle();
def _1stOPHH = if _1stOrderPivotHigh then H else _1stOPHH[1];
def _1stOPHBN = if _1stOrderPivotHigh then BN else _1stOPHBN[1]; 
#####################################################################################
# find first order pivot low
#####################################################################################
def _1stOrderPivotLow = L < L[1] and L < L[-1];
plot _1stOPL = if _1stOrderPivotLow == 1 then L else na;
_1stOPL.SetPaintingStrategy(PaintingStrategy.POINTS);
_1stOPL.SetLineWeight(1);
_1stOPL.SetDefaultColor(Color.CYAN);
_1stOPL.HideBubble();
_1stOPL.HideTitle();
def _1stOPLL = if _1stOrderPivotLow then L else _1stOPLL[1];
def _1stOPLBN = if _1stOrderPivotLow then BN else _1stOPLBN[1];

####################################################################################
# Beginning of 2nd order pivot logic 
####################################################################################
####################################################################################
# Beginning of higher 2nd order pivot logic 
####################################################################################
# find lower prior 1st order pivot high
######################################################################################
def LowerPrior1stOPH = if _1stOrderPivotHigh and _1stOPHH > _1stOPHH[1] then 1 else 0;
def LowerPrior1stOPHBN = if LowerPrior1stOPH then BN else 0;
####################################################################################
# find higher prior 1st order pivot
####################################################################################
def HigherPrior1stOPH = if _1stOrderPivotHigh and _1stOPHH < _1stOPHH[1]
                        then 1 else 0;
def HigherPrior1stOPHBN = if HigherPrior1stOPH then BN else 0;
###################################################################################
#  Find higher future 1st order pivot high
####################################################################################
def HigherFuture1stOP = fold i = 1 to 390
                          with p
                          while p == 0
                          do GetValue( LowerPrior1stOPHBN, -i, 0);
###################################################################################
#  Find lower future 1st order pivot high
####################################################################################
def LowerFuture1stOP = fold i2 = 1 to 390
                          with p2
                          while p2 == 0
                          do GetValue( HigherPrior1stOPHBN, -i2, 0);
####################################################################################
# IsNaN logic needed at right end of chart when there are not enough bars left to detect both a higher and lower future pivot.
####################################################################################
def HigherFuture1stOPNaN = if IsNaN(HigherFuture1stOP) then 1 else 0;
def LowerFuture1stOPNaN = if IsNaN(LowerFuture1stOP) then 1 else 0;
def NotIsNaNHigherFuture1stOP = if HigherFuture1stOPNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else HigherFuture1stOP;
def NotIsNaNLowerFuture1stOP = if LowerFuture1stOPNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else LowerFuture1stOP;
####################################################################################
# Plot 2nd order pivot high dots
####################################################################################
plot _2ndOPHDots = if  LowerPrior1stOPH == 1
               and NotIsNaNLowerFuture1stOP < NotIsNaNHigherFuture1stOP
               then H + TS * DotOffset
               else na;
_2ndOPHDots.SetPaintingStrategy(PaintingStrategy.POINTS);
_2ndOPHDots.SetLineWeight(3);
_2ndOPHDots.SetDefaultColor(Color.YELLOW);
_2ndOPHDots.HideBubble();
_2ndOPHDots.HideTitle();
####################################################################################
# Mark bar with boolean 0/1 is 2nd order pivot high   
####################################################################################
def _2ndOrderPivotHigh = if  LowerPrior1stOPH == 1
               and NotIsNaNLowerFuture1stOP < NotIsNaNHigherFuture1stOP
               then 1
               else 0;
def _2ndOPHH = if _2ndOrderPivotHigh then H else _2ndOPHH[1];
def _2ndOPHBN = if _2ndOrderPivotHigh then BN else _2ndOPHBN[1]; 
####################################################################################
# End of higher 2nd order pivot logic 
####################################################################################
####################################################################################
# Beginning of lower 2nd order pivot logic 
####################################################################################
# find lower prior 1st order pivot low
######################################################################################
def LowerPrior1stOPL = if _1stOrderPivotLow and _1stOPLL > _1stOPLL[1] then 1 else 0;
def LowerPrior1stOPLBN = if LowerPrior1stOPL then BN else 0;
####################################################################################
# find higher prior 1st order pivot low
####################################################################################
def HigherPrior1stOPL = if _1stOrderPivotLow and _1stOPLL < _1stOPLL[1]
                        then 1 else 0;
def HigherPrior1stOPLBN = if HigherPrior1stOPL then BN else 0;
###################################################################################
#  Find Higher future 1st order pivot low
####################################################################################
def HigherFuture1stOPL = fold i3 = 1 to 390
                          with p3
                          while p3 == 0
                          do GetValue( LowerPrior1stOPLBN, -i3, 0);
###################################################################################
#  Find lower future 1st order pivot low
####################################################################################
def LowerFuture1stOPL = fold i4 = 1 to 390
                          with p4
                          while p4 == 0
                          do GetValue( HigherPrior1stOPLBN, -i4, 0);
####################################################################################
# Plot 2nd order pivot low dots
####################################################################################
# IsNaN logic needed at right end of chart when there are not enough bars left to detect both a Higher and lower future pivot.
def HigherFuture1stOPLNaN = if IsNaN(HigherFuture1stOPL) then 1 else 0;
def LOWerFuture1stOPLNaN = if IsNaN(LowerFuture1stOPL) then 1 else 0;
def NotIsNaNHigherFuture1stOPL = if HigherFuture1stOPLNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else HigherFuture1stOPL;
def NotIsNaNLowerFuture1stOPL = if LOWerFuture1stOPLNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else LowerFuture1stOPL;
plot _2ndOPLDots = if HigherPrior1stOPL == 1
               and NotIsNaNLowerFuture1stOPL > NotIsNaNHigherFuture1stOPL
               then L - TS * DotOffset
               else na;
_2ndOPLDots.SetPaintingStrategy(PaintingStrategy.POINTS);
_2ndOPLDots.SetLineWeight(3);
_2ndOPLDots.SetDefaultColor(Color.YELLOW);
_2ndOPLDots.HideBubble();
_2ndOPLDots.HideTitle();
####################################################################################
# Mark bar with boolean 0/1 if 2nd order pivot low 
####################################################################################
def _2ndOrderPivotLow = if HigherPrior1stOPL == 1
               and NotIsNaNLowerFuture1stOPL > NotIsNaNHigherFuture1stOPL
               then L
               else 0;
def _2ndOPLL = if _2ndOrderPivotLow then L else _2ndOPLL[1];
def _2ndOPLBN = if _2ndOrderPivotLow then BN else _2ndOPLBN[1];
####################################################################################
# End of lower 2nd order pivot low logic 
####################################################################################
####################################################################################
# End of 2nd order pivot logic 
####################################################################################
####################################################################################
####################################################################################
# Beginning of 3rd order pivot logic 
####################################################################################
####################################################################################
# Beginning of higher 3rd order pivot logic 
####################################################################################
# find lower prior 2nd order pivot high
######################################################################################
def LowerPrior2ndOPH = if _2ndOrderPivotHigh and _2ndOPHH > _2ndOPHH[1] then 1 else 0;
def LowerPrior2ndOPHBN = if LowerPrior2ndOPH then BN else 0;
####################################################################################
# find higher prior 2nd order pivot
####################################################################################
def HigherPrior2ndOPH = if _2ndOrderPivotHigh and _2ndOPHH < _2ndOPHH[1]
                        then 1 else 0;
def HigherPrior2ndOPHBN = if HigherPrior2ndOPH then BN else 0;
###################################################################################
#  Find higher future 2nd order pivot high
####################################################################################
def HigherFuture2ndOP = fold i5 = 1 to 390
                          with p5
                          while p5 == 0
                          do GetValue( LowerPrior2ndOPHBN, -i5, 0);
###################################################################################
#  Find lower future 2nd order pivot high
####################################################################################
def LowerFuture2ndOP = fold i6 = 1 to 390
                          with p6
                          while p6 == 0
                          do GetValue( HigherPrior2ndOPHBN, -i6, 0);
####################################################################################
# IsNaN logic needed at right end of chart when there are not enough bars left to detect both a higher and lower future pivot.
####################################################################################
def HigherFuture2ndOPNaN = if IsNaN(HigherFuture2ndOP) then 1 else 0;
def LowerFuture2ndOPNaN = if IsNaN(LowerFuture2ndOP) then 1 else 0;
def NotIsNaNHigherFuture2ndOP = if HigherFuture2ndOPNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else HigherFuture2ndOP;
def NotIsNaNLowerFuture2ndOP = if LowerFuture2ndOPNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else LowerFuture2ndOP;
####################################################################################
# Plot 3rd order pivot high dots
####################################################################################
plot _3rdOPHDots = if  LowerPrior2ndOPH == 1
               and NotIsNaNLowerFuture2ndOP < NotIsNaNHigherFuture2ndOP
               then H + TS * DotOffset * 2
               else na;
_3rdOPHDots.SetPaintingStrategy(PaintingStrategy.POINTS);
_3rdOPHDots.SetLineWeight(3);
_3rdOPHDots.SetDefaultColor(Color.Magenta);
_3rdOPHDots.HideBubble();
_3rdOPHDots.HideTitle();
####################################################################################
# Mark bar with boolean 0/1 is 3rd order pivot high   
####################################################################################
def _3rdOrderPivotHigh = if  LowerPrior2ndOPH == 1
               and NotIsNaNLowerFuture2ndOP < NotIsNaNHigherFuture2ndOP
               then 1
               else 0;
####################################################################################
# End of higher 3rd order pivot logic 
####################################################################################
####################################################################################
# Beginning of lower 3rd order pivot logic 
####################################################################################
# find lower prior 2nd order pivot low
######################################################################################
def LowerPrior2ndOPL = if _2ndOrderPivotLow and _2ndOPLL > _2ndOPLL[1] then 1 else 0;
def LowerPrior2ndOPLBN = if LowerPrior2ndOPL then BN else 0;
####################################################################################
# find higher prior 2nd order pivot low
####################################################################################
def HigherPrior2ndOPL = if _2ndOrderPivotLow and _2ndOPLL < _2ndOPLL[1]
                        then 1 else 0;
def HigherPrior2ndOPLBN = if HigherPrior2ndOPL then BN else 0;
###################################################################################
#  Find Higher future 2nd order pivot low
####################################################################################
def HigherFuture2ndOPL = fold i7 = 1 to 390
                          with p7
                          while p7 == 0
                          do GetValue( LowerPrior2ndOPLBN, -i7, 0);
###################################################################################
#  Find lower future 2nd order pivot low
####################################################################################
def LowerFuture2ndOPL = fold i8 = 1 to 390
                          with p8
                          while p8 == 0
                          do GetValue( HigherPrior2ndOPLBN, -i8, 0);
####################################################################################
# Plot 3rd order pivot low dots
####################################################################################
# IsNaN logic needed at right end of chart when there are not enough bars left to detect both a Higher and lower future pivot.
def HigherFuture2ndOPLNaN = if IsNaN(HigherFuture2ndOPL) then 1 else 0;
def LOWerFuture2ndOPLNaN = if IsNaN(LowerFuture2ndOPL) then 1 else 0;
def NotIsNaNHigherFuture2ndOPL = if HigherFuture2ndOPLNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else HigherFuture2ndOPL;
def NotIsNaNLowerFuture2ndOPL = if LOWerFuture2ndOPLNaN == 1
                                   then Double.POSITIVE_INFINITY
                                   else LowerFuture2ndOPL;
plot _3rdOPLDots = if HigherPrior2ndOPL == 1
               and NotIsNaNLowerFuture2ndOPL > NotIsNaNHigherFuture2ndOPL
               then L - TS * DotOffset * 2
               else na;
_3rdOPLDots.SetPaintingStrategy(PaintingStrategy.POINTS);
_3rdOPLDots.SetLineWeight(5);
_3rdOPLDots.SetDefaultColor(Color.Magenta);
_3rdOPLDots.HideBubble();
_3rdOPLDots.HideTitle();
####################################################################################
# Mark bar with boolean 0/1 if 3rd order pivot low 
####################################################################################
def _3rdOrderPivotLow = if HigherPrior2ndOPL == 1
               and NotIsNaNLowerFuture2ndOPL > NotIsNaNHigherFuture2ndOPL
               then L
               else 0;
####################################################################################
# End of lower 3rd order pivot low logic 
####################################################################################
####################################################################################
# End of 3rd order pivot logic 
####################################################################################
####################################################################################
# Begin plotting lines.  3rd order plotted before 3rd, 3rd before 2nd, so that lower
# order plots do not plot on top of higher order
####################################################################################
####################################################################################
# Plot lines connecting 3rd order pivot highs 
####################################################################################
def _3rdOPHLine = if _3rdOHLLines and LowerPrior2ndOPH == 1
               and NotIsNaNLowerFuture2ndOP < NotIsNaNHigherFuture2ndOP
               then H
               else na;
def Last_3rdOPH = if !IsNaN(_3rdOPHLine) then _3rdOPHLine else Last_3rdOPH[1];
plot _3rdOPHLinePlot = if !IsNaN(_3rdOPHLine) then _3rdOPHLine
                  else if  Last_3rdOPH != 0 then Last_3rdOPH
                  else na;
_3rdOPHLinePlot.SetLineWeight(1);
_3rdOPHLinePlot.SetDefaultColor(Color.Magenta);
_3rdOPHLinePlot.HideBubble();
_3rdOPHLinePlot.HideTitle();
_3rdOPHLinePlot.EnableApproximation();
####################################################################################
# Draw lines connecting 3rd order pivot lows 
####################################################################################
def _3rdOPLLine = if _3rdOHLLines and HigherPrior2ndOPL == 1
               and NotIsNaNLowerFuture2ndOPL > NotIsNaNHigherFuture2ndOPL
               then L
               else na;
def Last_3rdOPL = if !IsNaN(_3rdOPLLine)
                  then _3rdOPLLine else Last_3rdOPL[1];
plot _3rdOPLLinePlot = if !IsNaN(_3rdOPLLine)
                       then _3rdOPLLine
                       else if  Last_3rdOPL != 0 then Last_3rdOPL
                       else na;
_3rdOPLLinePlot.SetLineWeight(1);
_3rdOPLLinePlot.SetDefaultColor(Color.Magenta);
_3rdOPLLinePlot.HideBubble();
_3rdOPLLinePlot.HideTitle();
_3rdOPLLinePlot.EnableApproximation();
#####################################################################################
# find both 3rd order pivot lows and highs and plot a line
#####################################################################################
def Any_3rdOPLine = if _3rdOrderPivotHigh
                    then H
                    else if _3rdOrderPivotLow
                    then L
                    else na;
plot Any_3rdOPLineP = if _3rdOZZLines == 1 then Any_3rdOPLine else na;
Any_3rdOPLineP.SetLineWeight(1);
Any_3rdOPLineP.SetDefaultColor(Color.Magenta);
Any_3rdOPLineP.HideBubble();
Any_3rdOPLineP.HideTitle();
Any_3rdOPLineP.EnableApproximation();
Any_3rdOPLineP.SetStyle(Curve.SHORT_DASH);
####################################################################################
# Plot lines connecting 2nd order pivot highs 
####################################################################################
def _2ndOPHLine = if _2ndOHLLines and LowerPrior1stOPH == 1
               and NotIsNaNLowerFuture1stOP < NotIsNaNHigherFuture1stOP
               then H
               else na;
def Last_2ndOPH = if !IsNaN(_2ndOPHLine) then _2ndOPHLine else Last_2ndOPH[1];
plot _2ndOPHLinePlot = if !IsNaN(_2ndOPHLine) then _2ndOPHLine
                  else if  Last_2ndOPH != 0 then Last_2ndOPH
                  else na;
_2ndOPHLinePlot.SetLineWeight(1);
_2ndOPHLinePlot.SetDefaultColor(Color.YELLOW);
_2ndOPHLinePlot.HideBubble();
_2ndOPHLinePlot.HideTitle();
_2ndOPHLinePlot.EnableApproximation();
####################################################################################
# Draw lines connecting 2nd order pivot lows 
####################################################################################
def _2ndOPLLine = if _2ndOHLLines and HigherPrior1stOPL == 1
               and NotIsNaNLowerFuture1stOPL > NotIsNaNHigherFuture1stOPL
               then L
               else na;
def Last_2ndOPL = if !IsNaN(_2ndOPLLine)
                  then _2ndOPLLine else Last_2ndOPL[1];
plot _2ndOPLLinePlot = if !IsNaN(_2ndOPLLine)
                       then _2ndOPLLine
                       else if  Last_2ndOPL != 0 then Last_2ndOPL
                       else na;
_2ndOPLLinePlot.SetLineWeight(1);
_2ndOPLLinePlot.SetDefaultColor(Color.YELLOW);
_2ndOPLLinePlot.HideBubble();
_2ndOPLLinePlot.HideTitle();
_2ndOPLLinePlot.EnableApproximation();
#####################################################################################
# find both 2nd order pivot lows and highs and plot a line
#####################################################################################
def Any_2ndOPLine = if _2ndOrderPivotHigh
                    then H
                    else if _2ndOrderPivotLow
                    then L
                    else na;
plot Any_2ndOPLineP = if _2ndOZZLines == 1 then Any_2ndOPLine else na;
Any_2ndOPLineP.SetLineWeight(1);
Any_2ndOPLineP.SetDefaultColor(Color.YELLOW);
Any_2ndOPLineP.HideBubble();
Any_2ndOPLineP.HideTitle();
Any_2ndOPLineP.EnableApproximation();
Any_2ndOPLineP.SetStyle(Curve.SHORT_DASH);
####################################################################################
# Plot lines connecting 1st order pivot highs 
####################################################################################
def _1stOPHLine = if _1stOHLLines and _1stOrderPivotHigh == 1
               then H
               else na;
def Last_1stOPH = if !IsNaN(_1stOPHLine) then _1stOPHLine else Last_1stOPH[1];
plot _1stOPHLinePlot = if !IsNaN(_1stOPHLine)
                       then _1stOPHLine
                       else if Last_1stOPH != 0
                       then Last_1stOPH
                       else na;
_1stOPHLinePlot.SetLineWeight(1);
_1stOPHLinePlot.SetDefaultColor(Color.CYAN);
_1stOPHLinePlot.HideBubble();
_1stOPHLinePlot.HideTitle();
_1stOPHLinePlot.EnableApproximation();
####################################################################################
# Plot lines connecting 1st order pivot lows 
####################################################################################
def _1stOPLLine = if  _1stOHLLines and _1stOrderPivotLow == 1
               then L
               else na;
def Last_1stOPL = if !IsNaN(_1stOPLLine) then _1stOPLLine else Last_1stOPL[1];
plot _1stOPLLinePlot = if !IsNaN(_1stOPLLine)
                       then _1stOPLLine
                       else if  Last_1stOPL != 0
                       then  Last_1stOPL
                       else na;
_1stOPLLinePlot.SetLineWeight(1);
_1stOPLLinePlot.SetDefaultColor(Color.CYAN);
_1stOPLLinePlot.HideBubble();
_1stOPLLinePlot.HideTitle();
_1stOPLLinePlot.EnableApproximation();
#####################################################################################
# find both 1st order pivot lows and highs and plot a line
#####################################################################################
def Any_1stOPLine = if _1stOrderPivotHigh
                    then H
                    else if _1stOrderPivotLow
                    then L
                    else na;
plot Any_1stOPLineP = if _1stOZZLines == 1 then Any_1stOPLine else na;
Any_1stOPLineP.SetLineWeight(1);
Any_1stOPLineP.SetDefaultColor(Color.CYAN);
Any_1stOPLineP.HideBubble();
Any_1stOPLineP.HideTitle();
Any_1stOPLineP.EnableApproximation();
Any_1stOPLineP.SetStyle(Curve.SHORT_DASH);
#
AddLabel(1,"1st", Color.Cyan);
AddLabel(1,"2nd", Color.Yellow);
AddLabel(1,"3rd", Color.Magenta);
####################################################################################
# Debug plots and bubbles to the end of study 
####################################################################################
plot ValuesAbove = if Debug then _2ndOPHLine else na;
ValuesAbove.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
plot ValuesBelow = if Debug then _2ndOPLLine else na;
ValuesBelow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

#AddChartBubble(Bubbles and _1stOrderPivotHigh, H + .05,HigherPrior1stOPHBN,Color.Cyan, yes);
AddChartBubble(Debug, H + .10, _1stOrderPivotHigh, Color.CYAN, yes);
#AddChartBubble(Bubbles, H + .15,HigherPrior1stOPHBN[1],Color.Cyan, yes);

AddChartBubble(Debug, L - .05, BN, Color.CYAN, no);
AddChartBubble(Debug, L - .10, Last_2ndOPL, Color.CYAN, no);
AddChartBubble(Debug and _1stOrderPivotHigh, L - .15, LowerFuture1stOP, Color.CYAN, no);
#AddChartBubble(Bubbles, L - .15,HigherPrior1stOPHBN[1],Color.Cyan, no);
AddVerticalLine(Debug and _1stOrderPivotHigh and _1stOPHH == _1stOPHH[1], "", Color.Magenta, Curve.SHORT_DASH);
 
Solution

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
487 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