Repaints Wolf Waves for ThinkorSwim

Repaints
The same chart but 1 hr time frame the projected price at 121.3 with a projected time of arrival to Tuesday 10/30 makes sense ER So how does the Wolfe wave estimate price, via price lines and fractals.

The Wolfe wave predicted an apple rise in price on my 4hr chart Friday morning absolutely and nailed an approximation of time to eta based on the bullish plot.

Ben's wolf wave script is identical in that they fire at the same time Ben's is noted by the R1 top. Must view on the 2min time frame very profitable and projects the channel very well on the daily chart. https://tos.mx/Wj3rEc

The wolf wave support level S1, S2, S3 = R1. R2, R3 register as numbered waves for me Bens is extremely accurate as it should be.
Hi, would you be so kind as to explain how S1, S2, etc. correspond to the Wolfe Wave numbers 1 through 5?
 
Hi, would you be so kind as to explain how S1, S2, etc. correspond to the Wolfe Wave numbers 1 through 5?
They are supposed to correspond exactly. It doesn't always work. This is a free version of Wolf Waves and doesn't have the accuracy of the proprietary indicators but close enough to engage in the complex research of wave theory. It should be noted that all wave studies repaint.
https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-57833
 
@PlayTrader Here is what you asked for. I took the liberty to add R1 line too along with S1.

Setup your scanner as custom script and your scan query will look like the below.

For finding the support AKA S1 of Wolf_Wave indicator posted in Original Comment here.
Code:
Wolf_Waves_Scan().Bull within 25 bars

Code:
Wolf_Waves_Scan().Bear within 25 bars

Code:
# Modified by @SuryaKiranC, An Attempt to create S1 & R1 for Scan #Requested by @PlayTrader
# Wolf_Waves_Scan
# Mobius
# V01.05.22.2018

input n = 10;

script LinePlot {
    input BarID = 0;
    input Value = 0;
    input BarOrigin = 0;
    def ThisBar = HighestAll(BarOrigin);
    def ValueLine = if BarOrigin == ThisBar then Value else Double.NaN;
    plot P = if ThisBar - BarID <= BarOrigin then HighestAll(ValueLine) else Double.NaN;
}

# Variables
def o = open;
def h = high;
def l = low;
def c = close;
def x = BarNumber();
def xN = x == HighestAll(x);

# R1
def hh = fold i = 1 to n + 1with p = 1 while p do h > GetValue(h, -i);
def PivotH = if (x > n and h == Highest(h, n) and hh) then h else Double.NaN;
def PHValue = if !IsNaN(PivotH) then PivotH else PHValue[1];
def PHBarOrigin = if !IsNaN(PivotH) then x else PHBarOrigin[1];
def PHBarID = x - PHBarOrigin;

# S1
def ll = fold j = 1 to n + 1 with q = 1 while q do l < GetValue(l, -j);
def PivotL = if (x > n and l == Lowest(l, n) and ll) then l else Double.NaN;
def PLValue = if !IsNaN(PivotL) then PivotL else PLValue[1];
def PLBarOrigin = if !IsNaN(PivotL) then x else PLBarOrigin[1];
def PLBarID = x - PLBarOrigin;

plot Bear = if (x == HighestAll(PHBarOrigin) and PHValue) then 1 else 0;
Bear.Hide();

plot Bull = if (x == HighestAll(PLBarOrigin) and PLValue) then 1 else 0;
Bull.Hide();

plot scan = (Bear or Bull);
Hello, how can I modify your scan to search for R3 S3 (but none others)? I would rather not wait until I see the R1 S1 situation, but to know in advance the R3 R1 criteria are met, so I can begin watching and planning a potential trade. Tx very much
 
Hello, how can I modify your scan to search for R3 S3 (but none others)? I would rather not wait until I see the R1 S1 situation, but to know in advance the R3 R1 criteria are met, so I can begin watching and planning a potential trade. Tx very much
Sorry, that is not available currently.
 
Is there a way to get a different timeframe overlayed for this script? I tried adding input aggregation = AggregationPeriod.WEEK; and it shows the input on the setting of the script now, but the chart is the same. I'm sure its dynamic to the chart it is currently on, but I wanted to get 2 timeframe studies on 1 chart. any help is much appreciated
 
Is there a way to get a different timeframe overlayed for this script? I tried adding input aggregation = AggregationPeriod.WEEK; and it shows the input on the setting of the script now, but the chart is the same. I'm sure its dynamic to the chart it is currently on, but I wanted to get 2 timeframe studies on 1 chart. any help is much appreciated
No there is no MTF Wolf Wave available on this forum.
 
Code:
# Wolf Waves
# Mobius
# V01.05.22.2018
#Modifiede by Cwparker23
#https://youtu.be/oYo3i7m5Js0
# User Inputs

input n = 13;
input OUTSIDE_FIBS_hide = no;
input SHOW_LabelS = NO;
DefineGlobalColor("OUTER_FIBS",Color.LIGHT_GRAY);
def today = GetLastDay() == GetDay();
input averageType = AverageType.SIMPLE;
def ATR = MovingAverage(averageType, TrueRange(high, close, low), n);
# Internal Script Reference

script LinePlot {

    input BarID = 0;

    input Value = 0;

    input BarOrigin = 0;

    def ThisBar = HighestAll(BarOrigin);

    def ValueLine = if BarOrigin == ThisBar

                then Value

                else Double.NaN;

    plot P = if ThisBar - BarID <= BarOrigin

             then HighestAll(ValueLine)

             else Double.NaN;

}

# Variables

def o = open;

def h = high;

def l = low;

def c = close;

def x = BarNumber();

def xN = x == HighestAll(x);

# R1

def hh = fold i = 1 to n + 1

         with p = 1

         while p

         do h > GetValue(h, -i);

def PivotH = if (x > n and

                 h == Highest(h, n) and

                 hh)

             then h

             else Double.NaN;

def PHValue = if !IsNaN(PivotH)

              then PivotH

              else PHValue[1];

def PHBarOrigin = if !IsNaN(PivotH)

                  then x

                  else PHBarOrigin[1];

def PHBarID = x - PHBarOrigin;

# R2

def R2PHValue = if PHBarOrigin != PHBarOrigin[1]

                then PHValue[1]

                else R2PHValue[1];

def R2PHBarOrigin = if PHBarOrigin != PHBarOrigin[1]

                    then PHBarOrigin[1]

                    else R2PHBarOrigin[1];

def R2PHBarID = x - R2PHBarOrigin;

# R3

def R3PHValue = if R2PHBarOrigin != R2PHBarOrigin[1]

                then R2PHValue[1]

                else R3PHValue[1];

def R3PHBarOrigin = if R2PHBarOrigin != R2PHBarOrigin[1]

                    then R2PHBarOrigin[1]

                    else R3PHBarOrigin[1];

def R3PHBarID = x - R3PHBarOrigin;

# S1

def ll = fold j = 1 to n + 1

         with q = 1

         while q

         do l < GetValue(l, -j);

def PivotL = if (x > n and

                 l == Lowest(l, n) and

                 ll)

             then l

             else Double.NaN;

def PLValue = if !IsNaN(PivotL)

              then PivotL

              else PLValue[1];

def PLBarOrigin = if !IsNaN(PivotL)

                  then x

                  else PLBarOrigin[1];

def PLBarID = x - PLBarOrigin;

# S2

def S2PLValue = if PLBarOrigin != PLBarOrigin[1]

                then PLValue[1]

                else S2PLValue[1];

def S2PLBarOrigin = if PLBarOrigin != PLBarOrigin[1]

                    then PLBarOrigin[1]

                    else S2PLBarOrigin[1];

def S2PLBarID = x - S2PLBarOrigin;

# S3

def S3PLValue = if S2PLBarOrigin != S2PLBarOrigin[1]

                then S2PLValue[1]

                else S3PLValue[1];

def S3PLBarOrigin = if S2PLBarOrigin != S2PLBarOrigin[1]

                    then S2PLBarOrigin[1]

                    else S3PLBarOrigin[1];

def S3PLBarID = x - S3PLBarOrigin;

# S4

def S4PLValue = if S3PLBarOrigin != S3PLBarOrigin[1]

                then S3PLValue[1]

                else S4PLValue[1];

def S4PLBarOrigin = if S3PLBarOrigin != S3PLBarOrigin[1]

                    then S3PLBarOrigin[1]

                    else S4PLBarOrigin[1];

def S4PLBarID = x - S4PLBarOrigin;

# S5

def S5PLValue = if S4PLBarOrigin != S4PLBarOrigin[1]

                then S4PLValue[1]

                else S5PLValue[1];

def S5PLBarOrigin = if S4PLBarOrigin != S4PLBarOrigin[1]

                    then S4PLBarOrigin[1]

                    else S5PLBarOrigin[1];

def S5PLBarID = x - S5PLBarOrigin;

# Plots

plot R1 = LinePlot(BarID = PHBarID,

                   Value = PHValue,

                   BarOrigin = PHBarOrigin);

R1.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(PHBarOrigin), PHValue, "R1", Color.RED, 1);
R1.SetLineWeight(3);
plot R2 = LinePlot(BarID = R2PHBarID,

                   Value = R2PHValue,

                   BarOrigin = R2PHBarOrigin);

R2.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(R2PHBarOrigin), PHValue, "R2", Color.RED, 1);

plot R3 = LinePlot(BarID = R3PHBarID,

                   Value = R3PHValue,

                   BarOrigin = R3PHBarOrigin);

R3.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(R3PHBarOrigin), PHValue, "R3", Color.RED, 1);

plot S1 = LinePlot(BarID = PLBarID,

                   Value = PLValue,

                   BarOrigin = PLBarOrigin);

S1.SetDefaultColor(Color.WHITE);
S1.SetLineWeight(3);
AddChartBubble(x == HighestAll(PLBarOrigin), PLValue, "S1", Color.WHITE, 0);

plot S2 = LinePlot(BarID = S2PLBarID,

                   Value = S2PLValue,

                   BarOrigin = S2PLBarOrigin);

S2.SetDefaultColor(Color.WHITE);

AddChartBubble(x == HighestAll(S2PLBarOrigin), PLValue, "S2", Color.WHITE, 0);

plot S3 = LinePlot(BarID = S3PLBarID,

                   Value = S3PLValue,

                   BarOrigin = S3PLBarOrigin);

S3.SetDefaultColor(Color.WHITE);

AddChartBubble(x == HighestAll(S3PLBarOrigin), PLValue, "S3", Color.WHITE, 0);

# Trend Line

plot SupportLine2 = if x == HighestAll(S2PLBarOrigin)

                    then S2

                    else if x == HighestAll(PLBarOrigin)

                         then S1  #Parentlow

                         else Double.NaN;

SupportLine2.EnableApproximation();

SupportLine2.SetDefaultColor(Color.GRAY);

SupportLine2.SetLineWeight(1);

SupportLine2.SetStyle(Curve.LONG_DASH);

def slope2 = (S2 - S1) /

             (HighestAll(S2PLBarOrigin) - PLBarOrigin);

plot ExtLine2 = if x >= S2PLBarOrigin

                then (x - HighestAll(S2PLBarOrigin)) * slope2 + S2

                else Double.NaN;

ExtLine2.EnableApproximation();

ExtLine2.SetDefaultColor(Color.GRAY);

ExtLine2.SetLineWeight(1);

ExtLine2.SetStyle(Curve.LONG_DASH);

plot SupportLine3 = if x == HighestAll(R3PHBarOrigin)

                    then R3

                    else if x == PHBarOrigin

                         then R1

                         else Double.NaN;

SupportLine3.EnableApproximation();

SupportLine3.SetDefaultColor(Color.GRAY);

SupportLine3.SetLineWeight(1);

SupportLine3.SetStyle(Curve.LONG_DASH);

def slope3 = (R1 - R3) /

             (HighestAll(PHBarOrigin) - R3PHBarOrigin);

plot ExtLine3 = if x >= R3PHBarOrigin

                then (x - HighestAll(R3PHBarOrigin)) * slope3 + R3

                else Double.NaN;

ExtLine3.EnableApproximation();

ExtLine3.SetDefaultColor(Color.GRAY);

ExtLine3.SetLineWeight(1);

ExtLine3.SetStyle(Curve.LONG_DASH);

input HideCloud = YES;
DefineGlobalColor("ORB", Color.DARK_GRAY);
AddCloud( if !HideCloud then R1   else Double.NaN, S1 , GlobalColor("ORB"), GlobalColor("ORB"));

DEF LOWER_LOW = IF S1 < S2 THEN S1 ELSE IF S1 > S2 THEN S2 ELse LOWER_LOW[1];
DEF HIGHER_HIGH = IF R1 < R2 THEN R2 ELSE IF R1 > R2 THEN R1 ELSE HIGHER_HIGH[1];
PLOT HIGHER_HIGH1 = HIGHER_HIGH;
PLOT LOWER_LOW1 = LOWER_LOW;

def range =  HIGHER_HIGH - LOWER_LOW ;
PLOT FIFTY = HIGHER_HIGH - (range*.50);

plot f10 = HIGHER_HIGH - (RANGE * 0.10);
plot F90 =  HIGHER_HIGH -(RANGE *.90);
plot F236 =  HIGHER_HIGH -(RANGE *.764);
plot F786 =  HIGHER_HIGH -(RANGE *.214);
F786.setlineWeight(3);
F236.setlineWeight(3);

plot F618 =  HIGHER_HIGH -(RANGE *.382);
F618.setlineWeight(1);
F618.SetDefaultColor(Color.MAGENTA);

plot F382 =  HIGHER_HIGH -(RANGE *.618);
F382.setlineWeight(1);
F382.SetDefaultColor(Color.MAGENTA);

f10.SetPaintingStrategy(PaintingStrategy.LINE);
f10.SetDefaultColor(Color.CYAN);
f10.setlineWeight(3);

FIFTY.SetPaintingStrategy(PaintingStrategy.LINE);
FIFTY.SetDefaultColor(Color.ORANGE);
FIFTY.setlineWeight(3);

F90.SetPaintingStrategy(PaintingStrategy.LINE);
F90.SetDefaultColor(Color.CYAN);
F90.setlineWeight(3);

F236.SetPaintingStrategy(PaintingStrategy.LINE);
F236.SetDefaultColor(Color.lIME);
F236.setlineWeight(3);

F786.SetPaintingStrategy(PaintingStrategy.LINE);
F786.SetDefaultColor(Color.lIME);
F786.setlineWeight(3);
####################################################
PLOT FIFTYU = HIGHER_HIGH + (RANGE * 0.50);
plot f10U = HIGHER_HIGH + (RANGE * 0.10);
plot F90U =  HIGHER_HIGH +(RANGE *.90);
plot F236U =  HIGHER_HIGH +(RANGE *.764);
plot F786U =  HIGHER_HIGH +(RANGE *.214);
F786U.setlineWeight(3);
F236U.setlineWeight(3);

plot F618U =  HIGHER_HIGH +(RANGE *.382);
F618U.setlineWeight(1);
F618U.SetDefaultColor(Color.MAGENTA);

plot F382U =  HIGHER_HIGH +(RANGE *.618);
F382U.setlineWeight(1);
F382U.SetDefaultColor(Color.MAGENTA);



f10U.SetPaintingStrategy(PaintingStrategy.LINE);
f10U.SetDefaultColor(Color.CYAN);
f10U.setlineWeight(3);

FIFTYU.SetPaintingStrategy(PaintingStrategy.LINE);
FIFTYU.SetDefaultColor(Color.ORANGE);
FIFTYU.setlineWeight(3);

F90U.SetPaintingStrategy(PaintingStrategy.LINE);
F90U.SetDefaultColor(Color.CYAN);
F90U.setlineWeight(3);

F236U.SetPaintingStrategy(PaintingStrategy.LINE);
F236U.SetDefaultColor(Color.lIME);
F236U.setlineWeight(3);

F786U.SetPaintingStrategy(PaintingStrategy.LINE);
F786U.SetDefaultColor(Color.lIME);
F786U.setlineWeight(3);

####################################################
PLOT FIFTYL = LOWER_LOW - (RANGE * 0.50);
plot f10L = LOWER_LOW - (RANGE * 0.10);
plot F90L =  LOWER_LOW - (RANGE *.90);
plot F236L =  LOWER_LOW - (RANGE *.764);
plot F786L =  LOWER_LOW -(RANGE *.214);
F786L.setlineWeight(3);
F236L.setlineWeight(3);

plot F618L =  LOWER_LOW -(RANGE *.382);
F618L.setlineWeight(1);
F618L.SetDefaultColor(Color.MAGENTA);

plot F382L =  LOWER_LOW -(RANGE *.618);
F382L.setlineWeight(1);
F382L.SetDefaultColor(Color.MAGENTA);

f10L.SetPaintingStrategy(PaintingStrategy.LINE);
f10L.SetDefaultColor(Color.CYAN);
f10L.setlineWeight(3);

FIFTYL.SetPaintingStrategy(PaintingStrategy.LINE);
FIFTYL.SetDefaultColor(Color.ORANGE);
FIFTYL.setlineWeight(3);

F90L.SetPaintingStrategy(PaintingStrategy.LINE);
F90L.SetDefaultColor(Color.CYAN);
F90L.setlineWeight(3);

F236L.SetPaintingStrategy(PaintingStrategy.LINE);
F236L.SetDefaultColor(Color.lIME);
F236L.setlineWeight(3);

F786L.SetPaintingStrategy(PaintingStrategy.LINE);
F786L.SetDefaultColor(Color.lIME);
F786L.setlineWeight(3);

####################################################
DEF F5U = range * .05;

def t3u = FIFTY + F5U;
def t3d = FIFTY - F5U;
input HideCloud2 = no;
DefineGlobalColor("NINTY", Color.DARK_RED);
AddCloud( if !HideCloud2 then FIFTY    else Double.NaN, t3d , GlobalColor("NINTY"), GlobalColor("NINTY"));

DefineGlobalColor("TEN", Color.DARK_GREEN);
AddCloud( if !HideCloud2 then FIFTY   else Double.NaN, t3u  , GlobalColor("TEN"), GlobalColor("TEN"));


####################################################

def PIVOT_RANGE = HIGHER_HIGH - LOWER_LOW;

def DTRpct = Round((PIVOT_RANGE / ATR) * 100, 0);

AddLabel (yes, "PIVOT_TR " + Round (PIVOT_RANGE , 2) + " vs ATR " + Round (ATR, 2) + "  " + Round (DTRpct, 0) + "%", (if DTRpct <= 70 then Color.GREEN else if DTRpct >= 90 then Color.RED else Color.ORANGE));
def ADR = Average(high (period = "DAY")[1], n) - Average(low (period = "DAY")[1], n);
 
I find the wolf wave very interesting so for the wave counts and you have it here. I use wolf waves every day with amazing results same as pivots really

S3. Finishes out wave 5 to bottom

R3 top of wave 1

S2 bottom of wave 2

2 up to 3 top of wave 3

Down to wave 4

Wave 4 begins the sweet spot up to finish wave 5

Then wait for another wave to develop using the 5- 15 min you even throw a 2min chart up for fast markets

So my suggestion is to label the waves as 1-5

I just so not see many differences waves are waves really and waves subset in between larger waves although what I use gives me fib extensions/fractals that project up and down price points. Maybe a future project. Not sure how you can do the price extension other than on the connecting wave points but If you like I can offer more information pertaining to bullish/bearish numbered patterns 1-5 and direction synopsis? all points connect so we are talking about extensions based on fib probabilities...fractals. I am not a coder sorry

KHGg3fh.png
@J007RMC Can you provide an example on what to adjust for the 1-5 wave chnage thanks.
 
I find the wolf wave very interesting so for the wave counts and you have it here. I use wolf waves every day with amazing results same as pivots really

S3. Finishes out wave 5 to bottom

R3 top of wave 1

S2 bottom of wave 2

2 up to 3 top of wave 3

Down to wave 4

Wave 4 begins the sweet spot up to finish wave 5

Then wait for another wave to develop using the 5- 15 min you even throw a 2min chart up for fast markets

So my suggestion is to label the waves as 1-5

I just so not see many differences waves are waves really and waves subset in between larger waves although what I use gives me fib extensions/fractals that project up and down price points. Maybe a future project. Not sure how you can do the price extension other than on the connecting wave points but If you like I can offer more information pertaining to bullish/bearish numbered patterns 1-5 and direction synopsis? all points connect so we are talking about extensions based on fib probabilities...fractals. I am not a coder sorry

KHGg3fh.png
Hi @J007RMC, can you please share the codes for the upper study with the wave #?
 
Hi @J007RMC, can you please share the codes for the upper study with the wave #?
Did you know that clicking on a member's avatar will allow you to see when a member was last seen on the uTS forum? @J007RMC has not been seen in a while. :(

I believe that poster stated multiple times throughout this thread that he uses the proprietary Wolf Waves Indicator.
 
As requested, here is the Wolf Waves indicator for ThinkorSwim. It automatically plots support and resistance on your chart, as well as trend lines that you can use to catch potential breakouts or breakdown.

This indicator was created by Mobius. As mentioned by the author, this is similar to other Pivot Studies that mark different types of breakouts.

eobYmxR.png


thinkScript Code

Rich (BB code):
# Wolf Waves
# Mobius
# V01.05.22.2018

# User Inputs

input n = 10;

# Internal Script Reference

script LinePlot {

    input BarID = 0;

    input Value = 0;

    input BarOrigin = 0;

    def ThisBar = HighestAll(BarOrigin);

    def ValueLine = if BarOrigin == ThisBar

                then Value

                else Double.NaN;

    plot P = if ThisBar - BarID <= BarOrigin

             then HighestAll(ValueLine)

             else Double.NaN;

}

# Variables

def o = open;

def h = high;

def l = low;

def c = close;

def x = BarNumber();

def xN = x == HighestAll(x);

# R1

def hh = fold i = 1 to n + 1

         with p = 1

         while p

         do h > GetValue(h, -i);

def PivotH = if (x > n and

                 h == Highest(h, n) and

                 hh)

             then h

             else Double.NaN;

def PHValue = if !IsNaN(PivotH)

              then PivotH

              else PHValue[1];

def PHBarOrigin = if !IsNaN(PivotH)

                  then x

                  else PHBarOrigin[1];

def PHBarID = x - PHBarOrigin;

# R2

def R2PHValue = if PHBarOrigin != PHBarOrigin[1]

                then PHValue[1]

                else R2PHValue[1];

def R2PHBarOrigin = if PHBarOrigin != PHBarOrigin[1]

                    then PHBarOrigin[1]

                    else R2PHBarOrigin[1];

def R2PHBarID = x - R2PHBarOrigin;

# R3

def R3PHValue = if R2PHBarOrigin != R2PHBarOrigin[1]

                then R2PHValue[1]

                else R3PHValue[1];

def R3PHBarOrigin = if R2PHBarOrigin != R2PHBarOrigin[1]

                    then R2PHBarOrigin[1]

                    else R3PHBarOrigin[1];

def R3PHBarID = x - R3PHBarOrigin;

# S1

def ll = fold j = 1 to n + 1

         with q = 1

         while q

         do l < GetValue(l, -j);

def PivotL = if (x > n and

                 l == Lowest(l, n) and

                 ll)

             then l

             else Double.NaN;

def PLValue = if !IsNaN(PivotL)

              then PivotL

              else PLValue[1];

def PLBarOrigin = if !IsNaN(PivotL)

                  then x

                  else PLBarOrigin[1];

def PLBarID = x - PLBarOrigin;

# S2

def S2PLValue = if PLBarOrigin != PLBarOrigin[1]

                then PLValue[1]

                else S2PLValue[1];

def S2PLBarOrigin = if PLBarOrigin != PLBarOrigin[1]

                    then PLBarOrigin[1]

                    else S2PLBarOrigin[1];

def S2PLBarID = x - S2PLBarOrigin;

# S3

def S3PLValue = if S2PLBarOrigin != S2PLBarOrigin[1]

                then S2PLValue[1]

                else S3PLValue[1];

def S3PLBarOrigin = if S2PLBarOrigin != S2PLBarOrigin[1]

                    then S2PLBarOrigin[1]

                    else S3PLBarOrigin[1];

def S3PLBarID = x - S3PLBarOrigin;

# S4

def S4PLValue = if S3PLBarOrigin != S3PLBarOrigin[1]

                then S3PLValue[1]

                else S4PLValue[1];

def S4PLBarOrigin = if S3PLBarOrigin != S3PLBarOrigin[1]

                    then S3PLBarOrigin[1]

                    else S4PLBarOrigin[1];

def S4PLBarID = x - S4PLBarOrigin;

# S5

def S5PLValue = if S4PLBarOrigin != S4PLBarOrigin[1]

                then S4PLValue[1]

                else S5PLValue[1];

def S5PLBarOrigin = if S4PLBarOrigin != S4PLBarOrigin[1]

                    then S4PLBarOrigin[1]

                    else S5PLBarOrigin[1];

def S5PLBarID = x - S5PLBarOrigin;

# Plots

plot R1 = LinePlot(BarID = PHBarID,

                   Value = PHValue,

                   BarOrigin = PHBarOrigin);

R1.SetDefaultColor(Color.GREEN);

AddChartBubble(x == HighestAll(PHBarOrigin), PHValue, "R1", Color.GREEN, 1);

plot R2 = LinePlot(BarID = R2PHBarID,

                   Value = R2PHValue,

                   BarOrigin = R2PHBarOrigin);

R2.SetDefaultColor(Color.GREEN);

AddChartBubble(x == HighestAll(R2PHBarOrigin), PHValue, "R2", Color.GREEN, 1);

plot R3 = LinePlot(BarID = R3PHBarID,

                   Value = R3PHValue,

                   BarOrigin = R3PHBarOrigin);

R3.SetDefaultColor(Color.GREEN);

AddChartBubble(x == HighestAll(R3PHBarOrigin), PHValue, "R3", Color.GREEN, 1);

plot S1 = LinePlot(BarID = PLBarID,

                   Value = PLValue,

                   BarOrigin = PLBarOrigin);

S1.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(PLBarOrigin), PLValue, "S1", Color.RED, 0);

plot S2 = LinePlot(BarID = S2PLBarID,

                   Value = S2PLValue,

                   BarOrigin = S2PLBarOrigin);

S2.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(S2PLBarOrigin), PLValue, "S2", Color.RED, 0);

plot S3 = LinePlot(BarID = S3PLBarID,

                   Value = S3PLValue,

                   BarOrigin = S3PLBarOrigin);

S3.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(S3PLBarOrigin), PLValue, "S3", Color.RED, 0);

# Trend Line

plot SupportLine2 = if x == HighestAll(S2PLBarOrigin)

                    then S2

                    else if x == HighestAll(PLBarOrigin)

                         then S1  #Parentlow

                         else Double.NaN;

SupportLine2.EnableApproximation();

SupportLine2.SetDefaultColor(Color.GRAY);

SupportLine2.SetLineWeight(1);

SupportLine2.SetStyle(Curve.LONG_DASH);

def slope2 = (S2 - S1) /

             (HighestAll(S2PLBarOrigin) - PLBarOrigin);

plot ExtLine2 = if x >= S2PLBarOrigin

                then (x - HighestAll(S2PLBarOrigin)) * slope2 + S2

                else Double.NaN;

ExtLine2.EnableApproximation();

ExtLine2.SetDefaultColor(Color.GRAY);

ExtLine2.SetLineWeight(1);

ExtLine2.SetStyle(Curve.LONG_DASH);

plot SupportLine3 = if x == HighestAll(R3PHBarOrigin)

                    then R3

                    else if x == PHBarOrigin

                         then R1

                         else Double.NaN;

SupportLine3.EnableApproximation();

SupportLine3.SetDefaultColor(Color.GRAY);

SupportLine3.SetLineWeight(1);

SupportLine3.SetStyle(Curve.LONG_DASH);

def slope3 = (R1 - R3) /

             (HighestAll(PHBarOrigin) - R3PHBarOrigin);

plot ExtLine3 = if x >= R3PHBarOrigin

                then (x - HighestAll(R3PHBarOrigin)) * slope3 + R3

                else Double.NaN;

ExtLine3.EnableApproximation();

ExtLine3.SetDefaultColor(Color.GRAY);

ExtLine3.SetLineWeight(1);

ExtLine3.SetStyle(Curve.LONG_DASH);

Shareable Link

https://tos.mx/Wj3rEc
is there scan for R's and S's in wolf waves?
 
I need watchlist show me the sign ( S1 ) within 2 bars ..
The code does not seem to work "within 2 bars"
I could not get the code to work unless I used "within 25 bars" which I assume negates its usefulness.
Ruby:
# Modified by @SuryaKiranC, An Attempt to create S1 for Scan #Requested by @PlayTrader
# Modified by @MerryDay, An Attempt to create S1 for watchlist #Requested by iSultan
# Wolf_Waves
# Mobius
# V01.05.22.2018

input n = 13;

script LinePlot {
    input BarID = 0;
    input Value = 0;
    input BarOrigin = 0;
    def ThisBar = HighestAll(BarOrigin);
    def ValueLine = if BarOrigin == ThisBar then Value else Double.NaN;
    plot P = if ThisBar - BarID <= BarOrigin then HighestAll(ValueLine) else Double.NaN;
}

# Variables
def o = open;
def h = high;
def l = low;
def c = close;
def x = BarNumber();
def xN = x == HighestAll(x);

# S1
def ll = fold j = 1 to n + 1 with q = 1 while q do l < GetValue(l, -j);
def PivotL = if (x > n and l == Lowest(l, n) and ll) then l else Double.NaN;
def PLValue = if !IsNaN(PivotL) then PivotL else PLValue[1];
def PLBarOrigin = if !IsNaN(PivotL) then x else PLBarOrigin[1];
def PLBarID = x - PLBarOrigin;

def S1 = if (x == HighestAll(PLBarOrigin) and PLValue) then 1 else 0;
plot bull = S1 within 25 bars ;
Bull.Hide();

AssignBackgroundColor(
if Bull then color.green else color.gray);
 
Code:
# Wolf Waves
# Mobius
# V01.05.22.2018
#Modifiede by Cwparker23
#https://youtu.be/oYo3i7m5Js0
# User Inputs

input n = 13;
input OUTSIDE_FIBS_hide = no;
input SHOW_LabelS = NO;
DefineGlobalColor("OUTER_FIBS",Color.LIGHT_GRAY);
def today = GetLastDay() == GetDay();
input averageType = AverageType.SIMPLE;
def ATR = MovingAverage(averageType, TrueRange(high, close, low), n);
# Internal Script Reference

script LinePlot {

    input BarID = 0;

    input Value = 0;

    input BarOrigin = 0;

    def ThisBar = HighestAll(BarOrigin);

    def ValueLine = if BarOrigin == ThisBar

                then Value

                else Double.NaN;

    plot P = if ThisBar - BarID <= BarOrigin

             then HighestAll(ValueLine)

             else Double.NaN;

}

# Variables

def o = open;

def h = high;

def l = low;

def c = close;

def x = BarNumber();

def xN = x == HighestAll(x);

# R1

def hh = fold i = 1 to n + 1

         with p = 1

         while p

         do h > GetValue(h, -i);

def PivotH = if (x > n and

                 h == Highest(h, n) and

                 hh)

             then h

             else Double.NaN;

def PHValue = if !IsNaN(PivotH)

              then PivotH

              else PHValue[1];

def PHBarOrigin = if !IsNaN(PivotH)

                  then x

                  else PHBarOrigin[1];

def PHBarID = x - PHBarOrigin;

# R2

def R2PHValue = if PHBarOrigin != PHBarOrigin[1]

                then PHValue[1]

                else R2PHValue[1];

def R2PHBarOrigin = if PHBarOrigin != PHBarOrigin[1]

                    then PHBarOrigin[1]

                    else R2PHBarOrigin[1];

def R2PHBarID = x - R2PHBarOrigin;

# R3

def R3PHValue = if R2PHBarOrigin != R2PHBarOrigin[1]

                then R2PHValue[1]

                else R3PHValue[1];

def R3PHBarOrigin = if R2PHBarOrigin != R2PHBarOrigin[1]

                    then R2PHBarOrigin[1]

                    else R3PHBarOrigin[1];

def R3PHBarID = x - R3PHBarOrigin;

# S1

def ll = fold j = 1 to n + 1

         with q = 1

         while q

         do l < GetValue(l, -j);

def PivotL = if (x > n and

                 l == Lowest(l, n) and

                 ll)

             then l

             else Double.NaN;

def PLValue = if !IsNaN(PivotL)

              then PivotL

              else PLValue[1];

def PLBarOrigin = if !IsNaN(PivotL)

                  then x

                  else PLBarOrigin[1];

def PLBarID = x - PLBarOrigin;

# S2

def S2PLValue = if PLBarOrigin != PLBarOrigin[1]

                then PLValue[1]

                else S2PLValue[1];

def S2PLBarOrigin = if PLBarOrigin != PLBarOrigin[1]

                    then PLBarOrigin[1]

                    else S2PLBarOrigin[1];

def S2PLBarID = x - S2PLBarOrigin;

# S3

def S3PLValue = if S2PLBarOrigin != S2PLBarOrigin[1]

                then S2PLValue[1]

                else S3PLValue[1];

def S3PLBarOrigin = if S2PLBarOrigin != S2PLBarOrigin[1]

                    then S2PLBarOrigin[1]

                    else S3PLBarOrigin[1];

def S3PLBarID = x - S3PLBarOrigin;

# S4

def S4PLValue = if S3PLBarOrigin != S3PLBarOrigin[1]

                then S3PLValue[1]

                else S4PLValue[1];

def S4PLBarOrigin = if S3PLBarOrigin != S3PLBarOrigin[1]

                    then S3PLBarOrigin[1]

                    else S4PLBarOrigin[1];

def S4PLBarID = x - S4PLBarOrigin;

# S5

def S5PLValue = if S4PLBarOrigin != S4PLBarOrigin[1]

                then S4PLValue[1]

                else S5PLValue[1];

def S5PLBarOrigin = if S4PLBarOrigin != S4PLBarOrigin[1]

                    then S4PLBarOrigin[1]

                    else S5PLBarOrigin[1];

def S5PLBarID = x - S5PLBarOrigin;

# Plots

plot R1 = LinePlot(BarID = PHBarID,

                   Value = PHValue,

                   BarOrigin = PHBarOrigin);

R1.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(PHBarOrigin), PHValue, "R1", Color.RED, 1);
R1.SetLineWeight(3);
plot R2 = LinePlot(BarID = R2PHBarID,

                   Value = R2PHValue,

                   BarOrigin = R2PHBarOrigin);

R2.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(R2PHBarOrigin), PHValue, "R2", Color.RED, 1);

plot R3 = LinePlot(BarID = R3PHBarID,

                   Value = R3PHValue,

                   BarOrigin = R3PHBarOrigin);

R3.SetDefaultColor(Color.RED);

AddChartBubble(x == HighestAll(R3PHBarOrigin), PHValue, "R3", Color.RED, 1);

plot S1 = LinePlot(BarID = PLBarID,

                   Value = PLValue,

                   BarOrigin = PLBarOrigin);

S1.SetDefaultColor(Color.WHITE);
S1.SetLineWeight(3);
AddChartBubble(x == HighestAll(PLBarOrigin), PLValue, "S1", Color.WHITE, 0);

plot S2 = LinePlot(BarID = S2PLBarID,

                   Value = S2PLValue,

                   BarOrigin = S2PLBarOrigin);

S2.SetDefaultColor(Color.WHITE);

AddChartBubble(x == HighestAll(S2PLBarOrigin), PLValue, "S2", Color.WHITE, 0);

plot S3 = LinePlot(BarID = S3PLBarID,

                   Value = S3PLValue,

                   BarOrigin = S3PLBarOrigin);

S3.SetDefaultColor(Color.WHITE);

AddChartBubble(x == HighestAll(S3PLBarOrigin), PLValue, "S3", Color.WHITE, 0);

# Trend Line

plot SupportLine2 = if x == HighestAll(S2PLBarOrigin)

                    then S2

                    else if x == HighestAll(PLBarOrigin)

                         then S1  #Parentlow

                         else Double.NaN;

SupportLine2.EnableApproximation();

SupportLine2.SetDefaultColor(Color.GRAY);

SupportLine2.SetLineWeight(1);

SupportLine2.SetStyle(Curve.LONG_DASH);

def slope2 = (S2 - S1) /

             (HighestAll(S2PLBarOrigin) - PLBarOrigin);

plot ExtLine2 = if x >= S2PLBarOrigin

                then (x - HighestAll(S2PLBarOrigin)) * slope2 + S2

                else Double.NaN;

ExtLine2.EnableApproximation();

ExtLine2.SetDefaultColor(Color.GRAY);

ExtLine2.SetLineWeight(1);

ExtLine2.SetStyle(Curve.LONG_DASH);

plot SupportLine3 = if x == HighestAll(R3PHBarOrigin)

                    then R3

                    else if x == PHBarOrigin

                         then R1

                         else Double.NaN;

SupportLine3.EnableApproximation();

SupportLine3.SetDefaultColor(Color.GRAY);

SupportLine3.SetLineWeight(1);

SupportLine3.SetStyle(Curve.LONG_DASH);

def slope3 = (R1 - R3) /

             (HighestAll(PHBarOrigin) - R3PHBarOrigin);

plot ExtLine3 = if x >= R3PHBarOrigin

                then (x - HighestAll(R3PHBarOrigin)) * slope3 + R3

                else Double.NaN;

ExtLine3.EnableApproximation();

ExtLine3.SetDefaultColor(Color.GRAY);

ExtLine3.SetLineWeight(1);

ExtLine3.SetStyle(Curve.LONG_DASH);

input HideCloud = YES;
DefineGlobalColor("ORB", Color.DARK_GRAY);
AddCloud( if !HideCloud then R1   else Double.NaN, S1 , GlobalColor("ORB"), GlobalColor("ORB"));

DEF LOWER_LOW = IF S1 < S2 THEN S1 ELSE IF S1 > S2 THEN S2 ELse LOWER_LOW[1];
DEF HIGHER_HIGH = IF R1 < R2 THEN R2 ELSE IF R1 > R2 THEN R1 ELSE HIGHER_HIGH[1];
PLOT HIGHER_HIGH1 = HIGHER_HIGH;
PLOT LOWER_LOW1 = LOWER_LOW;

def range =  HIGHER_HIGH - LOWER_LOW ;
PLOT FIFTY = HIGHER_HIGH - (range*.50);

plot f10 = HIGHER_HIGH - (RANGE * 0.10);
plot F90 =  HIGHER_HIGH -(RANGE *.90);
plot F236 =  HIGHER_HIGH -(RANGE *.764);
plot F786 =  HIGHER_HIGH -(RANGE *.214);
F786.setlineWeight(3);
F236.setlineWeight(3);

plot F618 =  HIGHER_HIGH -(RANGE *.382);
F618.setlineWeight(1);
F618.SetDefaultColor(Color.MAGENTA);

plot F382 =  HIGHER_HIGH -(RANGE *.618);
F382.setlineWeight(1);
F382.SetDefaultColor(Color.MAGENTA);

f10.SetPaintingStrategy(PaintingStrategy.LINE);
f10.SetDefaultColor(Color.CYAN);
f10.setlineWeight(3);

FIFTY.SetPaintingStrategy(PaintingStrategy.LINE);
FIFTY.SetDefaultColor(Color.ORANGE);
FIFTY.setlineWeight(3);

F90.SetPaintingStrategy(PaintingStrategy.LINE);
F90.SetDefaultColor(Color.CYAN);
F90.setlineWeight(3);

F236.SetPaintingStrategy(PaintingStrategy.LINE);
F236.SetDefaultColor(Color.lIME);
F236.setlineWeight(3);

F786.SetPaintingStrategy(PaintingStrategy.LINE);
F786.SetDefaultColor(Color.lIME);
F786.setlineWeight(3);
####################################################
PLOT FIFTYU = HIGHER_HIGH + (RANGE * 0.50);
plot f10U = HIGHER_HIGH + (RANGE * 0.10);
plot F90U =  HIGHER_HIGH +(RANGE *.90);
plot F236U =  HIGHER_HIGH +(RANGE *.764);
plot F786U =  HIGHER_HIGH +(RANGE *.214);
F786U.setlineWeight(3);
F236U.setlineWeight(3);

plot F618U =  HIGHER_HIGH +(RANGE *.382);
F618U.setlineWeight(1);
F618U.SetDefaultColor(Color.MAGENTA);

plot F382U =  HIGHER_HIGH +(RANGE *.618);
F382U.setlineWeight(1);
F382U.SetDefaultColor(Color.MAGENTA);



f10U.SetPaintingStrategy(PaintingStrategy.LINE);
f10U.SetDefaultColor(Color.CYAN);
f10U.setlineWeight(3);

FIFTYU.SetPaintingStrategy(PaintingStrategy.LINE);
FIFTYU.SetDefaultColor(Color.ORANGE);
FIFTYU.setlineWeight(3);

F90U.SetPaintingStrategy(PaintingStrategy.LINE);
F90U.SetDefaultColor(Color.CYAN);
F90U.setlineWeight(3);

F236U.SetPaintingStrategy(PaintingStrategy.LINE);
F236U.SetDefaultColor(Color.lIME);
F236U.setlineWeight(3);

F786U.SetPaintingStrategy(PaintingStrategy.LINE);
F786U.SetDefaultColor(Color.lIME);
F786U.setlineWeight(3);

####################################################
PLOT FIFTYL = LOWER_LOW - (RANGE * 0.50);
plot f10L = LOWER_LOW - (RANGE * 0.10);
plot F90L =  LOWER_LOW - (RANGE *.90);
plot F236L =  LOWER_LOW - (RANGE *.764);
plot F786L =  LOWER_LOW -(RANGE *.214);
F786L.setlineWeight(3);
F236L.setlineWeight(3);

plot F618L =  LOWER_LOW -(RANGE *.382);
F618L.setlineWeight(1);
F618L.SetDefaultColor(Color.MAGENTA);

plot F382L =  LOWER_LOW -(RANGE *.618);
F382L.setlineWeight(1);
F382L.SetDefaultColor(Color.MAGENTA);

f10L.SetPaintingStrategy(PaintingStrategy.LINE);
f10L.SetDefaultColor(Color.CYAN);
f10L.setlineWeight(3);

FIFTYL.SetPaintingStrategy(PaintingStrategy.LINE);
FIFTYL.SetDefaultColor(Color.ORANGE);
FIFTYL.setlineWeight(3);

F90L.SetPaintingStrategy(PaintingStrategy.LINE);
F90L.SetDefaultColor(Color.CYAN);
F90L.setlineWeight(3);

F236L.SetPaintingStrategy(PaintingStrategy.LINE);
F236L.SetDefaultColor(Color.lIME);
F236L.setlineWeight(3);

F786L.SetPaintingStrategy(PaintingStrategy.LINE);
F786L.SetDefaultColor(Color.lIME);
F786L.setlineWeight(3);

####################################################
DEF F5U = range * .05;

def t3u = FIFTY + F5U;
def t3d = FIFTY - F5U;
input HideCloud2 = no;
DefineGlobalColor("NINTY", Color.DARK_RED);
AddCloud( if !HideCloud2 then FIFTY    else Double.NaN, t3d , GlobalColor("NINTY"), GlobalColor("NINTY"));

DefineGlobalColor("TEN", Color.DARK_GREEN);
AddCloud( if !HideCloud2 then FIFTY   else Double.NaN, t3u  , GlobalColor("TEN"), GlobalColor("TEN"));


####################################################

def PIVOT_RANGE = HIGHER_HIGH - LOWER_LOW;

def DTRpct = Round((PIVOT_RANGE / ATR) * 100, 0);

AddLabel (yes, "PIVOT_TR " + Round (PIVOT_RANGE , 2) + " vs ATR " + Round (ATR, 2) + "  " + Round (DTRpct, 0) + "%", (if DTRpct <= 70 then Color.GREEN else if DTRpct >= 90 then Color.RED else Color.ORANGE));
def ADR = Average(high (period = "DAY")[1], n) - Average(low (period = "DAY")[1], n);
I would like to know how to remove a dash line from 479.98 to 8.25.57 for SPY which makes chart very small.
 

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
272 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