Blue Magik SSL ADD a color candles, arrow and scan

Platform
  1. Thinkorswim
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));

addcloud(up, down, color.green, color.red);


please gang i need a favor from the smarter thinkscript expert here, i found this great indicator, i will like to paint the candles with signal and maybe plot a arrow also if is possible a Scan. thank you some much in advance
 
Last edited by a moderator:

barbaros

Administrator
Staff member
try this

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/
# Modified by Barbaros at https://b4indicators.com/threads/add-a-color-candles-arrow-and-scan-to-this-thinkscript.261/

input period = 10;
input len = 10;
input colorBars = yes;

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;
up.SetDefaultColor(GetColor(1));

plot down = sslDown;
down.SetDefaultColor(GetColor(0));

plot buy = up crosses above down;
buy.setPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buy.setDefaultColor(Color.GREEN);
buy.setLineWeight(3);

plot sell = up crosses below down;
sell.setPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sell.setDefaultColor(Color.RED);
sell.setLineWeight(3);

def direction = if buy then 1 else if sell then -1 else direction[1];

AssignPriceColor(if colorBars then if direction == 1 then color.green else color.red else color.current);

SkvJJuS.png
 
try this

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/
# Modified by Barbaros at https://b4indicators.com/threads/add-a-color-candles-arrow-and-scan-to-this-thinkscript.261/

input period = 10;
input len = 10;
input colorBars = yes;

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;
up.SetDefaultColor(GetColor(1));

plot down = sslDown;
down.SetDefaultColor(GetColor(0));

plot buy = up crosses above down;
buy.setPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buy.setDefaultColor(Color.GREEN);
buy.setLineWeight(3);

plot sell = up crosses below down;
sell.setPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sell.setDefaultColor(Color.RED);
sell.setLineWeight(3);

def direction = if buy then 1 else if sell then -1 else direction[1];

AssignPriceColor(if colorBars then if direction == 1 then color.green else color.red else color.current);

SkvJJuS.png
@barbaros thank you some much!! really appreciate
 
try this

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/
# Modified by Barbaros at https://b4indicators.com/threads/add-a-color-candles-arrow-and-scan-to-this-thinkscript.261/

input period = 10;
input len = 10;
input colorBars = yes;

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;
up.SetDefaultColor(GetColor(1));

plot down = sslDown;
down.SetDefaultColor(GetColor(0));

plot buy = up crosses above down;
buy.setPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buy.setDefaultColor(Color.GREEN);
buy.setLineWeight(3);

plot sell = up crosses below down;
sell.setPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sell.setDefaultColor(Color.RED);
sell.setLineWeight(3);

def direction = if buy then 1 else if sell then -1 else direction[1];

AssignPriceColor(if colorBars then if direction == 1 then color.green else color.red else color.current);

SkvJJuS.png
Hello to everyone in this great group!! @barbaros please dont forget when you have time to help me with the scan please! thank you some much!
 
Hello to everyone in this great group!! @barbaros please dont forget when you have time to help me with the scan please! thank you some much!
hi @barbaros i need your help adding the order for a strategy, i will like to back testing this system , can you help me add order for long when a candle signal close, take profit an close the close when have the signal for the other side? thank you in advance
 
Top