below my conversion of SSL Hybrid For ThinkOrSwim.SSL Hybrid conversion would be awesome if it's possible in ToS format.
https://www.tradingview.com/script/C3MlAWCw-SSL-Hybrid/
some code enhancements.
CSS:
#//By Mihkel00
#// This script is designed for the NNFX Method, so it is recommended for Daily charts only.
#// This script has a SSL / Baseline (you can choose between the SSL or MA), a secondary SSL for continiuation #trades and a third SSL for exit trades.
#// Alerts added for Baseline entries, SSL2 continuations, Exits.
#// Baseline has a Keltner Channel setting for "in zone" Gray Candles
#// Added "Candle Size > 1 ATR" Diamonds from my old script with the criteria of being within Baseline ATR range.
#// Strategy causecelebre https://www.tradingview.com/u/causecelebre/
#// SSL Channel ErwinBeckers https://www.tradingview.com/u/ErwinBeckers/
#// Moving Averages jiehonglim https://www.tradingview.com/u/jiehonglim/
#// Moving Averages everget https://www.tradingview.com/u/everget/
#// "Many Moving Averages" script Fractured https://www.tradingview.com/u/Fractured/
#// study("SSL Hybrid")
### Converted by SAM4COK - 07/2022 ## 09/2022 Added THMA as requested by usethinkscript.com memeber.
### code Enhancement by SAM4COK - 04/2024
input ATR_Bands = no; #"Show ATR bands"
input showCandlesMoreThanAtr = no;
input SSL_Channel = no;
input ShowExitArrow = no;
input Show_Cloud = no;
#//ATR
input ATR_Period = 14; #"ATR Period"
input ATR_mult = 1; #"ATR Multi"
input ATR_smoothing = {default WMA, RMA, SMA, EMA}; #"ATR Smoothing"
#////BASELINE / SSL1 / SSL2 / EXIT MOVING AVERAGE VALUES
input src = close;
input show_Baseline = yes; #"Show Baseline"
input BaselineType = {"SMA", "EMA", "DEMA", "TEMA", "LSMA", "WMA", "MF", "VAMA", "TMA", default "HMA", "THMA", "JMA", "Kijun_v2", "EDSMA", "McGinley"}; #"SSL1 / Baseline Type"
input baselineLength = 60; #"SSL1 / Baseline Length"
input showSslLine2 = no; #"Show SSL1"
input sslLine2Type = {"SMA", "EMA", "DEMA", "TEMA", "LSMA", "WMA", "MF", "VAMA", "TMA", "HMA", "THMA",default "JMA", "Kijun_v2", "EDSMA", "McGinley"};
input sslLine2Length = 5; #"SSL 2 Length"
input showExitLine = no;
input ExitLineType = {"SMA", "EMA", "DEMA", "TEMA", "LSMA", "WMA", "MF", "VAMA", "TMA", default "HMA", "THMA", "JMA", "Kijun_v2", "EDSMA", "McGinley"}; #"EXIT Type"
input EXIT_Length = 15; #"EXIT Length"
########
input Kijun_MOD_Divider = 1; #"Kijun MOD Divider"
input jurik_phase = 3; #"* Jurik (JMA) Only - Phase"
input jurik_power = 1; #"* Jurik (JMA) Only - Power"
input volatility_lookback = 10; #"* Volatility Adjusted (VAMA) Only - Volatility lookback length"
input FilterBeta = 0.8; #"Modular Filter, General Filter Only - Beta"
input FilterFeedback = no ; #"Modular Filter Only - Feedback"
input FilterWeighting = 0.5; #"Modular Filter Only - Feedback Weighting"
#//EDSMA
input EDSMaLength = 20; #"EDSMA - Super Smoother Filter Length"
input EDSMaPoles = {default "2", "3"}; #"EDSMA - Super Smoother Filter Poles"
input useTrueRange = yes;
input BaseChannelMultiplier = 0.2; #"Base Channel Multiplier"
input Continu_ATR = 0.9; #"Continuation ATR Criteria"
input colorBars = no;
input alert = no;
input alertType = Alert.BAR;
input alertSound = Sound.NoSound;
def na = Double.NaN;
def tr = TrueRange (high, close, low);
#################### COLORS ################################
DefineGlobalColor("lowerk", CreateColor(255, 0, 98)); # red
DefineGlobalColor("upperk", CreateColor(0, 195, 255)); # blue
DefineGlobalColor("upbar", CreateColor(38, 166, 154)); # green
DefineGlobalColor("dnbar", CreateColor(239, 83, 80)); # red
##################################################################
def ma_function;
switch (ATR_smoothing) {
case SMA:
ma_function = Average(tr, ATR_Period);
case EMA:
ma_function = ExpAverage(tr, ATR_Period);
case RMA:
ma_function = WildersAverage(tr, ATR_Period);
Default :
ma_function = WMA(tr, ATR_Period);
}
#atr_slen = ma_function(tr(true), atrlen)
def atr_slen = if isNaN(ma_function) then (high - low) else ma_function;
#////ATR Up/Low Bands
def upper_band = atr_slen * ATR_mult + close;
def lower_band = close - atr_slen * ATR_mult;
############ Scripts###############
#get2PoleSSF(src, length) =>
script get2PoleSSF {
input src = close;
input length = 14;
def PI = 2 * ASin(1);
def arg = Sqrt(2) * PI / length;
def a1 = Exp(-arg);
def b1 = 2 * a1 * Cos(arg);
def c2 = b1;
def c3 = -Power(a1, 2);
def c1 = 1 - c2 - c3;
def ssf = if ssf[1]==0 then c1 * src else c1 * src + c2 * ssf[1] + c3 * ssf[2];
plot return = ssf;
}
#get3PoleSSF(src, length) =>
script get3PoleSSF {
input src = close;
input length = 14;
def PI = 2 * ASin(1);
def arg = PI / length;
def a1 = Exp(-arg);
def b1 = 2 * a1 * Cos(1.738 * arg);
def c1 = Power(a1, 2);
def coef2 = b1 + c1;
def coef3 = -(c1 + b1 * c1);
def coef4 = Power(c1, 2);
def coef1 = 1 - coef2 - coef3 - coef4;
def ssf = if ssf[1] == 0 then coef1 * src else coef1 * src + coef2 * ssf[1] + coef3 * ssf[2] + coef4 * ssf[3];
plot Return = ssf;
}
###
#THMA(_src, _length) =>
script THMA {
input src = close;
input length = 55;
def len = length / 2;
def wma1 = WMA(src, len);
def wma2 = WMA(src, len / 2);
def wma3 = WMA(src, len / 3);
def THMA = WMA(3 * wma3 - wma2 - wma1, len);
plot return = THMA;
}
#VAMA(src, len, volatility_lookback) =>
script VAMA {
input src = close;
input len = 14;
input volatility_lookback = 10;
def mid = ExpAverage(src, len);
def dev = src - mid;
def vol_up = Highest(dev, volatility_lookback);
def vol_down = Lowest(dev, volatility_lookback);
def VAMA = mid + (vol_up + vol_down) / 2;
plot result = VAMA;
}
#mf(src, len, z, beta, feedback)
script MF {
input src = close;
input len = 14;
input z = 0;
input beta = 0.8;
input feedback = no;
def ts;
def alpha = 2 / (len + 1);
def a = if feedback then src + (1 - z) * if(ts[1]==0, src, ts[1]) else src;
def b = if a > alpha * a + (1 - alpha) * if(b[1]==0, a, b[1]) then a else alpha * a + (1 - alpha) * if(b[1]==0, a, b[1]);
def c = if a < alpha * a + (1 - alpha) * if(c[1]==0, a, c[1]) then a else alpha * a + (1 - alpha) * if(c[1]==0, a, c[1]);
def os = if a == b then 1 else if a == c then 0 else os[1];
def upper = beta * b + (1 - beta) * c;
def lower = beta * c + (1 - beta) * b;
ts = os * upper + (1 - os) * lower;
plot result = if ts then ts else HullMovingAvg(src, len);
}
#JMA(src, len, jurik_phase, jurik_power)
script JMA {
input src = close;
input len = 14;
input jurik_phase = 3;
input jurik_power = 1;
def jma;
def jma1 = if jma[1]==0 or isNaN(jma[1]) then src else jma[1];
def phaseRatio = if jurik_phase < -100 then 0.5 else
if jurik_phase > 100 then 2.5 else jurik_phase / 100 + 1.5;
def beta = 0.45 * (len - 1) / (0.45 * (len - 1) + 2);
def alpha = Power(beta, jurik_power);
def e0 = (1 - alpha) * src + alpha * if(isNaN(e0[1]), 0, e0[1]);
def e1 = (src - e0) * (1 - beta) + beta * if(isNaN(e1[1]), 0, e1[1]);
def e2 = (e0 + phaseRatio * e1 - jma1) * Power(1 - alpha, 2) + Power(alpha, 2) * if(isNaN(e2[1]), 0, e2[1]);
jma = e2 + jma1;
plot result = if jma then jma else ExpAverage(src, len);
}
#Kijun_v2(src, len, kidiv)
script Kijun_v2 {
input src = close;
input len = 14;
input kidiv = 1;
def kLen = len / kidiv;
def hh1 = Highest(src, len);
def ll1 = Lowest(src, len);
def hh2 = Highest(src, kLen);
def ll2 = Lowest(src, kLen);
def kijun = (ll1 + hh1) / 2;
def conversionLine = (ll2 + hh2) / 2;
def delta = (kijun + conversionLine) / 2;
plot result = delta;
}
#McGinley(src, len)
script mg {
input src = close;
input len = 14;
def ema = ExpAverage(src, len);
def mg = if (mg[1]==0) then ema else mg[1] + (src - mg[1]) / (len * power(src/mg[1], 4));
plot result = if Mg then Mg else ema;
}
#EDSMA(src, len,ssfLength, ssfPoles)
script EDSMA {
input src = close;
input len = 14;
input ssfLength = 20;
input ssfPoles = "2";
def sma = Average(src, len);
def zeros = src - if(src[2]==0, src, src[2]);
def avgZeros = (zeros + zeros[1]) / 2;
def ssf = if ssfPoles == "2" then get2PoleSSF(avgZeros, ssfLength) else
get3PoleSSF(avgZeros, ssfLength);
def stdev = StDev(ssf, len);
def scaledFilter = if stdev != 0 then ssf / stdev else 0;
def alpha = 5 * AbsValue(scaledFilter) / len;
def edsma = if edsma[1]==0 then sma else alpha * src + (1 - alpha) * edsma[1];
plot result = if edsma then edsma else sma;
}
def emaHigh; def emaLow; def BBMC;def Keltma;
Switch (BaselineType) {
Case "SMA" :
emaHigh = Average(high, baselineLength);
emaLow = Average(low, baselineLength);
BBMC = Average(close, baselineLength);
Keltma = Average(src, baselineLength);
Case "EMA" :
emaHigh = ExpAverage(high, baselineLength);
emaLow = ExpAverage(low, baselineLength);
BBMC = ExpAverage(close, baselineLength);
Keltma = ExpAverage(src, baselineLength);
Case "DEMA" :
emaHigh = DEMA(high, baselineLength);
emaLow = DEMA(low, baselineLength);
BBMC = DEMA(close, baselineLength);
Keltma = DEMA(src, baselineLength);
Case "TEMA" :
emaHigh = TEMA(high, baselineLength);
emaLow = TEMA(low, baselineLength);
BBMC = TEMA(close, baselineLength);
Keltma = TEMA(src, baselineLength);
Case "LSMA" :
emaHigh = Inertia(high, baselineLength);
emaLow = Inertia(low, baselineLength);
BBMC = Inertia(close, baselineLength);
Keltma = Inertia(src, baselineLength);
Case "WMA" :
emaHigh = WMA(high, baselineLength);
emaLow = WMA(low, baselineLength);
BBMC = WMA(close, baselineLength);
Keltma = WMA(src, baselineLength);
Case "MF" :
emaHigh = MF(high, baselineLength, FilterWeighting, FilterBeta, FilterFeedback);
emaLow = MF(low, baselineLength, FilterWeighting, FilterBeta, FilterFeedback);
BBMC = MF(close, baselineLength, FilterWeighting, FilterBeta, FilterFeedback);
Keltma = MF(src, baselineLength, FilterWeighting, FilterBeta, FilterFeedback);
Case "VAMA" :
emaHigh = VAMA(high, baselineLength, volatility_lookback);
emaLow = VAMA(low, baselineLength, volatility_lookback);
BBMC = VAMA(close, baselineLength, volatility_lookback);
Keltma = VAMA(src, baselineLength, volatility_lookback);
Case "TMA" :
emaHigh = MovAvgTriangular(high, baselineLength);
emaLow = MovAvgTriangular(low, baselineLength);
BBMC = MovAvgTriangular(close, baselineLength);
Keltma = MovAvgTriangular(src, baselineLength);
Case "THMA" :
emaHigh = THMA(high, baselineLength);
emaLow = THMA(low, baselineLength);
BBMC = THMA(close, baselineLength);
Keltma = THMA(src, baselineLength);
Case "JMA" :
emaHigh = JMA(high, baselineLength, jurik_phase, jurik_power);
emaLow = JMA(low, baselineLength, jurik_phase, jurik_power);
BBMC = JMA(close, baselineLength, jurik_phase, jurik_power);
Keltma = JMA(src, baselineLength, jurik_phase, jurik_power);
Case "Kijun_v2" :
emaHigh = Kijun_v2(high, baselineLength, Kijun_MOD_Divider);
emaLow = Kijun_v2(low, baselineLength, Kijun_MOD_Divider);
BBMC = Kijun_v2(close, baselineLength, Kijun_MOD_Divider);
Keltma = Kijun_v2(src, baselineLength, Kijun_MOD_Divider);
Case "EDSMA" :
emaHigh = EDSMA(high, baselineLength, EDSMaLength, EDSMaPoles);
emaLow = EDSMA(low, baselineLength, EDSMaLength, EDSMaPoles);
BBMC = EDSMA(close, baselineLength, EDSMaLength, EDSMaPoles);
Keltma = EDSMA(src, baselineLength, EDSMaLength, EDSMaPoles);
Case "McGinley" :
emaHigh = mg(high, baselineLength);
emaLow = mg(low, baselineLength);
BBMC = mg(close, baselineLength);
Keltma = mg(src, baselineLength);
Default :
emaHigh = HullMovingAvg(high, baselineLength);
emaLow = HullMovingAvg(low, baselineLength);
BBMC = HullMovingAvg(close, baselineLength);
Keltma = HullMovingAvg(src, baselineLength);
}
def maHigh; def maLow;
Switch (sslLine2Type) {
Case "SMA" :
maHigh = Average(high, sslLine2Length);
maLow = Average(low, sslLine2Length);
Case "EMA" :
maHigh = ExpAverage(high, sslLine2Length);
maLow = ExpAverage(low, sslLine2Length);
Case "DEMA" :
maHigh = DEMA(high, sslLine2Length);
maLow = DEMA(low, sslLine2Length);
Case "TEMA" :
maHigh = TEMA(high, sslLine2Length);
maLow = TEMA(low, sslLine2Length);
Case "LSMA" :
maHigh = Inertia(high, sslLine2Length);
maLow = Inertia(low, sslLine2Length);
Case "WMA" :
maHigh = WMA(high, sslLine2Length);
maLow = WMA(low, sslLine2Length);
Case "MF" :
maHigh = MF(high, sslLine2Length, FilterWeighting, FilterBeta, FilterFeedback);
maLow = MF(low, sslLine2Length, FilterWeighting, FilterBeta, FilterFeedback);
Case "VAMA" :
maHigh = VAMA(high, sslLine2Length, volatility_lookback);
maLow = VAMA(low, sslLine2Length, volatility_lookback);
Case "TMA" :
maHigh = MovAvgTriangular(high, sslLine2Length);
maLow = MovAvgTriangular(low, sslLine2Length);
Case "THMA" :
maHigh = THMA(high, sslLine2Length);
maLow = THMA(low, sslLine2Length);
Case "Kijun_v2" :
maHigh = Kijun_v2(high, sslLine2Length, Kijun_MOD_Divider);
maLow = Kijun_v2(low, sslLine2Length, Kijun_MOD_Divider);
Case "EDSMA" :
maHigh = EDSMA(high, sslLine2Length, EDSMaLength, EDSMaPoles);
maLow = EDSMA(low, sslLine2Length, EDSMaLength, EDSMaPoles);
Case "McGinley" :
maHigh = mg(high, sslLine2Length);
maLow = mg(low, sslLine2Length);
Case "HMA" :
maHigh = HullMovingAvg(high, sslLine2Length);
maLow = HullMovingAvg(low, sslLine2Length);
Default :
maHigh = JMA(high, sslLine2Length, jurik_phase, jurik_power);
maLow = JMA(low, sslLine2Length, jurik_phase, jurik_power);
}
def ExitHigh; def ExitLow;
Switch (ExitLineType) {
Case "SMA" :
ExitHigh = Average(high, EXIT_Length);
ExitLow = Average(low, EXIT_Length);
Case "EMA" :
ExitHigh = ExpAverage(high, EXIT_Length);
ExitLow = ExpAverage(low, EXIT_Length);
Case "DEMA" :
ExitHigh = DEMA(high, EXIT_Length);
ExitLow = DEMA(low, EXIT_Length);
Case "TEMA" :
ExitHigh = TEMA(high, EXIT_Length);
ExitLow = TEMA(low, EXIT_Length);
Case "LSMA" :
ExitHigh = Inertia(high, EXIT_Length);
ExitLow = Inertia(low, EXIT_Length);
Case "WMA" :
ExitHigh = WMA(high, EXIT_Length);
ExitLow = WMA(low, EXIT_Length);
Case "MF" :
ExitHigh = MF(high, EXIT_Length, FilterWeighting, FilterBeta, FilterFeedback);
ExitLow = MF(low, EXIT_Length, FilterWeighting, FilterBeta, FilterFeedback);
Case "VAMA" :
ExitHigh = VAMA(high, EXIT_Length, volatility_lookback);
ExitLow = VAMA(low, EXIT_Length, volatility_lookback);
Case "TMA" :
ExitHigh = MovAvgTriangular(high, EXIT_Length);
ExitLow = MovAvgTriangular(low, EXIT_Length);
Case "THMA" :
ExitHigh = THMA(high, EXIT_Length);
ExitLow = THMA(low, EXIT_Length);
Case "JMA" :
ExitHigh = JMA(high,EXIT_Length, jurik_phase, jurik_power);
ExitLow = JMA(low, EXIT_Length, jurik_phase, jurik_power);
Case "Kijun_v2" :
ExitHigh = Kijun_v2(high, EXIT_Length, Kijun_MOD_Divider);
ExitLow = Kijun_v2(low, EXIT_Length, Kijun_MOD_Divider);
Case "EDSMA" :
ExitHigh = EDSMA(high, EXIT_Length, EDSMaLength, EDSMaPoles);
ExitLow = EDSMA(low, EXIT_Length, EDSMaLength, EDSMaPoles);
Case "McGinley" :
ExitHigh = mg(high, EXIT_Length);
ExitLow = mg(low, EXIT_Length);
Default :
ExitHigh = HullMovingAvg(high, EXIT_Length);
ExitLow = HullMovingAvg(low, EXIT_Length);
}
def range = if useTrueRange then tr else high - low;
def rangema = ExpAverage(range, baselineLength);
def upperk = Keltma + rangema * BaseChannelMultiplier;
def lowerk = Keltma - rangema * BaseChannelMultiplier;
#//Baseline Violation Candle
def difference = AbsValue(close - open);
def atr_violation = difference > atr_slen;
def InRange = upper_band > BBMC and lower_band < BBMC;
def candlesize_violation = atr_violation and InRange;
plot candlesize = if showCandlesMoreThanAtr then if candlesize_violation then high + atr_slen else na else na; #"Candle Size > 1xATR"
candlesize.SetDefaultColor(Color.YELLOW);
candlesize.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
candlesize.SetLineWeight(3);
#//SSL1 VALUES
def Hlv = if close > emaHigh then 1 else if close < emaLow then -1 else Hlv[1];
def sslDown = if Hlv < 0 then emaHigh else emaLow;
#//SSL2 VALUES
def Hlv2 = if close > maHigh then 1 else if close < maLow then -1 else Hlv2[1];
def sslDown2 = if Hlv2 < 0 then maHigh else maLow;
#//EXIT VALUES
def Hlv3 = if close > ExitHigh then 1 else if close < ExitLow then -1 else Hlv3[1];
def sslExit = if Hlv3 < 0 then ExitHigh else ExitLow;
def base_cross_Long = close crosses above sslExit;
def base_cross_Short = sslExit crosses above close;
def codiff = if base_cross_Long then 1 else if base_cross_Short then -1 else na;
#//COLORS
AssignPriceColor( if colorBars then if close > upperk then GlobalColor("upbar")
else if close < lowerk then GlobalColor("dnbar")
else Color.GRAY else Color.CURRENT);
AssignPriceColor(if showCandlesMoreThanAtr and candlesize_violation then
if close > open then Color.CYAN else Color.MAGENTA else Color.CURRENT);
#//PLOTS
plot ArUp = if ShowExitArrow and codiff > 0 then low else na;
plot ArDN = if ShowExitArrow and codiff < 0 then high else na;
ArUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
ArUp.SetDefaultColor(GlobalColor("upperk"));
ArUp.SetLineWeight(2);
ArDN.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
ArDN.SetDefaultColor(GlobalColor("lowerk"));
ArDN.SetLineWeight(2);
def col1 = if close > upperk then 1 else if close < lowerk then -1 else 0;
def col = if isNaN(col1) then 0 else col1;
plot p1 = if show_Baseline then BBMC else na; #MA Baseline
p1.AssignValueColor(if col > 0 then GlobalColor("upperk") else
if col < 0 then GlobalColor("lowerk") else Color.GRAY);
p1.SetLineWeight(2);
plot DownPlot = if showSslLine2 then sslDown else na; #"SSL1"
DownPlot.AssignValueColor(if close > sslDown then GlobalColor("upperk") else
if close < sslDown then GlobalColor("lowerk") else Color.CURRENT);
DownPlot.SetLineWeight(2);
plot up_channel = if SSL_Channel then upperk else na; #"Baseline Upper Channel")
up_channel.AssignValueColor(if col > 0 then GlobalColor("upperk") else
if col < 0 then GlobalColor("lowerk") else Color.GRAY);
plot low_channel = if SSL_Channel then lowerk else na; #"Basiline Lower Channel")
low_channel.AssignValueColor(if col > 0 then GlobalColor("upperk") else
if col < 0 then GlobalColor("lowerk") else Color.GRAY);
def colUp = col > 0 or col[-1] > 0;
def colDn = col < 0 or col[-1] < 0;
def colNo = col == 0 or col[-1] == 0;
AddCloud (if Show_Cloud and colUp then upperk else na, lowerk, GlobalColor("upperk"));
AddCloud (if Show_Cloud and colDn then upperk else na, lowerk, GlobalColor("lowerk"));
AddCloud (if Show_Cloud and colNo then upperk else na, lowerk, Color.GRAY);
#////SSL2 Continiuation from ATR
def upper_half = atr_slen * Continu_ATR + close;
def lower_half = close - atr_slen * Continu_ATR;
def buy_inatr = lower_half < sslDown2;
def sell_inatr = upper_half > sslDown2;
def sell_cont = close < BBMC and close < sslDown2;
def buy_cont = close > BBMC and close > sslDown2;
def sell_atr = sell_inatr and sell_cont;
def buy_atr = buy_inatr and buy_cont;
def atr_fill = if buy_atr then 1 else if sell_atr then -1 else 0;
plot LongPlot = if showExitLine then sslDown2 else na;
LongPlot.SetPaintingStrategy(PaintingStrategy.POINTS);
LongPlot.AssignValueColor(if atr_fill > 0 then Color.GREEN else
if atr_fill < 0 then Color.MAGENTA else Color.WHITE);
LongPlot.SetLineWeight(2);
plot u = if ATR_Bands then upper_band else na; # "+ATR", color=color.white, transp=80)
u.SetDefaultColor(Color.GRAY);
plot l = if ATR_Bands then lower_band else na; # "-ATR", color=color.white, transp=80)
l.SetDefaultColor(Color.GRAY);
#//ALERTS
alert(alert and close crosses above sslDown, "SSL1 has crossed", alertType, alertSound);
alert(alert and close crosses below sslDown2, "SSL2 has crossed", alertType, alertSound);
alert(alert and sell_atr, "Sell Continuation", alertType, alertSound);
alert(alert and buy_atr, "Buy Continuation", alertType, alertSound);
alert(alert and close crosses above sslExit, "Exit Sell Alert", alertType, alertSound);
alert(alert and sslExit crosses below close, "Exit Buy Alert", alertType, alertSound);
alert(alert and close crosses above upperk, "Base Buy Alert", alertType, alertSound);
alert(alert and lowerk crosses below close, "Base Sell Alert", alertType, alertSound);
#####END #########
Last edited: