Anchored Linear Regression Lines

Suace2

New member
Hi,

I am looking for a way to anchor the linear regression channel script to a specific bar (specific date and time). Rather than having to count or provide the number of bars back instead I want it to go back to the specific date/time as this will be anchored and can be used across multiple timeframes without having to re adjust the N value everytime a timeframe is changed.

Can someone please help put this code together?
 
Solution
Hi,

I am looking for a way to anchor the linear regression channel script to a specific bar (specific date and time). Rather than having to count or provide the number of bars back instead I want it to go back to the specific date/time as this will be anchored and can be used across multiple timeframes without having to re adjust the N value everytime a timeframe is changed.

Can someone please help put this code together?

Here are additions of inputs for startdate, starttime, and other options to the standard TOS LinearRegChan100 indicator.

Ruby:
#
# TD Ameritrade IP Company, Inc. (c) 2008-2022
#
#
#Sleepyz Adaption to TOS LinRegChan100

input startdate = 20220101;
input starttime = 1200;
input length    = 200;
input...
Hi,

I am looking for a way to anchor the linear regression channel script to a specific bar (specific date and time). Rather than having to count or provide the number of bars back instead I want it to go back to the specific date/time as this will be anchored and can be used across multiple timeframes without having to re adjust the N value everytime a timeframe is changed.

Can someone please help put this code together?

Here are additions of inputs for startdate, starttime, and other options to the standard TOS LinearRegChan100 indicator.

Ruby:
#
# TD Ameritrade IP Company, Inc. (c) 2008-2022
#
#
#Sleepyz Adaption to TOS LinRegChan100

input startdate = 20220101;
input starttime = 1200;
input length    = 200;
input extendtoright  = yes;
input extendtoleft   = no;
input price = close;

plot MiddleLR = Inertiaall(price, startDate = startdate, startTime = starttime, extendToLeft = extendtoleft, extendToRight = extendtoright, length = length);
def dist = HighestAll(AbsValue(MiddleLR - price));
plot UpperLR = MiddleLR + dist;
plot LowerLR = MiddleLR - dist;

MiddleLR.SetDefaultColor(GetColor(5));
UpperLR.SetDefaultColor(GetColor(5));
LowerLR.SetDefaultColor(GetColor(5));
 
Solution
Here are additions of inputs for startdate, starttime, and other options to the standard TOS LinearRegChan100 indicator.
Look for this exact thing - I want to anchor a regression channel to a past event based upon variables (cannot pass anything but constants to the parameters unless I can capture the date/time and pass it) but that hasn't been successful and the barnumber() of the past event equals 1 due to the nature of the chart direction reading barcount. Any luck? If I find I will share as well.
 
Look for this exact thing - I want to anchor a regression channel to a past event based upon variables (cannot pass anything but constants to the parameters unless I can capture the date/time and pass it) but that hasn't been successful and the barnumber() of the past event equals 1 due to the nature of the chart direction reading barcount. Any luck? If I find I will share as well.


See if this is useful. It is a modification to Mobius' time anchor to instead use a cond based upon a barnumber() start.

In the example below, the zigzaghighlow indicator is used to identify the barnumber() of the zigzags. Then one was used as def cond, the cyan circled arrow's barnumber().

Capture.jpg
Ruby:
#08:35 Mobius: Here's the anchored Regression Channel I use
#  02.12.2019  10:49 Mobius: Just a note to the Anchored LRC. I usually change to 930 from 1800 about 11:00 EST.  I don't change to 1800 till 2000 if I still have the program up and running.  I could program it to do that automatically but am too lazy.


AddLabel(1, "Anchored LRL", Color.WHITE);
# Time Anchored Regression Channel
# Mobius
# V01.01.2016
#Modified to use zigzagHighLow as a cond anchor
input atrreversal = 2.0;

def priceh = MovingAverage(AverageType.EXPONENTIAL, high, 5);
def pricel = MovingAverage(AverageType.EXPONENTIAL, low, 5);

def EIL = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastL;
def EIH = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastH;

plot signaldown = if !isNAN(EIH) then barnumber() else double.nan;
signaldown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

plot signalrevBot = if !isNaN(EIL) then barnumber() else double.nan;
signalrevBot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

def cond = BarNumber() == HighestAll(signalrevbot);

input y = close;
input Channel_1_Width = 0.70;
input Channel_2_Width = 1.00;
input LineWeight = 1;

script E
    {
    input y = close;
    input n = 20;
    def s = fold i = 0 to n
             with j
             do j + GetValue(y, i);
    plot D = s;
}
# Variables
def o = open;
def h = high;
def l = low;
def c = close;
def x = BarNumber();
def nan = Double.NaN;
def xx = if IsNaN(c[-1]) and !IsNaN(c) then x else xx[1];
##  code comment for line immediately above
##  thinking from left to right.. xx = 0 until the curren tbar is reached
##  at the current bar xx = x
##  beyond the current bar xx = xx[1]  the value of xx one bar back

def firstBar = if cond
               then x
               else firstBar[1];
def S_y = if x == HighestAll(firstBar)
          then y
          else if x > HighestAll(firstBar)
               then S_y[1] + y
               else S_y[1];
def S_x = if x == HighestAll(firstBar)
          then 1
          else if x > HighestAll(firstBar)
               then S_x[1] + 1
               else S_x[1];
def x0_ = HighestAll(xx) - firstBar;
def x1 = HighestAll(if !IsNaN(y) and IsNaN(y[-1])
                    then x
                    else nan);
def x0 = HighestAll(if GetValue(x, -x0_) == x1
                    then x
                    else nan);
def x_ = if GetValue(x, -x0_) >= x1
         then x - x0
         else x_[1];
def Ex  = E(x_, x0_);
def Ey  = E(y, x0_);
def Exy = E(x_ * y, x0_);
def Exsq = E(Sqr(x_), x0_);
def b = (x0_ * Exy - (Ex * Ey)) / (x0_ * Exsq - (Ex * Ex));
def a = (GetValue(Ey, x - x1) - GetValue(b, x - x1) * GetValue(Ex, x - x1)) / x0_;
def LR = a + (GetValue(b, x - x1) * x_);
def r = Max(h, c[1]) - Min(l, c[1]);
def Er = E(r, x0_) / x0_;
def mean = S_y / S_x;
def SD = Sqrt((1 / S_x) * (E(Sqr(y - mean), S_x)));
# Plots
plot LRL = if x > x1 + 5 then nan else
           if x >= x0  # x is defined as barnumber()
           then LR
           else nan; # from nube



#plot LRL = if x >= x0  # x is defined as barnumber()
#           then LR
#           else nan;  # mobius original
LRL.SetStyle(Curve.FIRM);
LRL.SetLineWeight(LineWeight + 1);
LRL.AssignValueColor(if GetValue(a, x - x1) < LR
                         then Color.CYAN
                         else Color.ORANGE);
LRL.HideBubble();
LRL.HideTitle();
plot upper1 = LRL + (HighestAll(SD) * Channel_1_Width);
upper1.SetLineWeight(LineWeight);
upper1.SetDefaultColor(Color.LIGHT_GRAY);
upper1.HideBubble();
upper1.HideTitle();
plot lower1 = LRL - (HighestAll(SD) * Channel_1_Width);
lower1.SetLineWeight(LineWeight);
lower1.SetDefaultColor(Color.LIGHT_GRAY);
lower1.HideBubble();
lower1.HideTitle();
plot upper2 = LRL + (HighestAll(SD) * Channel_2_Width);
upper2.SetLineWeight(LineWeight);
upper2.SetDefaultColor(Color.LIGHT_GRAY);
upper2.HideBubble();
upper2.HideTitle();
plot lower2 = LRL - (HighestAll(SD) * Channel_2_Width);
lower2.SetLineWeight(LineWeight);
lower2.SetDefaultColor(Color.LIGHT_GRAY);
lower2.HideBubble();
lower2.HideTitle();
# End Code Time Anchored Regression Channel
 
See if this is useful. It is a modification to Mobius' time anchor to instead use a cond based upon a barnumber() start.

In the example below, the zigzaghighlow indicator is used to identify the barnumber() of the zigzags. Then one was used as def cond, the cyan circled arrow's barnumber().

I made a minor adjustment to the example to have it plot a new linear regression whenever the zigzaghighlow example changes direction. This was done with
Rich (BB code):
def cond = BarNumber() == max(highestall(signaldown), HighestAll(signalrevbot));

Capture.jpg
Ruby:
#08:35 Mobius: Here's the anchored Regression Channel I use
#  02.12.2019  10:49 Mobius: Just a note to the Anchored LRC. I usually change to 930 from 1800 about 11:00 EST.  I don't change to 1800 till 2000 if I still have the program up and running.  I could program it to do that automatically but am too lazy.


AddLabel(1, "Anchored LRL", Color.WHITE);
# Time Anchored Regression Channel
# Mobius
# V01.01.2016
#Modified to use zigzagHighLow as a cond anchor
input atrreversal = 2.0;

def priceh = MovingAverage(AverageType.EXPONENTIAL, high, 5);
def pricel = MovingAverage(AverageType.EXPONENTIAL, low, 5);

def EIL = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastL;
def EIH = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastH;

plot signaldown = if !isNAN(EIH) then barnumber() else double.nan;
signaldown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

plot signalrevBot = if !isNaN(EIL) then barnumber() else double.nan;
signalrevBot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

def cond = BarNumber() == max(highestall(signaldown), HighestAll(signalrevbot));

input y = close;
input Channel_1_Width = 0.70;
input Channel_2_Width = 1.00;
input LineWeight = 1;

script E
    {
    input y = close;
    input n = 20;
    def s = fold i = 0 to n
             with j
             do j + GetValue(y, i);
    plot D = s;
}
# Variables
def o = open;
def h = high;
def l = low;
def c = close;
def x = BarNumber();
def nan = Double.NaN;
def xx = if IsNaN(c[-1]) and !IsNaN(c) then x else xx[1];
##  code comment for line immediately above
##  thinking from left to right.. xx = 0 until the curren tbar is reached
##  at the current bar xx = x
##  beyond the current bar xx = xx[1]  the value of xx one bar back

def firstBar = if cond
               then x
               else firstBar[1];
def S_y = if x == HighestAll(firstBar)
          then y
          else if x > HighestAll(firstBar)
               then S_y[1] + y
               else S_y[1];
def S_x = if x == HighestAll(firstBar)
          then 1
          else if x > HighestAll(firstBar)
               then S_x[1] + 1
               else S_x[1];
def x0_ = HighestAll(xx) - firstBar;
def x1 = HighestAll(if !IsNaN(y) and IsNaN(y[-1])
                    then x
                    else nan);
def x0 = HighestAll(if GetValue(x, -x0_) == x1
                    then x
                    else nan);
def x_ = if GetValue(x, -x0_) >= x1
         then x - x0
         else x_[1];
def Ex  = E(x_, x0_);
def Ey  = E(y, x0_);
def Exy = E(x_ * y, x0_);
def Exsq = E(Sqr(x_), x0_);
def b = (x0_ * Exy - (Ex * Ey)) / (x0_ * Exsq - (Ex * Ex));
def a = (GetValue(Ey, x - x1) - GetValue(b, x - x1) * GetValue(Ex, x - x1)) / x0_;
def LR = a + (GetValue(b, x - x1) * x_);
def r = Max(h, c[1]) - Min(l, c[1]);
def Er = E(r, x0_) / x0_;
def mean = S_y / S_x;
def SD = Sqrt((1 / S_x) * (E(Sqr(y - mean), S_x)));
# Plots
plot LRL = if x > x1 + 5 then nan else
           if x >= x0  # x is defined as barnumber()
           then LR
           else nan; # from nube



#plot LRL = if x >= x0  # x is defined as barnumber()
#           then LR
#           else nan;  # mobius original
LRL.SetStyle(Curve.FIRM);
LRL.SetLineWeight(LineWeight + 1);
LRL.AssignValueColor(if GetValue(a, x - x1) < LR
                         then Color.CYAN
                         else Color.ORANGE);
LRL.HideBubble();
LRL.HideTitle();
plot upper1 = LRL + (HighestAll(SD) * Channel_1_Width);
upper1.SetLineWeight(LineWeight);
upper1.SetDefaultColor(Color.LIGHT_GRAY);
upper1.HideBubble();
upper1.HideTitle();
plot lower1 = LRL - (HighestAll(SD) * Channel_1_Width);
lower1.SetLineWeight(LineWeight);
lower1.SetDefaultColor(Color.LIGHT_GRAY);
lower1.HideBubble();
lower1.HideTitle();
plot upper2 = LRL + (HighestAll(SD) * Channel_2_Width);
upper2.SetLineWeight(LineWeight);
upper2.SetDefaultColor(Color.LIGHT_GRAY);
upper2.HideBubble();
upper2.HideTitle();
plot lower2 = LRL - (HighestAll(SD) * Channel_2_Width);
lower2.SetLineWeight(LineWeight);
lower2.SetDefaultColor(Color.LIGHT_GRAY);
lower2.HideBubble();
lower2.HideTitle();
# End Code Time Anchored Regression Channel
 
I made a minor adjustment to the example to have it plot a new linear regression whenever the zigzaghighlow example changes direction. This was done with
Rich (BB code):
def cond = BarNumber() == max(highestall(signaldown), HighestAll(signalrevbot));
I made a minor adjustment to the example to have it plot a new linear regression whenever the zigzaghighlow example changes direction. This was done with
Rich (BB code):
def cond = BarNumber() == max(highestall(signaldown), HighestAll(signalrevbot));
Hi Sleepyz, can you please help to provide scan for the Signaldown and signalrevBot?

def signalrevBot = if !isNaN(EIL) then barnumber() else double.nan;
def signaldown = if !isNAN(EIH) then barnumber() else double.nan;

when I try to use scan hacker, it will give the following error:
com.devexperts.tos.thinkscript.runtime.TooComplexException: The complexity of the expression suggests that it may not be reliable with real-time data.
 
Last edited:
Hi Sleepyz, can you please help to provide scan for the Signaldown and signalrevBot?

def signalrevBot = if !isNaN(EIL) then barnumber() else double.nan;
def signaldown = if !isNAN(EIH) then barnumber() else double.nan;

when I try to use scan hacker, it will give the following error:
com.devexperts.tos.thinkscript.runtime.TooComplexException: The complexity of the expression suggests that it may not be reliable with real-time data.
The zigzaghighlow is not reliable in the scanner.
 
I made a minor adjustment to the example to have it plot a new linear regression whenever the zigzaghighlow example changes direction. This was done with
Rich (BB code):
def cond = BarNumber() == max(highestall(signaldown), HighestAll(signalrevbot));
I get the gist of the script, not sure how the max of the highestall of both signals is the last barnumber, if it isn't measured by close etc.

I think the channel width should be a dynamic number for the stdev away from the mean (mid) both high and low, and that's something I'm always measuring in any regression periods. The barnumber is something I'd like it to track automatically to back when it happens, and I am assuming this 'cond' isn't that. However, it's a nice start to learn from.

Think Highest Arrow on the Chart and Lowest Arrow on the chart, however many days/bars back that is.

input showpivot = yes;
def highvar1 = HighestAll(var1);
rec highestvar1 = if var == highvar1 and var1[1] < var1[1] then high(period = Agg) else highestvar1[1];
plot highestVar1Point = if ShowPivot and highestvar1 <> 0 then highestvar1 else Double.NaN;

#plot same as low mark using lowest.
same for var2, var3 etc. all custom variables. They plot across the chart until replaced by similiar auto-calc.

Say 5d 5m chart etc. And for Var2 or Var3 etc their might be many many data plots in between all the bars, and measure all the data plots as they occur in that dataset, between said bars.

I was using inertia of those variables to grab the data for the channel in stdev and mean and calculate bar(nubmer) and entering length manuually to right of chart, instead of calculating barsback automatically (can't pass variables, constants only) - and plot it. But I cannot define a beginning and end automatically - starting at highest and stopping at lowest for example would be great (not running until the right of the chart unless I chose 'extendright' = on etc.

So a total of 6 lines will plot. I want to pick the beginning of each line as the starting point for the regression channel, either by Input/Switch or just automatically.

it seems to me you would have cond and cond1
Rich (BB code):
def cond = BarNumber() == max(highestall(signaldown), HighestAll(signalrevbot));
def cond1 = BarNumber() == min(lowestall(signaldown), lowestAll(signalrevbot));

and have 2 plot statements to begin or terminate at either of the two 'conditions', either having two slopes calculated.

Or even if it ran to the right of the chart from the last known selected condition (highest, lowest) of var1, var2, var3 etc. as we really want to preserve the slope of the dynamic stdev/mean of the latest dataset from set condition as the chart unfolds.


It kind of reminds me of Limbo by Mobius - am I far off?

# Calculations for line between extremes
def line = b + (slope * (barnumber - lownumber));
def linelow = a + (slopelow * (barnumber - highnumber));
def currentlinelow = if barnumber <= lownumberall
then linelow
else Double.NaN;
def currentline = if barnumber <= highnumberall
then line
else Double.NaN;
def FibFan = if downward
then currentlinelow
else if upward
then currentline
else Double.NaN;

.....
 
Last edited:
Here are additions of inputs for startdate, starttime, and other options to the standard TOS LinearRegChan100 indicator.
Hi @SleepyZ thanks for the indicator really helpful. However I am seeing the challenge that even though we use the anchor start date the channel lines keep changing based on the timeframes used. When we set the length its actually the bar count based on the timeframe used so the channel values keep changing based on the timeframe used on the chart.

Is it possible to use a fixed aggregation value like daily for the length value so even if we the change the timeframe to a 5 min chart the channel values remain intact. Is this possible ?

Is it also possible to have a enddate and endtime for the channel ?

thanks in advance
 
Last edited:
Hi,

I am looking for a way to anchor the linear regression channel script to a specific bar (specific date and time). Rather than having to count or provide the number of bars back instead I want it to go back to the specific date/time as this will be anchored and can be used across multiple timeframes without having to re adjust the N value everytime a timeframe is changed.

Can someone please help put this code together?

Look for this exact thing - I want to anchor a regression channel to a past event based upon variables (cannot pass anything but constants to the parameters unless I can capture the date/time and pass it) but that hasn't been successful and the barnumber() of the past event equals 1 due to the nature of the chart direction reading barcount. Any luck? If I find I will share as well.
me too
 
Last edited by a moderator:


The above link used a barnumber derived from a zigzag to plot the linear regression channel
https://usethinkscript.com/threads/anchored-linear-regression-lines.11141/post-104242

Here is the relevant part of the code with the def cond tied to a barnumber.

The image shows the channel based upon barnumber 372, which was hard coded, but could have been derived as was in the zigzag referenced channel
Screenshot-2023-04-04-064923.png
Code:
# Time Anchored Regression Channel
# Mobius
# V01.01.2016
#Modified to use barnumber as a cond anchor

def cond = BarNumber() == 372;

input y = close;
input Channel_1_Width = 0.70;
input Channel_2_Width = 1.00;
input LineWeight = 1;

script E
    {
    input y = close;
    input n = 20;
    def s = fold i = 0 to n
             with j
             do j + GetValue(y, i);
    plot D = s;
}
# Variables
def o = open;
def h = high;
def l = low;
def c = close;
def x = BarNumber();
def nan = Double.NaN;
def xx = if IsNaN(c[-1]) and !IsNaN(c) then x else xx[1];
##  code comment for line immediately above
##  thinking from left to right.. xx = 0 until the curren tbar is reached
##  at the current bar xx = x
##  beyond the current bar xx = xx[1]  the value of xx one bar back

def firstBar = if cond
               then x
               else firstBar[1];
def S_y = if x == HighestAll(firstBar)
          then y
          else if x > HighestAll(firstBar)
               then S_y[1] + y
               else S_y[1];
def S_x = if x == HighestAll(firstBar)
          then 1
          else if x > HighestAll(firstBar)
               then S_x[1] + 1
               else S_x[1];
def x0_ = HighestAll(xx) - firstBar;
def x1 = HighestAll(if !IsNaN(y) and IsNaN(y[-1])
                    then x
                    else nan);
def x0 = HighestAll(if GetValue(x, -x0_) == x1
                    then x
                    else nan);
def x_ = if GetValue(x, -x0_) >= x1
         then x - x0
         else x_[1];
def Ex  = E(x_, x0_);
def Ey  = E(y, x0_);
def Exy = E(x_ * y, x0_);
def Exsq = E(Sqr(x_), x0_);
def b = (x0_ * Exy - (Ex * Ey)) / (x0_ * Exsq - (Ex * Ex));
def a = (GetValue(Ey, x - x1) - GetValue(b, x - x1) * GetValue(Ex, x - x1)) / x0_;
def LR = a + (GetValue(b, x - x1) * x_);
def r = Max(h, c[1]) - Min(l, c[1]);
def Er = E(r, x0_) / x0_;
def mean = S_y / S_x;
def SD = Sqrt((1 / S_x) * (E(Sqr(y - mean), S_x)));
# Plots
plot LRL = if x > x1 + 5 then nan else
           if x >= x0  # x is defined as barnumber()
           then LR
           else nan; # from nube



#plot LRL = if x >= x0  # x is defined as barnumber()
#           then LR
#           else nan;  # mobius original
LRL.SetStyle(Curve.FIRM);
LRL.SetLineWeight(LineWeight + 1);
LRL.AssignValueColor(if GetValue(a, x - x1) < LR
                         then Color.CYAN
                         else Color.ORANGE);
LRL.HideBubble();
LRL.HideTitle();
plot upper1 = LRL + (HighestAll(SD) * Channel_1_Width);
upper1.SetLineWeight(LineWeight);
upper1.SetDefaultColor(Color.LIGHT_GRAY);
upper1.HideBubble();
upper1.HideTitle();
plot lower1 = LRL - (HighestAll(SD) * Channel_1_Width);
lower1.SetLineWeight(LineWeight);
lower1.SetDefaultColor(Color.LIGHT_GRAY);
lower1.HideBubble();
lower1.HideTitle();
plot upper2 = LRL + (HighestAll(SD) * Channel_2_Width);
upper2.SetLineWeight(LineWeight);
upper2.SetDefaultColor(Color.LIGHT_GRAY);
upper2.HideBubble();
upper2.HideTitle();
plot lower2 = LRL - (HighestAll(SD) * Channel_2_Width);
lower2.SetLineWeight(LineWeight);
lower2.SetDefaultColor(Color.LIGHT_GRAY);
lower2.HideBubble();
lower2.HideTitle();
# End Code Time Anchored Regression Channel
 
Hi @SleepyZ thanks for the indicator really helpful. However I am seeing the challenge that even though we use the anchor start date the channel lines keep changing based on the timeframes used. When we set the length its actually the bar count based on the timeframe used so the channel values keep changing based on the timeframe used on the chart.

Is it possible to use a fixed aggregation value like daily for the length value so even if we the change the timeframe to a 5 min chart the channel values remain intact. Is this possible ?

Is it also possible to have a enddate and endtime for the channel ?

thanks in advance

Just saw this.

The inputs for agg and enddate should do what you requested. I removed the inputs to extend lines as these potentially conflict with your date constraints.

Remember that adding an agg will require you to use chart aggregations less than or equal to the agg period chosen.

#
# TD Ameritrade IP Company, Inc. (c) 2008-2022
#
#
#Sleepyz Adaption to TOS LinRegChan100

input startdate = 20230330;
input enddate = 20230402;
input starttime = 1047;
input agg = AggregationPeriod.DAY;
input price = FundamentalType.CLOSE;

input length = 200;


plot MiddleLR = if GetYYYYMMDD() > enddate then Double.NaN else InertiaAll(Fundamental(price, period = agg), startDate = startdate, startTime = starttime, length = length);
def dist = HighestAll(AbsValue(MiddleLR - Fundamental(price, period = agg)));
plot UpperLR = MiddleLR + dist;
plot LowerLR = MiddleLR - dist;

MiddleLR.SetDefaultColor(GetColor(5));
UpperLR.SetDefaultColor(GetColor(5));
LowerLR.SetDefaultColor(GetColor(5));
 

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