Linear Regression Histogram [LuxAlgo] For ThinkOrSwim

ALEK$TO$

New member
This indicator is inspired by traditional statistical histograms. It will return the number of occurrences of price falling within each interval of the linear regression channel. This can be useful to highlight zones of interest within a trend.

FZHcTSU.png



Original Tradingview Code: https://www.tradingview.com/script/1nJPItpz-Linear-Regression-Histogram-LUX/
New ThinkOrSwim Code: see next post
 
Last edited by a moderator:

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

This was made for TradingView but Id really like to apply it to TOS... Thank you
https://www.tradingview.com/script/1nJPItpz-Linear-Regression-Histogram-LUX/
Ruby:
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo

//@version=5
indicator("Linear Regression Histogram [LuxAlgo]",overlay=true,max_lines_count=500,max_bars_back=500)
length = input.int(100,maxval=500)
bins   = input.int(10,'Bins Number')
mult   = input.float(2.)
src    = input(close)

show_hist = input(true,'Show Histogram',group='Style')
dn_col    = input.color(#ff1100,'Channel Color',group='Style',inline='channel')
up_col    = input.color(#2157f3,'',group='Style',inline='channel')
hist_col  = input.color(#ff5d00,'Histogram Bins Color',group='Style')
//----
var l_reg = array.new_line(0)
var l_hist = array.new_line(0)

lset(l,x1,y1,x2,y2,col)=>
    line.set_xy1(l,x1,y1)
    line.set_xy2(l,x2,y2)
    line.set_color(l,col)

if barstate.isfirst
    for i = 1 to bins
        array.push(l_reg,line.new(na,na,na,na))
        array.push(l_hist,line.new(na,na,na,na))
//----
n = bar_index
v = ta.variance(src,length)
r = ta.correlation(src,n,length)

alpha = r*(math.sqrt(v)/ta.stdev(n,length))
beta = ta.sma(src,length) - alpha*ta.sma(n,length)

mad = math.sqrt(v - v*math.pow(r,2))*mult
//----
if barstate.islast
    a = alpha*(n-length+1) + beta - mad
    b = alpha*n + beta - mad
  
    for i = 0 to bins-2
        k = i/(bins-1)
        wmad = k*mad*2
      
        css = color.from_gradient(k,0,1,dn_col,up_col)
        lset(array.get(l_reg,i),n-length+1,a+wmad,n,b+wmad,css)
      
        if show_hist
            sum = 0.
            for j = 0 to length-1
                K = (i+1)/(bins-1)
                upper = alpha*(n-j) + beta - mad + (K*mad*2)
                lower = alpha*(n-j) + beta - mad + wmad
                sum := src[j] > lower and src[j] < upper ? sum + 1 : sum
              
            lset(array.get(l_hist,i),n,b+wmad,n+int(sum),b+wmad,hist_col)
  
    lset(array.get(l_reg,bins-1),n-length+1,a+mad*2,n,b+mad*2,up_col)
check the below:

CSS:
#// Indicator for TOS
#// © LuxAlgo
#indicator("Linear Regression Histogram [LuxAlgo]",overlay=true,
# Converted by Sam4Cok@Samer800    - 08/2024

input length = 100; #,maxval=500)
input BinsNumber   = 10; #,'Bins Number')
input mult   = 2.0;
input src    = close;
input ShowHistogram = yes; #(true,'Show Histogram',group='Style')

def na = Double.NaN;
def last = isNaN(close);
def hist = if ShowHistogram then last else no;
def bins = Min(Max(BinsNumber, 2), 10);
def bar = BarNumber();
def n = if !last then bar else if(n[1], n[1], 1);

def v = Sqr(StDev(src, length));
def r = Correlation(src, bar, length );

def alpha = r * (sqrt(v)/ stdev(bar,length));
def beta = Average(src,length) - alpha * Average(bar,length);
def mad = sqrt(v -  v * Sqr(r)) * mult;

def wmad0; def wmad1; def wmad2; def wmad3; def wmad4; def a;
def wmad5; def wmad6; def wmad7; def wmad8; def wmad9; def b;
def sum0; def sum1; def sum2; def sum3; def sum4;
def sum5; def sum6; def sum7; def sum8; def sum9;
def col0; def col1; def col2; def col3; def col4;
def col5; def col6; def col7; def col8; def col9;
if last[-1] {
    a = alpha *(n - length + 1) + beta - mad;
    b = alpha * n + beta - mad;
    col0 = 0/(bins-1);
    col1 = 1/(bins-1);
    col2 = if bins < 3 then na else 2/(bins-1);
    col3 = if bins < 4 then na else 3/(bins-1);
    col4 = if bins < 5 then na else 4/(bins-1);
    col5 = if bins < 6 then na else 5/(bins-1);
    col6 = if bins < 7 then na else 6/(bins-1);
    col7 = if bins < 8 then na else 7/(bins-1);
    col8 = if bins < 9 then na else 8/(bins-1);
    col9 = if bins < 10 then na else 9/(bins-1);
    wmad0 = col0 * mad * 2;
    wmad1 = col1 * mad * 2;
    wmad2 = col2 * mad * 2;
    wmad3 = col3 * mad * 2;
    wmad4 = col4 * mad * 2;
    wmad5 = col5 * mad * 2;
    wmad6 = col6 * mad * 2;
    wmad7 = col7 * mad * 2;
    wmad8 = col8 * mad * 2;
    wmad9 = col9 * mad * 2;
    sum0 = fold j0 = 0 to length with p0 do
           p0 + (if (src[j0] > (alpha*(n-j0) + beta - mad + wmad0) and
                     src[j0] < (alpha*(n-j0) + beta - mad + (((0+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum1 = fold j1 = 0 to length with p1 do
           p1 + (if (src[j1] > (alpha*(n-j1) + beta - mad + wmad1) and
                     src[j1] < (alpha*(n-j1) + beta - mad + (((1+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum2 = fold j2 = 0 to length with p2 do
           p2 + (if (src[j2] > (alpha*(n-j2) + beta - mad + wmad2) and
                     src[j2] < (alpha*(n-j2) + beta - mad + (((2+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum3 = fold j3 = 0 to length with p3 do
           p3 + (if (src[j3] > (alpha*(n-j3) + beta - mad + wmad3) and
                     src[j3] < (alpha*(n-j3) + beta - mad + (((3+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum4 = fold j4 = 0 to length with p4 do
           p4 + (if (src[j4] > (alpha*(n-j4) + beta - mad + wmad4) and
                     src[j4] < (alpha*(n-j4) + beta - mad + (((4+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum5 = fold j5 = 0 to length with p5 do
           p5 + (if (src[j5] > (alpha*(n-j5) + beta - mad + wmad5) and
                     src[j5] < (alpha*(n-j5) + beta - mad + (((5+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum6 = fold j6 = 0 to length with p6 do
           p6 + (if (src[j6] > (alpha*(n-j6) + beta - mad + wmad6) and
                     src[j6] < (alpha*(n-j6) + beta - mad + (((6+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum7 = fold j7 = 0 to length with p7 do
           p7 + (if (src[j7] > (alpha*(n-j7) + beta - mad + wmad7) and
                     src[j7] < (alpha*(n-j7) + beta - mad + (((7+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum8 = fold j8 = 0 to length with p8 do
           p8 + (if (src[j8] > (alpha*(n-j8) + beta - mad + wmad8) and
                     src[j8] < (alpha*(n-j8) + beta - mad + (((8+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum9 = fold j9 = 0 to length with p9 do
           p9 + (if (src[j9] > (alpha*(n-j9) + beta - mad + wmad9) and
                     src[j9] < (alpha*(n-j9) + beta - mad + (((9+1)/(bins-1)) * mad*2))) then 1 else 0);
    } else {
    a = a[1];
    b = b[1];
    col0 = col0[1];
    col1 = col1[1];
    col2 = col2[1];
    col3 = col3[1];
    col4 = col4[1];
    col5 = col5[1];
    col6 = col6[1];
    col7 = col7[1];
    col8 = col8[1];
    col9 = col9[1];
    wmad0 = wmad0[1];
    wmad1 = wmad1[1];
    wmad2 = wmad2[1];
    wmad3 = wmad3[1];
    wmad4 = wmad4[1];
    wmad5 = wmad5[1];
    wmad6 = wmad6[1];
    wmad7 = wmad7[1];
    wmad8 = wmad8[1];
    wmad9 = wmad9[1];
    sum0  = sum0[1];
    sum1  = sum1[1];
    sum2  = sum2[1];
    sum3  = sum3[1];
    sum4  = sum4[1];
    sum5  = sum5[1];
    sum6  = sum6[1];
    sum7  = sum7[1];
    sum8  = sum8[1];
    sum9  = sum9[1];
}

Script drawLine {
input priceStart = close;
input priceEnd = close;
input length = 100;
input sum = 0;
    def last = isNaN(close);
    def b = if last[-1] then highestAll(sum) else b[1];
    def x = x[1] + 1;
    def x1 = if !last then x else x1[1];
    def x2 = if x1 == (highestAll(x1)- length+1) then x1 else x2[1];
    def y1 = if last[-1] then priceEnd else y1[1];
    def y2 = if x1 == HighestAll(x2) then highestall(priceStart) else y2[1];
    def x22= highestall(x2);
    def y11= highestall(y1);
    def slope = (y11 - y2)/ (length +1);
    def base = y2 + ((x1 - x22) * slope);
    plot line=  if x1 >= x22 and base and GetValue(!last, b) then base else Double.NaN;
}
def l0 = drawLine(a + wmad0, b + wmad0, length, sum0);
def l1 = drawLine(a + wmad1, b + wmad1, length, sum1);
def l2 = drawLine(a + wmad2, b + wmad2, length, sum2);
def l3 = drawLine(a + wmad3, b + wmad3, length, sum3);
def l4 = drawLine(a + wmad4, b + wmad4, length, sum4);
def l5 = drawLine(a + wmad5, b + wmad5, length, sum5);
def l6 = drawLine(a + wmad6, b + wmad6, length, sum6);
def l7 = drawLine(a + wmad7, b + wmad7, length, sum7);
def l8 = drawLine(a + wmad8, b + wmad8, length, sum8);
def l9 = drawLine(a + wmad9, b + wmad9, length, sum9);

plot linReg0 = if last then na else l0;
plot linReg1 = if last then na else l1;
plot linReg2 = if last then na else l2;
plot linReg3 = if last then na else l3;
plot linReg4 = if last then na else l4;
plot linReg5 = if last then na else l5;
plot linReg6 = if last then na else l6;
plot linReg7 = if last then na else l7;
plot linReg8 = if last then na else l8;
plot linReg9 = if last then na else l9;

plot linRegH0 = if !hist then na else l0;
plot linRegH1 = if !hist then na else l1;
plot linRegH2 = if !hist then na else l2;
plot linRegH3 = if !hist then na else l3;
plot linRegH4 = if !hist then na else l4;
plot linRegH5 = if !hist then na else l5;
plot linRegH6 = if !hist then na else l6;
plot linRegH7 = if !hist then na else l7;
plot linRegH8 = if !hist then na else l8;
plot linRegH9 = if !hist then na else l9;

def col11 = if last[-length] then highestAll(col1) else col11[1];
def col22 = if last[-length] then highestAll(col2) else col22[1];
def col33 = if last[-length] then highestAll(col3) else col33[1];
def col44 = if last[-length] then highestAll(col4) else col44[1];
def col55 = if last[-length] then highestAll(col5) else col55[1];
def col66 = if last[-length] then highestAll(col6) else col66[1];
def col77 = if last[-length] then highestAll(col7) else col77[1];
def col88 = if last[-length] then highestAll(col8) else col88[1];

linReg0.SetDefaultColor(Color.RED);
linReg1.AssignValueColor(CreateColor(255-col11*255, col11*255, col11*255));
linReg2.AssignValueColor(CreateColor(255-col22*255, col22*255, col22*255));
linReg3.AssignValueColor(CreateColor(255-col33*255, col33*255, col33*255));
linReg4.AssignValueColor(CreateColor(255-col44*255, col44*255, col44*255));
linReg5.AssignValueColor(CreateColor(255-col55*255, col55*255, col55*255));
linReg6.AssignValueColor(CreateColor(255-col66*255, col66*255, col66*255));
linReg7.AssignValueColor(CreateColor(255-col77*255, col77*255, col77*255));
linReg8.AssignValueColor(CreateColor(255-col88*255, col88*255, col88*255));
linReg9.AssignValueColor(Color.CYAN);

linRegH0.setDefaultColor(GetColor(7));
linRegH1.setDefaultColor(GetColor(7));
linRegH2.setDefaultColor(GetColor(7));
linRegH3.setDefaultColor(GetColor(7));
linRegH4.setDefaultColor(GetColor(7));
linRegH5.setDefaultColor(GetColor(7));
linRegH6.setDefaultColor(GetColor(7));
linRegH7.setDefaultColor(GetColor(7));
linRegH8.setDefaultColor(GetColor(7));
linRegH9.setDefaultColor(GetColor(7));
linRegH0.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH2.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH4.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH5.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH6.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH7.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH8.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH9.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);

# End of CODE
 
check the below:

CSS:
#// Indicator for TOS
#// © LuxAlgo
#indicator("Linear Regression Histogram [LuxAlgo]",overlay=true,
# Converted by Sam4Cok@Samer800    - 08/2024

input length = 100; #,maxval=500)
input BinsNumber   = 10; #,'Bins Number')
input mult   = 2.0;
input src    = close;
input ShowHistogram = yes; #(true,'Show Histogram',group='Style')

def na = Double.NaN;
def last = isNaN(close);
def hist = if ShowHistogram then last else no;
def bins = Min(Max(BinsNumber, 2), 10);
def bar = BarNumber();
def n = if !last then bar else if(n[1], n[1], 1);

def v = Sqr(StDev(src, length));
def r = Correlation(src, bar, length );

def alpha = r * (sqrt(v)/ stdev(bar,length));
def beta = Average(src,length) - alpha * Average(bar,length);
def mad = sqrt(v -  v * Sqr(r)) * mult;

def wmad0; def wmad1; def wmad2; def wmad3; def wmad4; def a;
def wmad5; def wmad6; def wmad7; def wmad8; def wmad9; def b;
def sum0; def sum1; def sum2; def sum3; def sum4;
def sum5; def sum6; def sum7; def sum8; def sum9;
def col0; def col1; def col2; def col3; def col4;
def col5; def col6; def col7; def col8; def col9;
if last[-1] {
    a = alpha *(n - length + 1) + beta - mad;
    b = alpha * n + beta - mad;
    col0 = 0/(bins-1);
    col1 = 1/(bins-1);
    col2 = if bins < 3 then na else 2/(bins-1);
    col3 = if bins < 4 then na else 3/(bins-1);
    col4 = if bins < 5 then na else 4/(bins-1);
    col5 = if bins < 6 then na else 5/(bins-1);
    col6 = if bins < 7 then na else 6/(bins-1);
    col7 = if bins < 8 then na else 7/(bins-1);
    col8 = if bins < 9 then na else 8/(bins-1);
    col9 = if bins < 10 then na else 9/(bins-1);
    wmad0 = col0 * mad * 2;
    wmad1 = col1 * mad * 2;
    wmad2 = col2 * mad * 2;
    wmad3 = col3 * mad * 2;
    wmad4 = col4 * mad * 2;
    wmad5 = col5 * mad * 2;
    wmad6 = col6 * mad * 2;
    wmad7 = col7 * mad * 2;
    wmad8 = col8 * mad * 2;
    wmad9 = col9 * mad * 2;
    sum0 = fold j0 = 0 to length with p0 do
           p0 + (if (src[j0] > (alpha*(n-j0) + beta - mad + wmad0) and
                     src[j0] < (alpha*(n-j0) + beta - mad + (((0+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum1 = fold j1 = 0 to length with p1 do
           p1 + (if (src[j1] > (alpha*(n-j1) + beta - mad + wmad1) and
                     src[j1] < (alpha*(n-j1) + beta - mad + (((1+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum2 = fold j2 = 0 to length with p2 do
           p2 + (if (src[j2] > (alpha*(n-j2) + beta - mad + wmad2) and
                     src[j2] < (alpha*(n-j2) + beta - mad + (((2+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum3 = fold j3 = 0 to length with p3 do
           p3 + (if (src[j3] > (alpha*(n-j3) + beta - mad + wmad3) and
                     src[j3] < (alpha*(n-j3) + beta - mad + (((3+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum4 = fold j4 = 0 to length with p4 do
           p4 + (if (src[j4] > (alpha*(n-j4) + beta - mad + wmad4) and
                     src[j4] < (alpha*(n-j4) + beta - mad + (((4+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum5 = fold j5 = 0 to length with p5 do
           p5 + (if (src[j5] > (alpha*(n-j5) + beta - mad + wmad5) and
                     src[j5] < (alpha*(n-j5) + beta - mad + (((5+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum6 = fold j6 = 0 to length with p6 do
           p6 + (if (src[j6] > (alpha*(n-j6) + beta - mad + wmad6) and
                     src[j6] < (alpha*(n-j6) + beta - mad + (((6+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum7 = fold j7 = 0 to length with p7 do
           p7 + (if (src[j7] > (alpha*(n-j7) + beta - mad + wmad7) and
                     src[j7] < (alpha*(n-j7) + beta - mad + (((7+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum8 = fold j8 = 0 to length with p8 do
           p8 + (if (src[j8] > (alpha*(n-j8) + beta - mad + wmad8) and
                     src[j8] < (alpha*(n-j8) + beta - mad + (((8+1)/(bins-1)) * mad*2))) then 1 else 0);
    sum9 = fold j9 = 0 to length with p9 do
           p9 + (if (src[j9] > (alpha*(n-j9) + beta - mad + wmad9) and
                     src[j9] < (alpha*(n-j9) + beta - mad + (((9+1)/(bins-1)) * mad*2))) then 1 else 0);
    } else {
    a = a[1];
    b = b[1];
    col0 = col0[1];
    col1 = col1[1];
    col2 = col2[1];
    col3 = col3[1];
    col4 = col4[1];
    col5 = col5[1];
    col6 = col6[1];
    col7 = col7[1];
    col8 = col8[1];
    col9 = col9[1];
    wmad0 = wmad0[1];
    wmad1 = wmad1[1];
    wmad2 = wmad2[1];
    wmad3 = wmad3[1];
    wmad4 = wmad4[1];
    wmad5 = wmad5[1];
    wmad6 = wmad6[1];
    wmad7 = wmad7[1];
    wmad8 = wmad8[1];
    wmad9 = wmad9[1];
    sum0  = sum0[1];
    sum1  = sum1[1];
    sum2  = sum2[1];
    sum3  = sum3[1];
    sum4  = sum4[1];
    sum5  = sum5[1];
    sum6  = sum6[1];
    sum7  = sum7[1];
    sum8  = sum8[1];
    sum9  = sum9[1];
}

Script drawLine {
input priceStart = close;
input priceEnd = close;
input length = 100;
input sum = 0;
    def last = isNaN(close);
    def b = if last[-1] then highestAll(sum) else b[1];
    def x = x[1] + 1;
    def x1 = if !last then x else x1[1];
    def x2 = if x1 == (highestAll(x1)- length+1) then x1 else x2[1];
    def y1 = if last[-1] then priceEnd else y1[1];
    def y2 = if x1 == HighestAll(x2) then highestall(priceStart) else y2[1];
    def x22= highestall(x2);
    def y11= highestall(y1);
    def slope = (y11 - y2)/ (length +1);
    def base = y2 + ((x1 - x22) * slope);
    plot line=  if x1 >= x22 and base and GetValue(!last, b) then base else Double.NaN;
}
def l0 = drawLine(a + wmad0, b + wmad0, length, sum0);
def l1 = drawLine(a + wmad1, b + wmad1, length, sum1);
def l2 = drawLine(a + wmad2, b + wmad2, length, sum2);
def l3 = drawLine(a + wmad3, b + wmad3, length, sum3);
def l4 = drawLine(a + wmad4, b + wmad4, length, sum4);
def l5 = drawLine(a + wmad5, b + wmad5, length, sum5);
def l6 = drawLine(a + wmad6, b + wmad6, length, sum6);
def l7 = drawLine(a + wmad7, b + wmad7, length, sum7);
def l8 = drawLine(a + wmad8, b + wmad8, length, sum8);
def l9 = drawLine(a + wmad9, b + wmad9, length, sum9);

plot linReg0 = if last then na else l0;
plot linReg1 = if last then na else l1;
plot linReg2 = if last then na else l2;
plot linReg3 = if last then na else l3;
plot linReg4 = if last then na else l4;
plot linReg5 = if last then na else l5;
plot linReg6 = if last then na else l6;
plot linReg7 = if last then na else l7;
plot linReg8 = if last then na else l8;
plot linReg9 = if last then na else l9;

plot linRegH0 = if !hist then na else l0;
plot linRegH1 = if !hist then na else l1;
plot linRegH2 = if !hist then na else l2;
plot linRegH3 = if !hist then na else l3;
plot linRegH4 = if !hist then na else l4;
plot linRegH5 = if !hist then na else l5;
plot linRegH6 = if !hist then na else l6;
plot linRegH7 = if !hist then na else l7;
plot linRegH8 = if !hist then na else l8;
plot linRegH9 = if !hist then na else l9;

def col11 = if last[-length] then highestAll(col1) else col11[1];
def col22 = if last[-length] then highestAll(col2) else col22[1];
def col33 = if last[-length] then highestAll(col3) else col33[1];
def col44 = if last[-length] then highestAll(col4) else col44[1];
def col55 = if last[-length] then highestAll(col5) else col55[1];
def col66 = if last[-length] then highestAll(col6) else col66[1];
def col77 = if last[-length] then highestAll(col7) else col77[1];
def col88 = if last[-length] then highestAll(col8) else col88[1];

linReg0.SetDefaultColor(Color.RED);
linReg1.AssignValueColor(CreateColor(255-col11*255, col11*255, col11*255));
linReg2.AssignValueColor(CreateColor(255-col22*255, col22*255, col22*255));
linReg3.AssignValueColor(CreateColor(255-col33*255, col33*255, col33*255));
linReg4.AssignValueColor(CreateColor(255-col44*255, col44*255, col44*255));
linReg5.AssignValueColor(CreateColor(255-col55*255, col55*255, col55*255));
linReg6.AssignValueColor(CreateColor(255-col66*255, col66*255, col66*255));
linReg7.AssignValueColor(CreateColor(255-col77*255, col77*255, col77*255));
linReg8.AssignValueColor(CreateColor(255-col88*255, col88*255, col88*255));
linReg9.AssignValueColor(Color.CYAN);

linRegH0.setDefaultColor(GetColor(7));
linRegH1.setDefaultColor(GetColor(7));
linRegH2.setDefaultColor(GetColor(7));
linRegH3.setDefaultColor(GetColor(7));
linRegH4.setDefaultColor(GetColor(7));
linRegH5.setDefaultColor(GetColor(7));
linRegH6.setDefaultColor(GetColor(7));
linRegH7.setDefaultColor(GetColor(7));
linRegH8.setDefaultColor(GetColor(7));
linRegH9.setDefaultColor(GetColor(7));
linRegH0.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH2.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH4.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH5.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH6.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH7.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH8.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
linRegH9.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);

# End of CODE
This is very interesting! Im going to check this out tonight during my nightly charting session. Nice work @samer800, as always.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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