Blue Magik SSL Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
I came across this indicator on TradingView. The author said he added additional EMAs (13+21+55) into the code (which I did not) because you can easily do that in ThinkorSwim. Turned out this is the same version as the one converted by @skynetgen. I didn't want it to go to waste so I'm just dropping it here :)

You just treat it like a simple SMA crossover strategy and trade in the direction it's going.

TW46Abs.png


thinkScript Code

Code:
# Blue Magik SSL
# I assume this is based on the popular SSL indicator
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/i85H2tZ8-blue-magik/

input period = 10;
input len = 10;

def smaHigh = simpleMovingAvg(high, len);
def smaLow = simpleMovingAvg(low, len);
def Hlv = if close > smaHigh then 1 else if close<smaLow then -1 else Hlv[1];

def sslDown = if Hlv< 0 then smaHigh else smaLow;
def sslUp = if Hlv< 0 then smaLow else smaHigh;

plot up = sslUp;
plot down = sslDown;

up.SetDefaultColor(GetColor(1));
down.SetDefaultColor(GetColor(0));
 
@BenTen I decided to take a look at this indicator as a lower study. It works pretty well, especially if you use the right side of the chart.
It's just a preference, works either way.
 
I like using this on the Lower Study. As a lower study does anyone see a benefit of adding the ability to show up & down arrows & a an alert on the chart when a Blue Magik cross takes place? Here I show using it with the NEW VIP AMM indicator. (I'm Feelin a "Grail" Comin one!) LOL!

10.png


12.png


11.png
 
Last edited:
Here is a version that allows for up to 5 different lengths over 6 AGG periods, triangles are for lengths 1,3,&5,
Points are for lengths 2&4,
Start with smaller lengths then a larger one and so on

AGG Time frames are from lowest to highest
Displays are smallest length, smallest AGG period on the bottom and build up from there to Largest Length Largest AGG Period

Code:
###########################################

Declare Lower;
# GLOBAL DEFINITIONS

DefineGlobalColor("TrendUp", CreateColor(0, 254, 30));
DefineGlobalColor("TrendDown", CreateColor(255, 3, 2));

input agg = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
input agg4 = AggregationPeriod.TWO_Hours;;
input agg5 = AggregationPeriod.FOUR_HOURs;
input agg6 = AggregationPeriod.DAY;
Input Len1 = 6;
Input Len2 = 9;
Input Len3 = 12;
Input Len4 = 15;
Input Len5 = 18;
input DotSize = 5;
input n = 30;
def n1  = n + 1;
def C = Close(Period =AGG);
def H = High(Period = AGG);
def L = Low(Period = AGG);
def C2 = Close(Period =AGG2);
def H2 = High(Period = AGG2);
def L2 = Low(Period = AGG2);
def C3 = Close(Period =AGG3);
def H3 = High(Period = AGG3);
def L3 = Low(Period = AGG3);
def C4 = Close(Period =AGG4);
def H4 = High(Period = AGG4);
def L4 = Low(Period = AGG4);
def C5 = Close(Period =AGG5);
def H5 = High(Period = AGG5);
def L5 = Low(Period = AGG5);
def C6= Close(Period =AGG6);
def H6 = High(Period = AGG6);
def L6 = Low(Period = AGG6);


#Aggregation 1
#lA1BL6
def A1BL6smaHigh = simpleMovingAvg(H, Len1);
def A1BL6smaLow = simpleMovingAvg(L, Len1);
def A1BL6Hlv = if C > A1BL6smaHigh then 1 else if C< A1BL6smaLow then -1 else A1BL6Hlv[1];
def A1BL6sslDown = if A1BL6Hlv< 0 then A1BL6smaHigh else A1BL6smaLow;
def A1BL6sslUp = if A1BL6Hlv< 0 then A1BL6smaLow else A1BL6smaHigh;
plot A1BL6_Dot = if IsNaN(c) then Double.NaN else 1;
A1BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1BL6_Dot.SetLineWeight(DotSize);
A1BL6_Dot.AssignValueColor(if A1BL6sslUP < A1BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 2
#A2BL6
def A2BL6smaHigh = simpleMovingAvg(H2, 6);
def A2BL6smaLow = simpleMovingAvg(L2, 6);
def A2BL6Hlv = if C2 > A2BL6smaHigh then 1 else if C2< A2BL6smaLow then -1 else A2BL6Hlv[1];
def A2BL6sslDown = if A2BL6Hlv< 0 then A2BL6smaHigh else A2BL6smaLow;
def A2BL6sslUp = if A2BL6Hlv< 0 then A2BL6smaLow else A2BL6smaHigh;
plot A2BL6_Dot = if IsNaN(c2) then Double.NaN else 2;
A2BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2BL6_Dot.SetLineWeight(DotSize);
A2BL6_Dot.AssignValueColor(if A2BL6sslUP < A2BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL6
def A3BL6smaHigh = simpleMovingAvg(H3, Len1);
def A3BL6smaLow = simpleMovingAvg(L3, Len1);
def A3BL6Hlv = if C3 > A3BL6smaHigh then 1 else if C3 < A3BL6smaLow then -1 else A3BL6Hlv[1];
def A3BL6sslDown = if A3BL6Hlv < 0 then A3BL6smaHigh else A3BL6smaLow;
def A3BL6sslUp = if A3BL6Hlv < 0 then A3BL6smaLow else A3BL6smaHigh;
plot A3BL6_Dot = if IsNaN(c3) then Double.NaN else 3;
A3BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3BL6_Dot.SetLineWeight(DotSize);
A3BL6_Dot.AssignValueColor(if A3BL6sslUP < A3BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL6
def A4BL6smaHigh = simpleMovingAvg(H4, Len1);
def A4BL6smaLow = simpleMovingAvg(L4, Len1);
def A4BL6Hlv = if C4 > A4BL6smaHigh then 1 else if C4 < A4BL6smaLow then -1 else A4BL6Hlv[1];
def A4BL6sslDown = if A4BL6Hlv < 0 then A4BL6smaHigh else A4BL6smaLow;
def A4BL6sslUp = if A4BL6Hlv < 0 then A4BL6smaLow else A4BL6smaHigh;
plot A4BL6_Dot = if IsNaN(c4) then Double.NaN else 4;
A4BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4BL6_Dot.SetLineWeight(DotSize);
A4BL6_Dot.AssignValueColor(if A4BL6sslUP < A4BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL6
def A5BL6smaHigh = simpleMovingAvg(H5, Len1);
def A5BL6smaLow = simpleMovingAvg(L5, Len1);
def A5BL6Hlv = if C5 > A5BL6smaHigh then 1 else if C5 < A5BL6smaLow then -1 else A5BL6Hlv[1];
def A5BL6sslDown = if A5BL6Hlv < 0 then A5BL6smaHigh else A5BL6smaLow;
def A5BL6sslUp = if A5BL6Hlv < 0 then A5BL6smaLow else A5BL6smaHigh;
plot A5BL6_Dot = if IsNaN(c5) then Double.NaN else 5;
A5BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5BL6_Dot.SetLineWeight(DotSize);
A5BL6_Dot.AssignValueColor(if A5BL6sslUP < A5BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL6
def A6BL6smaHigh = simpleMovingAvg(H6, Len1);
def A6BL6smaLow = simpleMovingAvg(L6, Len1);
def A6BL6Hlv = if C6 > A6BL6smaHigh then 1 else if C6 < A6BL6smaLow then -1 else A6BL6Hlv[1];
def A6BL6sslDown = if A6BL6Hlv < 0 then A6BL6smaHigh else A6BL6smaLow;
def A6BL6sslUp = if A6BL6Hlv < 0 then A6BL6smaLow else A6BL6smaHigh;
plot A6BL6_Dot = if IsNaN(c6) then Double.NaN else 6;
A6BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6BL6_Dot.SetLineWeight(DotSize);
A6BL6_Dot.AssignValueColor(if A6BL6sslUP < A6BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL9
def A1BL9smaHigh = simpleMovingAvg(H, Len2);
def A1BL9smaLow = simpleMovingAvg(L, Len2);
def A1BL9Hlv = if C > A1BL9smaHigh then 1 else if C< A1BL9smaLow then -1 else A1BL9Hlv[1];
def A1BL9sslDown = if A1BL9Hlv< 0 then A1BL9smaHigh else A1BL9smaLow;
def A1BL9sslUp = if A1BL9Hlv< 0 then A1BL9smaLow else A1BL9smaHigh;
plot A1BL9_Dot = if IsNaN(c) then Double.NaN else 7;
A1BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A1BL9_Dot.SetLineWeight(DotSize);
A1BL9_Dot.AssignValueColor(if A1BL9sslUP < A1BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
#A2BL9
def A2BL9smaHigh = simpleMovingAvg(H2, Len2);
def A2BL9smaLow = simpleMovingAvg(L2, Len2);
def A2BL9Hlv = if C2 > A2BL9smaHigh then 1 else if C2< A2BL9smaLow then -1 else A2BL9Hlv[1];
def A2BL9sslDown = if A2BL9Hlv< 0 then A2BL9smaHigh else A2BL9smaLow;
def A2BL9sslUp = if A2BL9Hlv< 0 then A2BL9smaLow else A2BL9smaHigh;
plot A2BL9_Dot = if IsNaN(c2) then Double.NaN else 8;
A2BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A2BL9_Dot.SetLineWeight(DotSize);
A2BL9_Dot.AssignValueColor(if A2BL9sslUP < A2BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL9
def A3BL9smaHigh = simpleMovingAvg(H3, Len2);
def A3BL9smaLow = simpleMovingAvg(L3, Len2);
def A3BL9Hlv = if C3 > A3BL9smaHigh then 1 else if C3 < A3BL9smaLow then -1 else A3BL9Hlv[1];
def A3BL9sslDown = if A3BL9Hlv < 0 then A3BL9smaHigh else A3BL9smaLow;
def A3BL9sslUp = if A3BL9Hlv < 0 then A3BL9smaLow else A3BL9smaHigh;
plot A3BL9_Dot = if IsNaN(c3) then Double.NaN else 9;
A3BL9_Dot.SetPaintingStrategy(PaintingStrategy.points);
A3BL9_Dot.SetLineWeight(DotSize);
A3BL9_Dot.AssignValueColor(if A3BL9sslUP < A3BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL9
def A4BL9smaHigh = simpleMovingAvg(H4, Len2);
def A4BL9smaLow = simpleMovingAvg(L4, Len2);
def A4BL9Hlv = if C4 > A4BL9smaHigh then 1 else if C4 < A4BL9smaLow then -1 else A4BL9Hlv[1];
def A4BL9sslDown = if A4BL9Hlv < 0 then A4BL9smaHigh else A4BL9smaLow;
def A4BL9sslUp = if A4BL9Hlv < 0 then A4BL9smaLow else A4BL9smaHigh;
plot A4BL9_Dot = if IsNaN(c4) then Double.NaN else 10;
A4BL9_Dot.SetPaintingStrategy(PaintingStrategy.points);
A4BL9_Dot.SetLineWeight(DotSize);
A4BL9_Dot.AssignValueColor(if A4BL9sslUP < A4BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#lA5BL9
def A5BL9smaHigh = simpleMovingAvg(H5, Len2);
def A5BL9smaLow = simpleMovingAvg(L5, Len2);
def A5BL9Hlv = if C5 > A5BL9smaHigh then 1 else if C5 < A5BL9smaLow then -1 else A5BL9Hlv[1];
def A5BL9sslDown = if A5BL9Hlv < 0 then A5BL9smaHigh else A5BL9smaLow;
def A5BL9sslUp = if A5BL9Hlv < 0 then A5BL9smaLow else A5BL9smaHigh;
plot A5BL9_Dot = if IsNaN(c5) then Double.NaN else 11;
A5BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A5BL9_Dot.SetLineWeight(DotSize);
A5BL9_Dot.AssignValueColor(if A5BL9sslUP < A5BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL9
def A6BL9smaHigh = simpleMovingAvg(H6, Len2);
def A6BL9smaLow = simpleMovingAvg(L6, Len2);
def A6BL9Hlv = if C6 > A6BL9smaHigh then 1 else if C6 < A6BL9smaLow then -1 else A6BL9Hlv[1];
def A6BL9sslDown = if A6BL9Hlv < 0 then A6BL9smaHigh else A6BL9smaLow;
def A6BL9sslUp = if A6BL9Hlv < 0 then A6BL9smaLow else A6BL9smaHigh;
plot A6BL9_Dot = if IsNaN(c6) then Double.NaN else 12;
A6BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A6BL9_Dot.SetLineWeight(DotSize);
A6BL9_Dot.AssignValueColor(if A6BL9sslUP < A6BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL12
def A1BL12smaHigh = simpleMovingAvg(H, Len3);
def A1BL12smaLow = simpleMovingAvg(L, Len3);
def A1BL12Hlv = if C > A1BL12smaHigh then 1 else if C< A1BL12smaLow then -1 else A1BL12Hlv[1];
def A1BL12sslDown = if A1BL12Hlv< 0 then A1BL12smaHigh else A1BL12smaLow;
def A1BL12sslUp = if A1BL12Hlv< 0 then A1BL12smaLow else A1BL12smaHigh;
plot A1BL12_Dot = if IsNaN(c) then Double.NaN else 13;
A1BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1BL12_Dot.SetLineWeight(DotSize);
A1BL12_Dot.AssignValueColor(if A1BL12sslUP < A1BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
#A2BL12
def A2BL12smaHigh = simpleMovingAvg(H2, Len3);
def A2BL12smaLow = simpleMovingAvg(L2, len3);
def A2BL12Hlv = if C2 > A2BL12smaHigh then 1 else if C2< A2BL12smaLow then -1 else A2BL12Hlv[1];
def A2BL12sslDown = if A2BL12Hlv< 0 then A2BL12smaHigh else A2BL12smaLow;
def A2BL12sslUp = if A2BL12Hlv< 0 then A2BL12smaLow else A2BL12smaHigh;
plot A2BL12_Dot = if IsNaN(c2) then Double.NaN else 14;
A2BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2BL12_Dot.SetLineWeight(DotSize);
A2BL12_Dot.AssignValueColor(if A2BL12sslUP < A2BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL12
def A3BL12smaHigh = simpleMovingAvg(H3, Len3);
def A3BL12smaLow = simpleMovingAvg(L3, Len3);
def A3BL12Hlv = if C3 > A3BL12smaHigh then 1 else if C3 < A3BL12smaLow then -1 else A3BL12Hlv[1];
def A3BL12sslDown = if A3BL12Hlv < 0 then A3BL12smaHigh else A3BL12smaLow;
def A3BL12sslUp = if A3BL12Hlv < 0 then A3BL12smaLow else A3BL12smaHigh;
plot A3BL12_Dot = if IsNaN(c3) then Double.NaN else 15;
A3BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3BL12_Dot.SetLineWeight(DotSize);
A3BL12_Dot.AssignValueColor(if A3BL12sslUP < A3BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL12
def A4BL12smaHigh = simpleMovingAvg(H4, Len3);
def A4BL12smaLow = simpleMovingAvg(L4, Len3);
def A4BL12Hlv = if C4 > A4BL12smaHigh then 1 else if C4 < A4BL12smaLow then -1 else A4BL12Hlv[1];
def A4BL12sslDown = if A4BL12Hlv < 0 then A4BL12smaHigh else A4BL12smaLow;
def A4BL12sslUp = if A4BL12Hlv < 0 then A4BL12smaLow else A4BL12smaHigh;
plot A4BL12_Dot = if IsNaN(c4) then Double.NaN else 16;
A4BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4BL12_Dot.SetLineWeight(DotSize);
A4BL12_Dot.AssignValueColor(if A4BL12sslUP < A4BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL12
def A5BL12smaHigh = simpleMovingAvg(H5, Len3);
def A5BL12smaLow = simpleMovingAvg(L5, Len3);
def A5BL12Hlv = if C5 > A5BL12smaHigh then 1 else if C5 < A5BL12smaLow then -1 else A5BL12Hlv[1];
def A5BL12sslDown = if A5BL12Hlv < 0 then A5BL12smaHigh else A5BL12smaLow;
def A5BL12sslUp = if A5BL12Hlv < 0 then A5BL12smaLow else A5BL12smaHigh;
plot A5BL12_Dot = if IsNaN(c5) then Double.NaN else 17;
A5BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5BL12_Dot.SetLineWeight(DotSize);
A5BL12_Dot.AssignValueColor(if A5BL12sslUP < A5BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL12
def A6BL12smaHigh = simpleMovingAvg(H6, Len3);
def A6BL12smaLow = simpleMovingAvg(L6, Len3);
def A6BL12Hlv = if C6 > A6BL12smaHigh then 1 else if C6 < A6BL12smaLow then -1 else A6BL12Hlv[1];
def A6BL12sslDown = if A6BL12Hlv < 0 then A6BL12smaHigh else A6BL12smaLow;
def A6BL12sslUp = if A6BL12Hlv < 0 then A6BL12smaLow else A6BL12smaHigh;
plot A6BL12_Dot = if IsNaN(c6) then Double.NaN else 18;
A6BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6BL12_Dot.SetLineWeight(DotSize);
A6BL12_Dot.AssignValueColor(if A6BL12sslUP < A6BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL15
def A1BL15smaHigh = simpleMovingAvg(H, Len4);
def A1BL15smaLow = simpleMovingAvg(L, Len4);
def A1BL15Hlv = if C > A1BL15smaHigh then 1 else if C< A1BL15smaLow then -1 else A1BL15Hlv[1];
def A1BL15sslDown = if A1BL15Hlv< 0 then A1BL15smaHigh else A1BL15smaLow;
def A1BL15sslUp = if A1BL15Hlv< 0 then A1BL15smaLow else A1BL15smaHigh;
plot A1BL15_Dot = if IsNaN(c) then Double.NaN else 19;
A1BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A1BL15_Dot.SetLineWeight(DotSize);
A1BL15_Dot.AssignValueColor(if A1BL15sslUP < A1BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
# A2BL15
def A2BL15smaHigh = simpleMovingAvg(H2, Len4);
def A2BL15smaLow = simpleMovingAvg(L2, Len4);
def A2BL15Hlv = if C2 > A2BL15smaHigh then 1 else if C2< A2BL15smaLow then -1 else A2BL15Hlv[1];
def A2BL15sslDown = if A2BL15Hlv< 0 then A2BL15smaHigh else A2BL15smaLow;
def A2BL15sslUp = if A2BL15Hlv< 0 then A2BL15smaLow else A2BL15smaHigh;
plot A2BL15_Dot = if IsNaN(c2) then Double.NaN else 20;
A2BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A2BL15_Dot.SetLineWeight(DotSize);
A2BL15_Dot.AssignValueColor(if A2BL15sslUP < A2BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL15
def A3BL15smaHigh = simpleMovingAvg(H3, Len4);
def A3BL15smaLow = simpleMovingAvg(L3, Len4);
def A3BL15Hlv = if C3 > A3BL15smaHigh then 1 else if C3 < A3BL15smaLow then -1 else A3BL15Hlv[1];
def A3BL15sslDown = if A3BL15Hlv < 0 then A3BL15smaHigh else A3BL15smaLow;
def A3BL15sslUp = if A3BL15Hlv < 0 then A3BL15smaLow else A3BL15smaHigh;
plot A3BL15_Dot = if IsNaN(c3) then Double.NaN else 21;
A3BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A3BL15_Dot.SetLineWeight(DotSize);
A3BL15_Dot.AssignValueColor(if A3BL15sslUP < A3BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL15
def A4BL15smaHigh = simpleMovingAvg(H4, 15);
def A4BL15smaLow = simpleMovingAvg(L4, 15);
def A4BL15Hlv = if C4 > A4BL15smaHigh then 1 else if C4 < A4BL15smaLow then -1 else A4BL15Hlv[1];
def A4BL15sslDown = if A4BL15Hlv < 0 then A4BL15smaHigh else A4BL15smaLow;
def A4BL15sslUp = if A4BL15Hlv < 0 then A4BL15smaLow else A4BL15smaHigh;
plot A4BL15_Dot = if IsNaN(c4) then Double.NaN else 22;
A4BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A4BL15_Dot.SetLineWeight(DotSize);
A4BL15_Dot.AssignValueColor(if A4BL15sslUP < A4BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL15
def A5BL15smaHigh = simpleMovingAvg(H5, 15);
def A5BL15smaLow = simpleMovingAvg(L5, 15);
def A5BL15Hlv = if C5 > A5BL15smaHigh then 1 else if C5 < A5BL15smaLow then -1 else A5BL15Hlv[1];
def A5BL15sslDown = if A5BL15Hlv < 0 then A5BL15smaHigh else A5BL15smaLow;
def A5BL15sslUp = if A5BL15Hlv < 0 then A5BL15smaLow else A5BL15smaHigh;
plot A5BL15_Dot = if IsNaN(c5) then Double.NaN else 23;
A5BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A5BL15_Dot.SetLineWeight(DotSize);
A5BL15_Dot.AssignValueColor(if A5BL15sslUP < A5BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL15
def A6BL15smaHigh = simpleMovingAvg(H6, Len4);
def A6BL15smaLow = simpleMovingAvg(L6, Len4);
def A6BL15Hlv = if C6 > A6BL15smaHigh then 1 else if C6 < A6BL15smaLow then -1 else A6BL15Hlv[1];
def A6BL15sslDown = if A6BL15Hlv < 0 then A6BL15smaHigh else A6BL15smaLow;
def A6BL15sslUp = if A6BL15Hlv < 0 then A6BL15smaLow else A6BL15smaHigh;
plot A6BL15_Dot = if IsNaN(c6) then Double.NaN else 24;
A6BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A6BL15_Dot.SetLineWeight(DotSize);
A6BL15_Dot.AssignValueColor(if A6BL15sslUP < A6BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL18
def A1BL18smaHigh = simpleMovingAvg(H, Len5);
def A1BL18smaLow = simpleMovingAvg(L, Len5);
def A1BL18Hlv = if C > A1BL18smaHigh then 1 else if C< A1BL18smaLow then -1 else A1BL18Hlv[1];
def A1BL18sslDown = if A1BL18Hlv< 0 then A1BL18smaHigh else A1BL18smaLow;
def A1BL18sslUp = if A1BL18Hlv< 0 then A1BL18smaLow else A1BL18smaHigh;
plot A1BL18_Dot = if IsNaN(c) then Double.NaN else 25;
A1BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1BL18_Dot.SetLineWeight(DotSize);
A1BL18_Dot.AssignValueColor(if A1BL18sslUP < A1BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
#A2BL18
def A2BL18smaHigh = simpleMovingAvg(H2, Len5);
def A2BL18smaLow = simpleMovingAvg(L2, Len5);
def A2BL18Hlv = if C2 > A2BL18smaHigh then 1 else if C2< A2BL18smaLow then -1 else A2BL18Hlv[1];
def A2BL18sslDown = if A2BL18Hlv< 0 then A2BL18smaHigh else A2BL18smaLow;
def A2BL18sslUp = if A2BL18Hlv< 0 then A2BL18smaLow else A2BL18smaHigh;
plot A2BL18_Dot = if IsNaN(c2) then Double.NaN else 26;
A2BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2BL18_Dot.SetLineWeight(DotSize);
A2BL18_Dot.AssignValueColor(if A2BL18sslUP < A2BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL18
def A3BL18smaHigh = simpleMovingAvg(H3, 18);
def A3BL18smaLow = simpleMovingAvg(L3, 18);
def A3BL18Hlv = if C3 > A3BL18smaHigh then 1 else if C3 < A3BL18smaLow then -1 else A3BL18Hlv[1];
def A3BL18sslDown = if A3BL18Hlv < 0 then A3BL18smaHigh else A3BL18smaLow;
def A3BL18sslUp = if A3BL18Hlv < 0 then A3BL18smaLow else A3BL18smaHigh;
plot A3BL18_Dot = if IsNaN(c3) then Double.NaN else 27;
A3BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3BL18_Dot.SetLineWeight(DotSize);
A3BL18_Dot.AssignValueColor(if A3BL18sslUP < A3BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL18
def A4BL18smaHigh = simpleMovingAvg(H4, Len5);
def A4BL18smaLow = simpleMovingAvg(L4, Len5);
def A4BL18Hlv = if C4 > A4BL18smaHigh then 1 else if C4 < A4BL18smaLow then -1 else A4BL18Hlv[1];
def A4BL18sslDown = if A4BL18Hlv < 0 then A4BL18smaHigh else A4BL18smaLow;
def A4BL18sslUp = if A4BL18Hlv < 0 then A4BL18smaLow else A4BL18smaHigh;
plot A4BL18_Dot = if IsNaN(c4) then Double.NaN else 28;
A4BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4BL18_Dot.SetLineWeight(DotSize);
A4BL18_Dot.AssignValueColor(if A4BL18sslUP < A4BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL18
def A5BL18smaHigh = simpleMovingAvg(H5, Len5);
def A5BL18smaLow = simpleMovingAvg(L5, Len5);
def A5BL18Hlv = if C5 > A5BL18smaHigh then 1 else if C5 < A5BL18smaLow then -1 else A5BL18Hlv[1];
def A5BL18sslDown = if A5BL18Hlv < 0 then A5BL18smaHigh else A5BL18smaLow;
def A5BL18sslUp = if A5BL18Hlv < 0 then A5BL18smaLow else A5BL18smaHigh;
plot A5BL18_Dot = if IsNaN(c5) then Double.NaN else 29;
A5BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5BL18_Dot.SetLineWeight(DotSize);
A5BL18_Dot.AssignValueColor(if A5BL18sslUP < A5BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL18
def A6BL18smaHigh = simpleMovingAvg(H6, Len5);
def A6BL18smaLow = simpleMovingAvg(L6, Len5);
def A6BL18Hlv = if C6 > A6BL18smaHigh then 1 else if C6 < A6BL18smaLow then -1 else A6BL18Hlv[1];
def A6BL18sslDown = if A6BL18Hlv < 0 then A6BL18smaHigh else A6BL18smaLow;
def A6BL18sslUp = if A6BL18Hlv < 0 then A6BL18smaLow else A6BL18smaHigh;
plot A6BL18_Dot = if IsNaN(c6) then Double.NaN else 30;
A6BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6BL18_Dot.SetLineWeight(DotSize);
A6BL18_Dot.AssignValueColor(if A6BL18sslUP < A6BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
TgBZvn5.png
 
Last edited by a moderator:
Here is the Tradingview code for the SSL Channel

Code:
//@version=3
//Indicator built on ErwinBeckers SSL Channel
//
study(title="SSL Channel w/alert", shorttitle="SSL Channel", overlay=true)
period=input(title="Period", defval=10)
len=input(title="Period", defval=10)
smaHigh=sma(high, len)
smaLow=sma(low, len)
Hlv = na
Hlv := close > smaHigh ? 1 : close < smaLow ? -1 : Hlv[1]
sslDown = Hlv < 0 ? smaHigh: smaLow
sslUp   = Hlv < 0 ? smaLow : smaHigh

plot(sslDown, linewidth=2, color=red)
plot(sslUp, linewidth=2, color=lime)
 
Anyone try this as a strategy? I created one with the crossover and added Close above 200 SMA and it looks pretty good. I'm currently using on 1 min NQ.
plot upCross = if sslUp crosses above sslDown then 1 else 0;
upCross.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot downCross = if sslDown crosses above sslUp then 1 else 0;
downCross.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Tradingview has a SSL hybrid someone posted a request to convert maybe worth looking into.
 
Here is a version that allows for up to 5 different lengths over 6 AGG periods, triangles are for lengths 1,3,&5,
Points are for lengths 2&4,
Start with smaller lengths then a larger one and so on

AGG Time frames are from lowest to highest
Displays are smallest length, smallest AGG period on the bottom and build up from there to Largest Length Largest AGG Period

Code:
###########################################

Declare Lower;
# GLOBAL DEFINITIONS

DefineGlobalColor("TrendUp", CreateColor(0, 254, 30));
DefineGlobalColor("TrendDown", CreateColor(255, 3, 2));

input agg = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
input agg4 = AggregationPeriod.TWO_Hours;;
input agg5 = AggregationPeriod.FOUR_HOURs;
input agg6 = AggregationPeriod.DAY;
Input Len1 = 6;
Input Len2 = 9;
Input Len3 = 12;
Input Len4 = 15;
Input Len5 = 18;
input DotSize = 5;
input n = 30;
def n1  = n + 1;
def C = Close(Period =AGG);
def H = High(Period = AGG);
def L = Low(Period = AGG);
def C2 = Close(Period =AGG2);
def H2 = High(Period = AGG2);
def L2 = Low(Period = AGG2);
def C3 = Close(Period =AGG3);
def H3 = High(Period = AGG3);
def L3 = Low(Period = AGG3);
def C4 = Close(Period =AGG4);
def H4 = High(Period = AGG4);
def L4 = Low(Period = AGG4);
def C5 = Close(Period =AGG5);
def H5 = High(Period = AGG5);
def L5 = Low(Period = AGG5);
def C6= Close(Period =AGG6);
def H6 = High(Period = AGG6);
def L6 = Low(Period = AGG6);


#Aggregation 1
#lA1BL6
def A1BL6smaHigh = simpleMovingAvg(H, Len1);
def A1BL6smaLow = simpleMovingAvg(L, Len1);
def A1BL6Hlv = if C > A1BL6smaHigh then 1 else if C< A1BL6smaLow then -1 else A1BL6Hlv[1];
def A1BL6sslDown = if A1BL6Hlv< 0 then A1BL6smaHigh else A1BL6smaLow;
def A1BL6sslUp = if A1BL6Hlv< 0 then A1BL6smaLow else A1BL6smaHigh;
plot A1BL6_Dot = if IsNaN(c) then Double.NaN else 1;
A1BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1BL6_Dot.SetLineWeight(DotSize);
A1BL6_Dot.AssignValueColor(if A1BL6sslUP < A1BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 2
#A2BL6
def A2BL6smaHigh = simpleMovingAvg(H2, 6);
def A2BL6smaLow = simpleMovingAvg(L2, 6);
def A2BL6Hlv = if C2 > A2BL6smaHigh then 1 else if C2< A2BL6smaLow then -1 else A2BL6Hlv[1];
def A2BL6sslDown = if A2BL6Hlv< 0 then A2BL6smaHigh else A2BL6smaLow;
def A2BL6sslUp = if A2BL6Hlv< 0 then A2BL6smaLow else A2BL6smaHigh;
plot A2BL6_Dot = if IsNaN(c2) then Double.NaN else 2;
A2BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2BL6_Dot.SetLineWeight(DotSize);
A2BL6_Dot.AssignValueColor(if A2BL6sslUP < A2BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL6
def A3BL6smaHigh = simpleMovingAvg(H3, Len1);
def A3BL6smaLow = simpleMovingAvg(L3, Len1);
def A3BL6Hlv = if C3 > A3BL6smaHigh then 1 else if C3 < A3BL6smaLow then -1 else A3BL6Hlv[1];
def A3BL6sslDown = if A3BL6Hlv < 0 then A3BL6smaHigh else A3BL6smaLow;
def A3BL6sslUp = if A3BL6Hlv < 0 then A3BL6smaLow else A3BL6smaHigh;
plot A3BL6_Dot = if IsNaN(c3) then Double.NaN else 3;
A3BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3BL6_Dot.SetLineWeight(DotSize);
A3BL6_Dot.AssignValueColor(if A3BL6sslUP < A3BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL6
def A4BL6smaHigh = simpleMovingAvg(H4, Len1);
def A4BL6smaLow = simpleMovingAvg(L4, Len1);
def A4BL6Hlv = if C4 > A4BL6smaHigh then 1 else if C4 < A4BL6smaLow then -1 else A4BL6Hlv[1];
def A4BL6sslDown = if A4BL6Hlv < 0 then A4BL6smaHigh else A4BL6smaLow;
def A4BL6sslUp = if A4BL6Hlv < 0 then A4BL6smaLow else A4BL6smaHigh;
plot A4BL6_Dot = if IsNaN(c4) then Double.NaN else 4;
A4BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4BL6_Dot.SetLineWeight(DotSize);
A4BL6_Dot.AssignValueColor(if A4BL6sslUP < A4BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL6
def A5BL6smaHigh = simpleMovingAvg(H5, Len1);
def A5BL6smaLow = simpleMovingAvg(L5, Len1);
def A5BL6Hlv = if C5 > A5BL6smaHigh then 1 else if C5 < A5BL6smaLow then -1 else A5BL6Hlv[1];
def A5BL6sslDown = if A5BL6Hlv < 0 then A5BL6smaHigh else A5BL6smaLow;
def A5BL6sslUp = if A5BL6Hlv < 0 then A5BL6smaLow else A5BL6smaHigh;
plot A5BL6_Dot = if IsNaN(c5) then Double.NaN else 5;
A5BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5BL6_Dot.SetLineWeight(DotSize);
A5BL6_Dot.AssignValueColor(if A5BL6sslUP < A5BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL6
def A6BL6smaHigh = simpleMovingAvg(H6, Len1);
def A6BL6smaLow = simpleMovingAvg(L6, Len1);
def A6BL6Hlv = if C6 > A6BL6smaHigh then 1 else if C6 < A6BL6smaLow then -1 else A6BL6Hlv[1];
def A6BL6sslDown = if A6BL6Hlv < 0 then A6BL6smaHigh else A6BL6smaLow;
def A6BL6sslUp = if A6BL6Hlv < 0 then A6BL6smaLow else A6BL6smaHigh;
plot A6BL6_Dot = if IsNaN(c6) then Double.NaN else 6;
A6BL6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6BL6_Dot.SetLineWeight(DotSize);
A6BL6_Dot.AssignValueColor(if A6BL6sslUP < A6BL6sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL9
def A1BL9smaHigh = simpleMovingAvg(H, Len2);
def A1BL9smaLow = simpleMovingAvg(L, Len2);
def A1BL9Hlv = if C > A1BL9smaHigh then 1 else if C< A1BL9smaLow then -1 else A1BL9Hlv[1];
def A1BL9sslDown = if A1BL9Hlv< 0 then A1BL9smaHigh else A1BL9smaLow;
def A1BL9sslUp = if A1BL9Hlv< 0 then A1BL9smaLow else A1BL9smaHigh;
plot A1BL9_Dot = if IsNaN(c) then Double.NaN else 7;
A1BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A1BL9_Dot.SetLineWeight(DotSize);
A1BL9_Dot.AssignValueColor(if A1BL9sslUP < A1BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
#A2BL9
def A2BL9smaHigh = simpleMovingAvg(H2, Len2);
def A2BL9smaLow = simpleMovingAvg(L2, Len2);
def A2BL9Hlv = if C2 > A2BL9smaHigh then 1 else if C2< A2BL9smaLow then -1 else A2BL9Hlv[1];
def A2BL9sslDown = if A2BL9Hlv< 0 then A2BL9smaHigh else A2BL9smaLow;
def A2BL9sslUp = if A2BL9Hlv< 0 then A2BL9smaLow else A2BL9smaHigh;
plot A2BL9_Dot = if IsNaN(c2) then Double.NaN else 8;
A2BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A2BL9_Dot.SetLineWeight(DotSize);
A2BL9_Dot.AssignValueColor(if A2BL9sslUP < A2BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL9
def A3BL9smaHigh = simpleMovingAvg(H3, Len2);
def A3BL9smaLow = simpleMovingAvg(L3, Len2);
def A3BL9Hlv = if C3 > A3BL9smaHigh then 1 else if C3 < A3BL9smaLow then -1 else A3BL9Hlv[1];
def A3BL9sslDown = if A3BL9Hlv < 0 then A3BL9smaHigh else A3BL9smaLow;
def A3BL9sslUp = if A3BL9Hlv < 0 then A3BL9smaLow else A3BL9smaHigh;
plot A3BL9_Dot = if IsNaN(c3) then Double.NaN else 9;
A3BL9_Dot.SetPaintingStrategy(PaintingStrategy.points);
A3BL9_Dot.SetLineWeight(DotSize);
A3BL9_Dot.AssignValueColor(if A3BL9sslUP < A3BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL9
def A4BL9smaHigh = simpleMovingAvg(H4, Len2);
def A4BL9smaLow = simpleMovingAvg(L4, Len2);
def A4BL9Hlv = if C4 > A4BL9smaHigh then 1 else if C4 < A4BL9smaLow then -1 else A4BL9Hlv[1];
def A4BL9sslDown = if A4BL9Hlv < 0 then A4BL9smaHigh else A4BL9smaLow;
def A4BL9sslUp = if A4BL9Hlv < 0 then A4BL9smaLow else A4BL9smaHigh;
plot A4BL9_Dot = if IsNaN(c4) then Double.NaN else 10;
A4BL9_Dot.SetPaintingStrategy(PaintingStrategy.points);
A4BL9_Dot.SetLineWeight(DotSize);
A4BL9_Dot.AssignValueColor(if A4BL9sslUP < A4BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#lA5BL9
def A5BL9smaHigh = simpleMovingAvg(H5, Len2);
def A5BL9smaLow = simpleMovingAvg(L5, Len2);
def A5BL9Hlv = if C5 > A5BL9smaHigh then 1 else if C5 < A5BL9smaLow then -1 else A5BL9Hlv[1];
def A5BL9sslDown = if A5BL9Hlv < 0 then A5BL9smaHigh else A5BL9smaLow;
def A5BL9sslUp = if A5BL9Hlv < 0 then A5BL9smaLow else A5BL9smaHigh;
plot A5BL9_Dot = if IsNaN(c5) then Double.NaN else 11;
A5BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A5BL9_Dot.SetLineWeight(DotSize);
A5BL9_Dot.AssignValueColor(if A5BL9sslUP < A5BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL9
def A6BL9smaHigh = simpleMovingAvg(H6, Len2);
def A6BL9smaLow = simpleMovingAvg(L6, Len2);
def A6BL9Hlv = if C6 > A6BL9smaHigh then 1 else if C6 < A6BL9smaLow then -1 else A6BL9Hlv[1];
def A6BL9sslDown = if A6BL9Hlv < 0 then A6BL9smaHigh else A6BL9smaLow;
def A6BL9sslUp = if A6BL9Hlv < 0 then A6BL9smaLow else A6BL9smaHigh;
plot A6BL9_Dot = if IsNaN(c6) then Double.NaN else 12;
A6BL9_Dot.SetPaintingStrategy(PaintingStrategy.Points);
A6BL9_Dot.SetLineWeight(DotSize);
A6BL9_Dot.AssignValueColor(if A6BL9sslUP < A6BL9sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL12
def A1BL12smaHigh = simpleMovingAvg(H, Len3);
def A1BL12smaLow = simpleMovingAvg(L, Len3);
def A1BL12Hlv = if C > A1BL12smaHigh then 1 else if C< A1BL12smaLow then -1 else A1BL12Hlv[1];
def A1BL12sslDown = if A1BL12Hlv< 0 then A1BL12smaHigh else A1BL12smaLow;
def A1BL12sslUp = if A1BL12Hlv< 0 then A1BL12smaLow else A1BL12smaHigh;
plot A1BL12_Dot = if IsNaN(c) then Double.NaN else 13;
A1BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1BL12_Dot.SetLineWeight(DotSize);
A1BL12_Dot.AssignValueColor(if A1BL12sslUP < A1BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
#A2BL12
def A2BL12smaHigh = simpleMovingAvg(H2, Len3);
def A2BL12smaLow = simpleMovingAvg(L2, len3);
def A2BL12Hlv = if C2 > A2BL12smaHigh then 1 else if C2< A2BL12smaLow then -1 else A2BL12Hlv[1];
def A2BL12sslDown = if A2BL12Hlv< 0 then A2BL12smaHigh else A2BL12smaLow;
def A2BL12sslUp = if A2BL12Hlv< 0 then A2BL12smaLow else A2BL12smaHigh;
plot A2BL12_Dot = if IsNaN(c2) then Double.NaN else 14;
A2BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2BL12_Dot.SetLineWeight(DotSize);
A2BL12_Dot.AssignValueColor(if A2BL12sslUP < A2BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL12
def A3BL12smaHigh = simpleMovingAvg(H3, Len3);
def A3BL12smaLow = simpleMovingAvg(L3, Len3);
def A3BL12Hlv = if C3 > A3BL12smaHigh then 1 else if C3 < A3BL12smaLow then -1 else A3BL12Hlv[1];
def A3BL12sslDown = if A3BL12Hlv < 0 then A3BL12smaHigh else A3BL12smaLow;
def A3BL12sslUp = if A3BL12Hlv < 0 then A3BL12smaLow else A3BL12smaHigh;
plot A3BL12_Dot = if IsNaN(c3) then Double.NaN else 15;
A3BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3BL12_Dot.SetLineWeight(DotSize);
A3BL12_Dot.AssignValueColor(if A3BL12sslUP < A3BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL12
def A4BL12smaHigh = simpleMovingAvg(H4, Len3);
def A4BL12smaLow = simpleMovingAvg(L4, Len3);
def A4BL12Hlv = if C4 > A4BL12smaHigh then 1 else if C4 < A4BL12smaLow then -1 else A4BL12Hlv[1];
def A4BL12sslDown = if A4BL12Hlv < 0 then A4BL12smaHigh else A4BL12smaLow;
def A4BL12sslUp = if A4BL12Hlv < 0 then A4BL12smaLow else A4BL12smaHigh;
plot A4BL12_Dot = if IsNaN(c4) then Double.NaN else 16;
A4BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4BL12_Dot.SetLineWeight(DotSize);
A4BL12_Dot.AssignValueColor(if A4BL12sslUP < A4BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL12
def A5BL12smaHigh = simpleMovingAvg(H5, Len3);
def A5BL12smaLow = simpleMovingAvg(L5, Len3);
def A5BL12Hlv = if C5 > A5BL12smaHigh then 1 else if C5 < A5BL12smaLow then -1 else A5BL12Hlv[1];
def A5BL12sslDown = if A5BL12Hlv < 0 then A5BL12smaHigh else A5BL12smaLow;
def A5BL12sslUp = if A5BL12Hlv < 0 then A5BL12smaLow else A5BL12smaHigh;
plot A5BL12_Dot = if IsNaN(c5) then Double.NaN else 17;
A5BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5BL12_Dot.SetLineWeight(DotSize);
A5BL12_Dot.AssignValueColor(if A5BL12sslUP < A5BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL12
def A6BL12smaHigh = simpleMovingAvg(H6, Len3);
def A6BL12smaLow = simpleMovingAvg(L6, Len3);
def A6BL12Hlv = if C6 > A6BL12smaHigh then 1 else if C6 < A6BL12smaLow then -1 else A6BL12Hlv[1];
def A6BL12sslDown = if A6BL12Hlv < 0 then A6BL12smaHigh else A6BL12smaLow;
def A6BL12sslUp = if A6BL12Hlv < 0 then A6BL12smaLow else A6BL12smaHigh;
plot A6BL12_Dot = if IsNaN(c6) then Double.NaN else 18;
A6BL12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6BL12_Dot.SetLineWeight(DotSize);
A6BL12_Dot.AssignValueColor(if A6BL12sslUP < A6BL12sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL15
def A1BL15smaHigh = simpleMovingAvg(H, Len4);
def A1BL15smaLow = simpleMovingAvg(L, Len4);
def A1BL15Hlv = if C > A1BL15smaHigh then 1 else if C< A1BL15smaLow then -1 else A1BL15Hlv[1];
def A1BL15sslDown = if A1BL15Hlv< 0 then A1BL15smaHigh else A1BL15smaLow;
def A1BL15sslUp = if A1BL15Hlv< 0 then A1BL15smaLow else A1BL15smaHigh;
plot A1BL15_Dot = if IsNaN(c) then Double.NaN else 19;
A1BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A1BL15_Dot.SetLineWeight(DotSize);
A1BL15_Dot.AssignValueColor(if A1BL15sslUP < A1BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
# A2BL15
def A2BL15smaHigh = simpleMovingAvg(H2, Len4);
def A2BL15smaLow = simpleMovingAvg(L2, Len4);
def A2BL15Hlv = if C2 > A2BL15smaHigh then 1 else if C2< A2BL15smaLow then -1 else A2BL15Hlv[1];
def A2BL15sslDown = if A2BL15Hlv< 0 then A2BL15smaHigh else A2BL15smaLow;
def A2BL15sslUp = if A2BL15Hlv< 0 then A2BL15smaLow else A2BL15smaHigh;
plot A2BL15_Dot = if IsNaN(c2) then Double.NaN else 20;
A2BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A2BL15_Dot.SetLineWeight(DotSize);
A2BL15_Dot.AssignValueColor(if A2BL15sslUP < A2BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL15
def A3BL15smaHigh = simpleMovingAvg(H3, Len4);
def A3BL15smaLow = simpleMovingAvg(L3, Len4);
def A3BL15Hlv = if C3 > A3BL15smaHigh then 1 else if C3 < A3BL15smaLow then -1 else A3BL15Hlv[1];
def A3BL15sslDown = if A3BL15Hlv < 0 then A3BL15smaHigh else A3BL15smaLow;
def A3BL15sslUp = if A3BL15Hlv < 0 then A3BL15smaLow else A3BL15smaHigh;
plot A3BL15_Dot = if IsNaN(c3) then Double.NaN else 21;
A3BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A3BL15_Dot.SetLineWeight(DotSize);
A3BL15_Dot.AssignValueColor(if A3BL15sslUP < A3BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL15
def A4BL15smaHigh = simpleMovingAvg(H4, 15);
def A4BL15smaLow = simpleMovingAvg(L4, 15);
def A4BL15Hlv = if C4 > A4BL15smaHigh then 1 else if C4 < A4BL15smaLow then -1 else A4BL15Hlv[1];
def A4BL15sslDown = if A4BL15Hlv < 0 then A4BL15smaHigh else A4BL15smaLow;
def A4BL15sslUp = if A4BL15Hlv < 0 then A4BL15smaLow else A4BL15smaHigh;
plot A4BL15_Dot = if IsNaN(c4) then Double.NaN else 22;
A4BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A4BL15_Dot.SetLineWeight(DotSize);
A4BL15_Dot.AssignValueColor(if A4BL15sslUP < A4BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL15
def A5BL15smaHigh = simpleMovingAvg(H5, 15);
def A5BL15smaLow = simpleMovingAvg(L5, 15);
def A5BL15Hlv = if C5 > A5BL15smaHigh then 1 else if C5 < A5BL15smaLow then -1 else A5BL15Hlv[1];
def A5BL15sslDown = if A5BL15Hlv < 0 then A5BL15smaHigh else A5BL15smaLow;
def A5BL15sslUp = if A5BL15Hlv < 0 then A5BL15smaLow else A5BL15smaHigh;
plot A5BL15_Dot = if IsNaN(c5) then Double.NaN else 23;
A5BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A5BL15_Dot.SetLineWeight(DotSize);
A5BL15_Dot.AssignValueColor(if A5BL15sslUP < A5BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL15
def A6BL15smaHigh = simpleMovingAvg(H6, Len4);
def A6BL15smaLow = simpleMovingAvg(L6, Len4);
def A6BL15Hlv = if C6 > A6BL15smaHigh then 1 else if C6 < A6BL15smaLow then -1 else A6BL15Hlv[1];
def A6BL15sslDown = if A6BL15Hlv < 0 then A6BL15smaHigh else A6BL15smaLow;
def A6BL15sslUp = if A6BL15Hlv < 0 then A6BL15smaLow else A6BL15smaHigh;
plot A6BL15_Dot = if IsNaN(c6) then Double.NaN else 24;
A6BL15_Dot.SetPaintingStrategy(PaintingStrategy.points);
A6BL15_Dot.SetLineWeight(DotSize);
A6BL15_Dot.AssignValueColor(if A6BL15sslUP < A6BL15sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));

#Aggregation 1
#A1BL18
def A1BL18smaHigh = simpleMovingAvg(H, Len5);
def A1BL18smaLow = simpleMovingAvg(L, Len5);
def A1BL18Hlv = if C > A1BL18smaHigh then 1 else if C< A1BL18smaLow then -1 else A1BL18Hlv[1];
def A1BL18sslDown = if A1BL18Hlv< 0 then A1BL18smaHigh else A1BL18smaLow;
def A1BL18sslUp = if A1BL18Hlv< 0 then A1BL18smaLow else A1BL18smaHigh;
plot A1BL18_Dot = if IsNaN(c) then Double.NaN else 25;
A1BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1BL18_Dot.SetLineWeight(DotSize);
A1BL18_Dot.AssignValueColor(if A1BL18sslUP < A1BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 2
#A2BL18
def A2BL18smaHigh = simpleMovingAvg(H2, Len5);
def A2BL18smaLow = simpleMovingAvg(L2, Len5);
def A2BL18Hlv = if C2 > A2BL18smaHigh then 1 else if C2< A2BL18smaLow then -1 else A2BL18Hlv[1];
def A2BL18sslDown = if A2BL18Hlv< 0 then A2BL18smaHigh else A2BL18smaLow;
def A2BL18sslUp = if A2BL18Hlv< 0 then A2BL18smaLow else A2BL18smaHigh;
plot A2BL18_Dot = if IsNaN(c2) then Double.NaN else 26;
A2BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2BL18_Dot.SetLineWeight(DotSize);
A2BL18_Dot.AssignValueColor(if A2BL18sslUP < A2BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 3
#A3BL18
def A3BL18smaHigh = simpleMovingAvg(H3, 18);
def A3BL18smaLow = simpleMovingAvg(L3, 18);
def A3BL18Hlv = if C3 > A3BL18smaHigh then 1 else if C3 < A3BL18smaLow then -1 else A3BL18Hlv[1];
def A3BL18sslDown = if A3BL18Hlv < 0 then A3BL18smaHigh else A3BL18smaLow;
def A3BL18sslUp = if A3BL18Hlv < 0 then A3BL18smaLow else A3BL18smaHigh;
plot A3BL18_Dot = if IsNaN(c3) then Double.NaN else 27;
A3BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3BL18_Dot.SetLineWeight(DotSize);
A3BL18_Dot.AssignValueColor(if A3BL18sslUP < A3BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 4
#A4BL18
def A4BL18smaHigh = simpleMovingAvg(H4, Len5);
def A4BL18smaLow = simpleMovingAvg(L4, Len5);
def A4BL18Hlv = if C4 > A4BL18smaHigh then 1 else if C4 < A4BL18smaLow then -1 else A4BL18Hlv[1];
def A4BL18sslDown = if A4BL18Hlv < 0 then A4BL18smaHigh else A4BL18smaLow;
def A4BL18sslUp = if A4BL18Hlv < 0 then A4BL18smaLow else A4BL18smaHigh;
plot A4BL18_Dot = if IsNaN(c4) then Double.NaN else 28;
A4BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4BL18_Dot.SetLineWeight(DotSize);
A4BL18_Dot.AssignValueColor(if A4BL18sslUP < A4BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 5
#A5BL18
def A5BL18smaHigh = simpleMovingAvg(H5, Len5);
def A5BL18smaLow = simpleMovingAvg(L5, Len5);
def A5BL18Hlv = if C5 > A5BL18smaHigh then 1 else if C5 < A5BL18smaLow then -1 else A5BL18Hlv[1];
def A5BL18sslDown = if A5BL18Hlv < 0 then A5BL18smaHigh else A5BL18smaLow;
def A5BL18sslUp = if A5BL18Hlv < 0 then A5BL18smaLow else A5BL18smaHigh;
plot A5BL18_Dot = if IsNaN(c5) then Double.NaN else 29;
A5BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5BL18_Dot.SetLineWeight(DotSize);
A5BL18_Dot.AssignValueColor(if A5BL18sslUP < A5BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
#Aggregation 6
#A6BL18
def A6BL18smaHigh = simpleMovingAvg(H6, Len5);
def A6BL18smaLow = simpleMovingAvg(L6, Len5);
def A6BL18Hlv = if C6 > A6BL18smaHigh then 1 else if C6 < A6BL18smaLow then -1 else A6BL18Hlv[1];
def A6BL18sslDown = if A6BL18Hlv < 0 then A6BL18smaHigh else A6BL18smaLow;
def A6BL18sslUp = if A6BL18Hlv < 0 then A6BL18smaLow else A6BL18smaHigh;
plot A6BL18_Dot = if IsNaN(c6) then Double.NaN else 30;
A6BL18_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6BL18_Dot.SetLineWeight(DotSize);
A6BL18_Dot.AssignValueColor(if A6BL18sslUP < A6BL18sslDown then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
 
Can someone add a cloud to this indicator between the cyan and purple line the uptrend be green inside the lines and red when crossover between the lines. That will help visualize thinks for me a lot better. Thank you so much in advance.
 
@stocksniper
a1.png

Ruby:
# Blue Magik SSL
# I assume this is based on the popular SSL indicator
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/i85H2tZ8-blue-magik/

input period = 10;
input len = 10;

def smaHigh = simpleMovingAvg(high, len);
def smaLow = simpleMovingAvg(low, len);
def Hlv = if close > smaHigh then 1 else if close<smaLow then -1 else Hlv[1];

def sslDown = if Hlv< 0 then smaHigh else smaLow;
def sslUp = if Hlv< 0 then smaLow else smaHigh;

plot up = sslUp;
plot down = sslDown;

up.SetDefaultColor(GetColor(1));
down.SetDefaultColor(GetColor(0));

addcloud(up, down, color.green, color.red);
 
The Blue Magik SSL indicator using a 2 pole butterworth Filter in a binary format with 12 different lengths
Code:
declare Lower;
input period1 = 3;
input period2 = 5;
input period3 = 8;
input period4 = 10;
input period5 = 12;
input period6 = 15;
input period7 = 30;
input period8 = 35;
input period9 = 40;
input period10 = 45;
input period11 = 50;
input period12 = 60;
input paintbars = 0;
Input dotsize = 3;

def a12A = exp(-1.414 * 3.14159 / Period1);
def b12A = 2 * a12A * Cos(1.414 * 3.14159 / Period1);
def coef22A =b12A;
def coef32A = -a12A * a12A;
def coef12A = (1 – b12A + a12A * a12A) / 4;
rec ButterH = if barNumber() < 3 then High else coef12A * (High + 2 * High[1] + High[2]) + coef22A * ButterH[1] + coef32A * ButterH[2];
rec ButterL = if barNumber() < 3 then Low else coef12A * (Low + 2 * Low[1] + Low[2]) + coef22A * ButterL[1] + coef32A * ButterL[2];
def Hlv = if close > ButterH then 1 else if close<ButterL then -1 else Hlv[1];
def sslDown = if Hlv< 0 then ButterH else ButterL;
def sslUp = if Hlv< 0 then ButterL else ButterH;

def a12B = exp(-1.414 * 3.14159 / Period2);
def b12B = 2 * a12B * Cos(1.414 * 3.14159 / Period2);
def coef22B =b12B;
def coef32B = -a12B* a12B;
def coef12B = (1 – b12B + a12B * a12B) / 4;
rec ButterHB = if barNumber() < 3 then High else coef12B * (High + 2 * High[1] + High[2]) + coef22B * ButterHB[1] + coef32B * ButterHB[2];
rec ButterLB = if barNumber() < 3 then Low else coef12B * (Low + 2 * Low[1] + Low[2]) + coef22B * ButterLB[1] + coef32B * ButterLB[2];
def HlvB = if close > ButterHB then 1 else if close<ButterLB then -1 else HlvB[1];
def sslDownB = if HlvB< 0 then ButterHB else ButterLB;
def sslUpB = if HlvB< 0 then ButterLB else ButterHB;

def a12C = exp(-1.414 * 3.14159 / Period3);
def b12C = 2 * a12C * Cos(1.414 * 3.14159 / Period3);
def coef22C =b12C;
def coef32C = -a12C * a12C;
def coef12C = (1 – b12C + a12C * a12C) / 4;
rec ButterHC = if barNumber() < 3 then High else coef12C * (High + 2 * High[1] + High[2]) + coef22C * ButterHC[1] + coef32C * ButterHC[2];
rec ButterLC = if barNumber() < 3 then Low else coef12C * (Low + 2 * Low[1] + Low[2]) + coef22C * ButterLC[1] + coef32C * ButterLC[2];
def HlvC = if close > ButterHC then 1 else if close<ButterLC then -1 else HlvC[1];
def sslDownC = if HlvC< 0 then ButterHC else ButterLC;
def sslUpC = if HlvC< 0 then ButterLC else ButterHC;

def a12D = exp(-1.414 * 3.14159 / Period4);
def b12D = 2 * a12D* Cos(1.414 * 3.14159 / Period4);
def coef22D =b12D;
def coef32D = -a12D * a12D;
def coef12D = (1 – b12D + a12D * a12D) / 4;
rec ButterHD = if barNumber() < 3 then High else coef12D* (High + 2 * High[1] + High[2]) + coef22D * ButterHD[1] + coef32D * ButterHD[2];
rec ButterLD = if barNumber() < 3 then Low else coef12D * (Low + 2 * Low[1] + Low[2]) + coef22D * ButterLD[1] + coef32D * ButterLD[2];
def HlvD = if close > ButterHD then 1 else if close<ButterLD then -1 else HlvD[1];
def sslDownD= if HlvD< 0 then ButterHD else ButterLD;
def sslUpD = if HlvD< 0 then ButterLD else ButterHD;

def a12E = exp(-1.414 * 3.14159 / Period5);
def b12E = 2 * a12E * Cos(1.414 * 3.14159 / Period5);
def coef22E =b12E;
def coef32E = -a12E * a12E;
def coef12E = (1 – b12E + a12E * a12E) / 4;
rec ButterHE = if barNumber() < 3 then High else coef12E * (High + 2 * High[1] + High[2]) + coef22E * ButterHE[1] + coef32E * ButterHE[2];
rec ButterLE= if barNumber() < 3 then Low else coef12E * (Low + 2 * Low[1] + Low[2]) + coef22E * ButterLE[1] + coef32E * ButterLE[2];
def HlvE = if close > ButterHE then 1 else if close<ButterLE then -1 else HlvE[1];
def sslDownE = if HlvE< 0 then ButterHE else ButterLE;
def sslUpE = if HlvE< 0 then ButterLE else ButterHE;

def a12F = exp(-1.414 * 3.14159 / Period6);
def b12F = 2 * a12F * Cos(1.414 * 3.14159 / Period6);
def coef22F =b12F;
def coef32F= -a12F * a12F;
def coef12F= (1 – b12F + a12F * a12F) / 4;
rec ButterHF = if barNumber() < 3 then High else coef12F * (High + 2 * High[1] + High[2]) + coef22F* ButterHF[1] + coef32F* ButterHF[2];
rec ButterLF = if barNumber() < 3 then Low else coef12F * (Low + 2 * Low[1] + Low[2]) + coef22F* ButterLF[1] + coef32F * ButterLF[2];
def HlvF = if close > ButterHF then 1 else if close<ButterLF then -1 else HlvF[1];
def sslDownF = if HlvF< 0 then ButterHF else ButterLF;
def sslUpF = if HlvF< 0 then ButterLF else ButterHF;

def a12G = exp(-1.414 * 3.14159 / Period7);
def b12G = 2 * a12G * Cos(1.414 * 3.14159 / Period7);
def coef22G =b12G;
def coef32G = -a12G * a12G;
def coef12G = (1 – b12G + a12G * a12G) / 4;
rec ButterHG = if barNumber() < 3 then High else coef12G * (High + 2 * High[1] + High[2]) + coef22G* ButterHG[1] + coef32G * ButterHG[2];
rec ButterLG = if barNumber() < 3 then Low else coef12G * (Low + 2 * Low[1] + Low[2]) + coef22G * ButterLG[1] + coef32G * ButterLG[2];
def HlvG = if close > ButterHG then 1 else if close<ButterLG then -1 else HlvG[1];
def sslDownG = if HlvG < 0 then ButterHG else ButterLG;
def sslUpG = if HlvG < 0 then ButterLG else ButterHG;

def a12H = exp(-1.414 * 3.14159 / Period8);
def b12H = 2 * a12H * Cos(1.414 * 3.14159 / Period8);
def coef22H =b12H;
def coef32H = -a12H * a12H;
def coef12H = (1 – b12H + a12H * a12H) / 4;
rec ButterHH = if barNumber() < 3 then High else coef12H * (High + 2 * High[1] + High[2]) + coef22H * ButterHH[1] + coef32H * ButterHH[2];
rec ButterLH = if barNumber() < 3 then Low else coef12H * (Low + 2 * Low[1] + Low[2]) + coef22H * ButterLH[1] + coef32H * ButterLH[2];
def HlvH = if close > ButterHH then 1 else if close<ButterLH then -1 else HlvH[1];
def sslDownH = if HlvH< 0 then ButterHH else ButterLH;
def sslUpH = if HlvH< 0 then ButterLH else ButterHH;

def a12I = exp(-1.414 * 3.14159 / Period9);
def b12I = 2 * a12I * Cos(1.414 * 3.14159 / Period9);
def coef22I =b12I;
def coef32I = -a12I * a12I;
def coef12I = (1 – b12I + a12I * a12I) / 4;
rec ButterHI = if barNumber() < 3 then High else coef12I * (High + 2 * High[1] + High[2]) + coef22I* ButterHI[1] + coef32I * ButterHI[2];
rec ButterLI = if barNumber() < 3 then Low else coef12I * (Low + 2 * Low[1] + Low[2]) + coef22I * ButterLI[1] + coef32I * ButterLI[2];
def HlvI = if close > ButterHI then 1 else if close<ButterLI then -1 else HlvI[1];
def sslDownI = if HlvI< 0 then ButterHI else ButterLI;
def sslUpI = if HlvI< 0 then ButterLI else ButterHI;

def a12J = exp(-1.414 * 3.14159 / Period10);
def b12J = 2 * a12J * Cos(1.414 * 3.14159 / Period10);
def coef22J =b12J;
def coef32J = -a12J * a12J;
def coef12J = (1 – b12J + a12J * a12J) / 4;
rec ButterHJ = if barNumber() < 3 then High else coef12J * (High + 2 * High[1] + High[2]) + coef22J * ButterHJ[1] + coef32J * ButterHJ[2];
rec ButterLJ = if barNumber() < 3 then Low else coef12J * (Low + 2 * Low[1] + Low[2]) + coef22J* ButterLJ[1] + coef32J * ButterLJ[2];
def HlvJ = if close > ButterHJ then 1 else if close<ButterLJ then -1 else HlvJ[1];
def sslDownJ = if HlvJ< 0 then ButterHJ else ButterLJ;
def sslUpJ = if HlvJ < 0 then ButterLJ else ButterHJ;

def a12k = exp(-1.414 * 3.14159 / Period11);
def b12k = 2 * a12k * Cos(1.414 * 3.14159 / Period11);
def coef22k =b12k;
def coef32k = -a12k * a12k;
def coef12k = (1 – b12k + a12k * a12k) / 4;
rec ButterHk = if barNumber() < 3 then High else coef12k * (High + 2 * High[1] + High[2]) + coef22k * ButterHk[1] + coef32k * ButterHk[2];
rec ButterLk = if barNumber() < 3 then Low else coef12k* (Low + 2 * Low[1] + Low[2]) + coef22k * ButterLk[1] + coef32k * ButterLk[2];
def Hlvk = if close > ButterHk then 1 else if close<ButterLk then -1 else Hlvk[1];
def sslDownk = if Hlvk< 0 then ButterHk else ButterLk;
def sslUpk = if Hlvk< 0 then ButterLk else ButterHk;

def a12L = exp(-1.414 * 3.14159 / Period12);
def b12L = 2 * a12L * Cos(1.414 * 3.14159 / Period12);
def coef22L =b12L;
def coef32L = -a12L * a12L;
def coef12L = (1 – b12L + a12L * a12L) / 4;
rec ButterHL = if barNumber() < 3 then High else coef12L * (High + 2 * High[1] + High[2]) + coef22L * ButterHL[1] + coef32L * ButterHL[2];
rec ButterLL = if barNumber() < 3 then Low else coef12L * (Low + 2 * Low[1] + Low[2]) + coef22L * ButterLL[1] + coef32L * ButterLL[2];
def HlvL = if close > ButterHL then 1 else if close<ButterLL then -1 else HlvL[1];
def sslDownL = if HlvL< 0 then ButterHL else ButterLL;
def sslUpL = if HlvL< 0 then ButterLL else ButterHL;

plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if SSLup >SSLDown then Color.Cyan else Color.Magenta);
plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if SSLupB >SSLDownB then Color.Cyan else Color.Magenta);
plot A3_Dot = if IsNaN(Close) then Double.NaN else 3;
A3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3_Dot.SetLineWeight(DotSize);
A3_Dot.AssignValueColor(if SSLupC >SSLDownC then Color.Cyan else Color.Magenta);
plot A4_Dot = if IsNaN(Close) then Double.NaN else 4;
A4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4_Dot.SetLineWeight(DotSize);
A4_Dot.AssignValueColor(if SSLupD >SSLDownD then Color.Cyan else Color.Magenta);
plot A5_Dot = if IsNaN(Close) then Double.NaN else 5;
A5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5_Dot.SetLineWeight(DotSize);
A5_Dot.AssignValueColor(if SSLupE >SSLDownE then Color.Cyan else Color.Magenta);
plot A6_Dot = if IsNaN(Close) then Double.NaN else 6;
A6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6_Dot.SetLineWeight(DotSize);
A6_Dot.AssignValueColor(if SSLupF >SSLDownF then Color.Cyan else Color.Magenta);
plot A7_Dot = if IsNaN(Close) then Double.NaN else 7;
A7_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A7_Dot.SetLineWeight(DotSize);
A7_Dot.AssignValueColor(if SSLupG >SSLDownG then Color.blue else Color.red);
plot A8_Dot = if IsNaN(Close) then Double.NaN else 8;
A8_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A8_Dot.SetLineWeight(DotSize);
A8_Dot.AssignValueColor(if SSLupH >SSLDownH then Color.blue else Color.red);
plot A9_Dot = if IsNaN(Close) then Double.NaN else 9;
A9_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A9_Dot.SetLineWeight(DotSize);
A9_Dot.AssignValueColor(if SSLupI >SSLDownI then Color.blue else Color.red);
plot A10_Dot = if IsNaN(Close) then Double.NaN else 10;
A10_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A10_Dot.SetLineWeight(DotSize);
A10_Dot.AssignValueColor(if SSLupJ >SSLDownJ then Color.blue else Color.red);
plot A11_Dot = if IsNaN(Close) then Double.NaN else 11;
A11_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A11_Dot.SetLineWeight(DotSize);
A11_Dot.AssignValueColor(if SSLupK >SSLDownK then Color.BLUE else Color.RED);
plot A12_Dot = if IsNaN(Close) then Double.NaN else 12;
A12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A12_Dot.SetLineWeight(DotSize);
A12_Dot.AssignValueColor(if SSLupL >SSLDownL then Color.BLUE else Color.RED);

AssignPriceColor(if paintbars == 1 and SSLup > SSLDown then Color.Cyan else if paintbars == 1 and SSLUp < SSLDown then Color.Magenta else if paintbars == 2 and SSLUPB > SSLDownB then Color.Cyan else if paintbars == 2 and SSLUpB < SSLDownB then Color.Magenta else if paintbars == 3 and SSLUpC > SSlDownC then Color.Cyan else if paintbars == 3 and sslUpC < SSLDownC then Color.Magenta else if paintbars == 4 and SSLupD > SSLDownD then Color.Cyan else if paintbars == 4 and SSLUpD < SSLDownD then Color.Magenta else if paintbars == 5 and SSLUPE > SSLDownE then Color.Cyan else if paintbars == 5 and SSLUpE < SSLDownE then Color.Magenta else if paintbars == 6 and SSLUpF > SSlDownF then Color.Cyan else if paintbars == 6 and sslUpF < SSLDownF then Color.Magenta else if paintbars == 7 and SSLupG > SSLDownG then Color.BLUE else if paintbars == 7 and SSLUpG < SSLDownG then Color.RED else if paintbars == 8 and SSLUPH > SSLDownH then Color.BLUE else if paintbars == 8 and SSLUpH < SSLDownH then Color.RED else if paintbars == 9 and SSLUpI > SSlDownI then Color.BLUE else if paintbars == 9 and sslUpI < SSLDownI then Color.RED else if paintbars == 10 and SSLupJ > SSLDownJ then Color.BLUE else if paintbars == 10 and SSLUpJ < SSLDownJ then Color.RED else if paintbars == 11 and SSLUPK > SSLDownK then Color.BLUE else if paintbars == 11 and SSLUpK < SSLDOWNK THEN Color.RED else if paintbars == 12 and SSLUpL > SSlDownL then Color.BLUE else if paintbars == 12 and sslUpL < SSLDownL then Color.RED else Color.Current);

Cyan and magenta are shorter lengths, Blue and Red are the longer lengths. Set the paintbar input for whichever line you would like to trade and the bars will change to the corresponding color.
 
The Blue Magik SSL indicator using a 2 pole butterworth Filter in a binary format with 12 different lengths
Code:
declare Lower;
input period1 = 3;
input period2 = 5;
input period3 = 8;
input period4 = 10;
input period5 = 12;
input period6 = 15;
input period7 = 30;
input period8 = 35;
input period9 = 40;
input period10 = 45;
input period11 = 50;
input period12 = 60;
input paintbars = 0;
Input dotsize = 3;

def a12A = exp(-1.414 * 3.14159 / Period1);
def b12A = 2 * a12A * Cos(1.414 * 3.14159 / Period1);
def coef22A =b12A;
def coef32A = -a12A * a12A;
def coef12A = (1 – b12A + a12A * a12A) / 4;
rec ButterH = if barNumber() < 3 then High else coef12A * (High + 2 * High[1] + High[2]) + coef22A * ButterH[1] + coef32A * ButterH[2];
rec ButterL = if barNumber() < 3 then Low else coef12A * (Low + 2 * Low[1] + Low[2]) + coef22A * ButterL[1] + coef32A * ButterL[2];
def Hlv = if close > ButterH then 1 else if close<ButterL then -1 else Hlv[1];
def sslDown = if Hlv< 0 then ButterH else ButterL;
def sslUp = if Hlv< 0 then ButterL else ButterH;

def a12B = exp(-1.414 * 3.14159 / Period2);
def b12B = 2 * a12B * Cos(1.414 * 3.14159 / Period2);
def coef22B =b12B;
def coef32B = -a12B* a12B;
def coef12B = (1 – b12B + a12B * a12B) / 4;
rec ButterHB = if barNumber() < 3 then High else coef12B * (High + 2 * High[1] + High[2]) + coef22B * ButterHB[1] + coef32B * ButterHB[2];
rec ButterLB = if barNumber() < 3 then Low else coef12B * (Low + 2 * Low[1] + Low[2]) + coef22B * ButterLB[1] + coef32B * ButterLB[2];
def HlvB = if close > ButterHB then 1 else if close<ButterLB then -1 else HlvB[1];
def sslDownB = if HlvB< 0 then ButterHB else ButterLB;
def sslUpB = if HlvB< 0 then ButterLB else ButterHB;

def a12C = exp(-1.414 * 3.14159 / Period3);
def b12C = 2 * a12C * Cos(1.414 * 3.14159 / Period3);
def coef22C =b12C;
def coef32C = -a12C * a12C;
def coef12C = (1 – b12C + a12C * a12C) / 4;
rec ButterHC = if barNumber() < 3 then High else coef12C * (High + 2 * High[1] + High[2]) + coef22C * ButterHC[1] + coef32C * ButterHC[2];
rec ButterLC = if barNumber() < 3 then Low else coef12C * (Low + 2 * Low[1] + Low[2]) + coef22C * ButterLC[1] + coef32C * ButterLC[2];
def HlvC = if close > ButterHC then 1 else if close<ButterLC then -1 else HlvC[1];
def sslDownC = if HlvC< 0 then ButterHC else ButterLC;
def sslUpC = if HlvC< 0 then ButterLC else ButterHC;

def a12D = exp(-1.414 * 3.14159 / Period4);
def b12D = 2 * a12D* Cos(1.414 * 3.14159 / Period4);
def coef22D =b12D;
def coef32D = -a12D * a12D;
def coef12D = (1 – b12D + a12D * a12D) / 4;
rec ButterHD = if barNumber() < 3 then High else coef12D* (High + 2 * High[1] + High[2]) + coef22D * ButterHD[1] + coef32D * ButterHD[2];
rec ButterLD = if barNumber() < 3 then Low else coef12D * (Low + 2 * Low[1] + Low[2]) + coef22D * ButterLD[1] + coef32D * ButterLD[2];
def HlvD = if close > ButterHD then 1 else if close<ButterLD then -1 else HlvD[1];
def sslDownD= if HlvD< 0 then ButterHD else ButterLD;
def sslUpD = if HlvD< 0 then ButterLD else ButterHD;

def a12E = exp(-1.414 * 3.14159 / Period5);
def b12E = 2 * a12E * Cos(1.414 * 3.14159 / Period5);
def coef22E =b12E;
def coef32E = -a12E * a12E;
def coef12E = (1 – b12E + a12E * a12E) / 4;
rec ButterHE = if barNumber() < 3 then High else coef12E * (High + 2 * High[1] + High[2]) + coef22E * ButterHE[1] + coef32E * ButterHE[2];
rec ButterLE= if barNumber() < 3 then Low else coef12E * (Low + 2 * Low[1] + Low[2]) + coef22E * ButterLE[1] + coef32E * ButterLE[2];
def HlvE = if close > ButterHE then 1 else if close<ButterLE then -1 else HlvE[1];
def sslDownE = if HlvE< 0 then ButterHE else ButterLE;
def sslUpE = if HlvE< 0 then ButterLE else ButterHE;

def a12F = exp(-1.414 * 3.14159 / Period6);
def b12F = 2 * a12F * Cos(1.414 * 3.14159 / Period6);
def coef22F =b12F;
def coef32F= -a12F * a12F;
def coef12F= (1 – b12F + a12F * a12F) / 4;
rec ButterHF = if barNumber() < 3 then High else coef12F * (High + 2 * High[1] + High[2]) + coef22F* ButterHF[1] + coef32F* ButterHF[2];
rec ButterLF = if barNumber() < 3 then Low else coef12F * (Low + 2 * Low[1] + Low[2]) + coef22F* ButterLF[1] + coef32F * ButterLF[2];
def HlvF = if close > ButterHF then 1 else if close<ButterLF then -1 else HlvF[1];
def sslDownF = if HlvF< 0 then ButterHF else ButterLF;
def sslUpF = if HlvF< 0 then ButterLF else ButterHF;

def a12G = exp(-1.414 * 3.14159 / Period7);
def b12G = 2 * a12G * Cos(1.414 * 3.14159 / Period7);
def coef22G =b12G;
def coef32G = -a12G * a12G;
def coef12G = (1 – b12G + a12G * a12G) / 4;
rec ButterHG = if barNumber() < 3 then High else coef12G * (High + 2 * High[1] + High[2]) + coef22G* ButterHG[1] + coef32G * ButterHG[2];
rec ButterLG = if barNumber() < 3 then Low else coef12G * (Low + 2 * Low[1] + Low[2]) + coef22G * ButterLG[1] + coef32G * ButterLG[2];
def HlvG = if close > ButterHG then 1 else if close<ButterLG then -1 else HlvG[1];
def sslDownG = if HlvG < 0 then ButterHG else ButterLG;
def sslUpG = if HlvG < 0 then ButterLG else ButterHG;

def a12H = exp(-1.414 * 3.14159 / Period8);
def b12H = 2 * a12H * Cos(1.414 * 3.14159 / Period8);
def coef22H =b12H;
def coef32H = -a12H * a12H;
def coef12H = (1 – b12H + a12H * a12H) / 4;
rec ButterHH = if barNumber() < 3 then High else coef12H * (High + 2 * High[1] + High[2]) + coef22H * ButterHH[1] + coef32H * ButterHH[2];
rec ButterLH = if barNumber() < 3 then Low else coef12H * (Low + 2 * Low[1] + Low[2]) + coef22H * ButterLH[1] + coef32H * ButterLH[2];
def HlvH = if close > ButterHH then 1 else if close<ButterLH then -1 else HlvH[1];
def sslDownH = if HlvH< 0 then ButterHH else ButterLH;
def sslUpH = if HlvH< 0 then ButterLH else ButterHH;

def a12I = exp(-1.414 * 3.14159 / Period9);
def b12I = 2 * a12I * Cos(1.414 * 3.14159 / Period9);
def coef22I =b12I;
def coef32I = -a12I * a12I;
def coef12I = (1 – b12I + a12I * a12I) / 4;
rec ButterHI = if barNumber() < 3 then High else coef12I * (High + 2 * High[1] + High[2]) + coef22I* ButterHI[1] + coef32I * ButterHI[2];
rec ButterLI = if barNumber() < 3 then Low else coef12I * (Low + 2 * Low[1] + Low[2]) + coef22I * ButterLI[1] + coef32I * ButterLI[2];
def HlvI = if close > ButterHI then 1 else if close<ButterLI then -1 else HlvI[1];
def sslDownI = if HlvI< 0 then ButterHI else ButterLI;
def sslUpI = if HlvI< 0 then ButterLI else ButterHI;

def a12J = exp(-1.414 * 3.14159 / Period10);
def b12J = 2 * a12J * Cos(1.414 * 3.14159 / Period10);
def coef22J =b12J;
def coef32J = -a12J * a12J;
def coef12J = (1 – b12J + a12J * a12J) / 4;
rec ButterHJ = if barNumber() < 3 then High else coef12J * (High + 2 * High[1] + High[2]) + coef22J * ButterHJ[1] + coef32J * ButterHJ[2];
rec ButterLJ = if barNumber() < 3 then Low else coef12J * (Low + 2 * Low[1] + Low[2]) + coef22J* ButterLJ[1] + coef32J * ButterLJ[2];
def HlvJ = if close > ButterHJ then 1 else if close<ButterLJ then -1 else HlvJ[1];
def sslDownJ = if HlvJ< 0 then ButterHJ else ButterLJ;
def sslUpJ = if HlvJ < 0 then ButterLJ else ButterHJ;

def a12k = exp(-1.414 * 3.14159 / Period11);
def b12k = 2 * a12k * Cos(1.414 * 3.14159 / Period11);
def coef22k =b12k;
def coef32k = -a12k * a12k;
def coef12k = (1 – b12k + a12k * a12k) / 4;
rec ButterHk = if barNumber() < 3 then High else coef12k * (High + 2 * High[1] + High[2]) + coef22k * ButterHk[1] + coef32k * ButterHk[2];
rec ButterLk = if barNumber() < 3 then Low else coef12k* (Low + 2 * Low[1] + Low[2]) + coef22k * ButterLk[1] + coef32k * ButterLk[2];
def Hlvk = if close > ButterHk then 1 else if close<ButterLk then -1 else Hlvk[1];
def sslDownk = if Hlvk< 0 then ButterHk else ButterLk;
def sslUpk = if Hlvk< 0 then ButterLk else ButterHk;

def a12L = exp(-1.414 * 3.14159 / Period12);
def b12L = 2 * a12L * Cos(1.414 * 3.14159 / Period12);
def coef22L =b12L;
def coef32L = -a12L * a12L;
def coef12L = (1 – b12L + a12L * a12L) / 4;
rec ButterHL = if barNumber() < 3 then High else coef12L * (High + 2 * High[1] + High[2]) + coef22L * ButterHL[1] + coef32L * ButterHL[2];
rec ButterLL = if barNumber() < 3 then Low else coef12L * (Low + 2 * Low[1] + Low[2]) + coef22L * ButterLL[1] + coef32L * ButterLL[2];
def HlvL = if close > ButterHL then 1 else if close<ButterLL then -1 else HlvL[1];
def sslDownL = if HlvL< 0 then ButterHL else ButterLL;
def sslUpL = if HlvL< 0 then ButterLL else ButterHL;

plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if SSLup >SSLDown then Color.Cyan else Color.Magenta);
plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if SSLupB >SSLDownB then Color.Cyan else Color.Magenta);
plot A3_Dot = if IsNaN(Close) then Double.NaN else 3;
A3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3_Dot.SetLineWeight(DotSize);
A3_Dot.AssignValueColor(if SSLupC >SSLDownC then Color.Cyan else Color.Magenta);
plot A4_Dot = if IsNaN(Close) then Double.NaN else 4;
A4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4_Dot.SetLineWeight(DotSize);
A4_Dot.AssignValueColor(if SSLupD >SSLDownD then Color.Cyan else Color.Magenta);
plot A5_Dot = if IsNaN(Close) then Double.NaN else 5;
A5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5_Dot.SetLineWeight(DotSize);
A5_Dot.AssignValueColor(if SSLupE >SSLDownE then Color.Cyan else Color.Magenta);
plot A6_Dot = if IsNaN(Close) then Double.NaN else 6;
A6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A6_Dot.SetLineWeight(DotSize);
A6_Dot.AssignValueColor(if SSLupF >SSLDownF then Color.Cyan else Color.Magenta);
plot A7_Dot = if IsNaN(Close) then Double.NaN else 7;
A7_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A7_Dot.SetLineWeight(DotSize);
A7_Dot.AssignValueColor(if SSLupG >SSLDownG then Color.blue else Color.red);
plot A8_Dot = if IsNaN(Close) then Double.NaN else 8;
A8_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A8_Dot.SetLineWeight(DotSize);
A8_Dot.AssignValueColor(if SSLupH >SSLDownH then Color.blue else Color.red);
plot A9_Dot = if IsNaN(Close) then Double.NaN else 9;
A9_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A9_Dot.SetLineWeight(DotSize);
A9_Dot.AssignValueColor(if SSLupI >SSLDownI then Color.blue else Color.red);
plot A10_Dot = if IsNaN(Close) then Double.NaN else 10;
A10_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A10_Dot.SetLineWeight(DotSize);
A10_Dot.AssignValueColor(if SSLupJ >SSLDownJ then Color.blue else Color.red);
plot A11_Dot = if IsNaN(Close) then Double.NaN else 11;
A11_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A11_Dot.SetLineWeight(DotSize);
A11_Dot.AssignValueColor(if SSLupK >SSLDownK then Color.BLUE else Color.RED);
plot A12_Dot = if IsNaN(Close) then Double.NaN else 12;
A12_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A12_Dot.SetLineWeight(DotSize);
A12_Dot.AssignValueColor(if SSLupL >SSLDownL then Color.BLUE else Color.RED);

AssignPriceColor(if paintbars == 1 and SSLup > SSLDown then Color.Cyan else if paintbars == 1 and SSLUp < SSLDown then Color.Magenta else if paintbars == 2 and SSLUPB > SSLDownB then Color.Cyan else if paintbars == 2 and SSLUpB < SSLDownB then Color.Magenta else if paintbars == 3 and SSLUpC > SSlDownC then Color.Cyan else if paintbars == 3 and sslUpC < SSLDownC then Color.Magenta else if paintbars == 4 and SSLupD > SSLDownD then Color.Cyan else if paintbars == 4 and SSLUpD < SSLDownD then Color.Magenta else if paintbars == 5 and SSLUPE > SSLDownE then Color.Cyan else if paintbars == 5 and SSLUpE < SSLDownE then Color.Magenta else if paintbars == 6 and SSLUpF > SSlDownF then Color.Cyan else if paintbars == 6 and sslUpF < SSLDownF then Color.Magenta else if paintbars == 7 and SSLupG > SSLDownG then Color.BLUE else if paintbars == 7 and SSLUpG < SSLDownG then Color.RED else if paintbars == 8 and SSLUPH > SSLDownH then Color.BLUE else if paintbars == 8 and SSLUpH < SSLDownH then Color.RED else if paintbars == 9 and SSLUpI > SSlDownI then Color.BLUE else if paintbars == 9 and sslUpI < SSLDownI then Color.RED else if paintbars == 10 and SSLupJ > SSLDownJ then Color.BLUE else if paintbars == 10 and SSLUpJ < SSLDownJ then Color.RED else if paintbars == 11 and SSLUPK > SSLDownK then Color.BLUE else if paintbars == 11 and SSLUpK < SSLDOWNK THEN Color.RED else if paintbars == 12 and SSLUpL > SSlDownL then Color.BLUE else if paintbars == 12 and sslUpL < SSLDownL then Color.RED else Color.Current);

Cyan and magenta are shorter lengths, Blue and Red are the longer lengths. Set the paintbar input for whichever line you would like to trade and the bars will change to the corresponding color.
8F15T0t.png
 
Hi Henry, can you point me to the indicator that colors the candles blue and purple please.
Plot A7_Dot and down, The assignValueColor is where the magik happens
You can paint the candles according to which line you are interested in by changing the APC input to that number IE: a setting of 0 turns off the painting, a setting of 1 will paint the fastest line 1, a setting of 7 will paint the first blue line and so forth
 
Plot A7_Dot and down, The assignValueColor is where the magik happens
You can paint the candles according to which line you are interested in by changing the APC input to that number IE: a setting of 0 turns off the painting, a setting of 1 will paint the fastest line 1, a setting of 7 will paint the first blue line and so forth
Thank you so much. I thought it was just a lower study. So if I copy code as you posted above, would mine output like that?
 
Thank you so much. I thought it was just a lower study. So if I copy code as you posted above, would mine output like that?
The indicator is THE LOWER STUDY! You asked where in the formula does the color portion of Line 7 turn Blue or Red.

Plot A7_Dot will always plot a DOT! AssignValueColor is where the DOT Changes COLOR.

The Cyan, Magenta colors represent the Short term traders, the Blue, Red colors represent the Long Term investors

What are you trying to do?

I developed this as a visual indicator that shows confluence from longer lengths
 

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

Thread starter Similar threads Forum Replies Date
samer800 SSL Hybrid For ThinkOrSwim Indicators 20
blackbeard12 SSL Indicator For ThinkorSwim Indicators 25

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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