glendale ca usa
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88
|
#CIPHER_COLORED
declare lower;
input Channel_Length = 4; #10
input Average_Length = 3; #10
input over_bought_1 = 60;
input over_bought_2 = 53;
input over_sold_1 = -60;
input over_sold_2 = -53;
input show_bubbles = yes;
input show_sec_bbls = no;
input show_alerts = yes;
def ap = hlc3;#hlc3
def esa = ExpAverage(ap, Channel_Length);
def d = ExpAverage(AbsValue(ap - esa), Channel_Length);
def ci = (ap - esa) / (0.015 * d);
def tci = ExpAverage(ci, Average_Length);
PLOT wt1 = tci;
WT1.setLineWeight(2);
PLOT wt2 = SimpleMovingAvg(wt1, 3);
def wt1_1 = wt1;
#wt1_1.SetDefaultColor(Color.GREEN);
def wt2_1 = wt2;
#wt2_1.SetDefaultColor(Color.RED);
#wt2_1.SetStyle(Curve.POINTS);
#plot wt3 = (wt1 - wt2);
#def wt3 = Average (wt1 - wt2, 4);
#wt3.SetDefaultColor(Color.YELLOW);
#wt3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
#wt3.setLineWeight(1);
input Channel_Length2 = 12; #10
input Average_Length2 = 12; #10
def esa2 = ExpAverage(ap, Channel_Length2);
def d2 = ExpAverage(AbsValue(ap - esa2), Channel_Length2);
def ci2 = (ap - esa) / (0.015 * d);
def tci2 = ExpAverage(ci2, Average_Length2);
PLOT wtA = tci2;
#WT1.setLineWeight(1);
DEF wtB = SimpleMovingAvg(wtA, 4);
input Channel_Length3 = 14; #10
input Average_Length3 = 14; #10
def esa3 = ExpAverage(ap, Channel_Length3);
def d3 = ExpAverage(AbsValue(ap - esa3), Channel_Length3);
def ci3 = (ap - esa) / (0.015 * d);
def tci3 = ExpAverage(ci3, Average_Length3);
def wtC = tci3;
#WT1.setLineWeight(1);
def wtD = SimpleMovingAvg(wtC, 4);
input Channel_Length4 = 16; #10
input Average_Length4 = 16; #10
def esa4 = ExpAverage(ap, Channel_Length4);
def d4 = ExpAverage(AbsValue(ap - esa4), Channel_Length4);
def ci4 = (ap - esa) / (0.015 * d);
def tci4 = ExpAverage(ci4, Average_Length4);
DEF wtE = tci4;
#WT1.setLineWeight(1);
DEF wtF = SimpleMovingAvg(wtE, 4);
WT1.ASSignValueColor( if WT2<WTA and wt1>wTB then color.CYAN else if WT2>WTA and wt1<wTB then color.YELLOW else color.gray);
ADDCLOUD(WT2, WTA, COLOR.GREEN, COLOR.RED);
#addlabel(yes, "x", if WTA>WT2 then color.CYAN else if WTA<WT2 then color.YELLOW else color.gray);
#ADDCLOUD(WT1, WTA, COLOR.GREEN, COLOR.RED);
#addlabel(yes, "x", if WT1>WTA then color.CYAN else if WT1<WTA then color.YELLOW else color.gray);
addlabel(yes, "x", if WTA>WT2 then color.CYAN else if WTA<WT2 then color.YELLOW else color.gray);
addlabel(yes, "O", if WT2<WTA and wt1>wTB then color.CYAN else if WT2>WTA and wt1<wTB then color.YELLOW else color.gray);
##addLabel(yes, " .. ", if wt12>wt13 and wt14>wt23 then color.green else if wt12<wt13 and wt14<wt23 then color.red else color.gray);
#ADDLABEL (yes, " ", if green[1] > white[1] and white[1]>red[1] then color.green else if green[1] < white[1] and white[1]<red[1] then color.red else color.gray);
#ASSignBackgroundColor( if wt12>wt13 and wt14>wt23 then color.green else if wt12<wt13 and wt14<wt23 then color.red else color.gray);
#ALMA
script ALMA { input Data = close; input Window = 9;
input Sigma = 4; #6
input Offset = 0.85;
def m = (Offset * (Window - 1));
def s = Window / Sigma;
def SumVectorData = fold y = 0 to Window with WS do WS + Exp(-(Sqr(y - m)) / (2 * Sqr(s))) * GetValue(Data, (Window - 1) - y);
def SumVector = fold z = 0 to Window with CW do CW + Exp(-(Sqr(z - m)) / (2 * Sqr(s)));
plot ALMA = 100* SumVectorData / SumVector;
}
input fastWindow = 2; #9
input slowWindow = 18;
input Sigma = 6; input Offset = 0.85;
def fastALMA = ALMA (close, fastWindow, Sigma, Offset);
def slowALMA = ALMA (close, slowWindow, Sigma, Offset);
def Hist = fastALMA - slowALMA;
addlabel(yes, "A", if Hist > 0 then color.green else color.red);
plot UpSignal = if HIST crosses above 0 then wt1 else Double.NaN;
plot DownSignal = if HIST crosses below 0 then wt1 else Double.NaN;
UpSignal.SetDefaultColor(Color.GREEN);
UpSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
UpSignal.SetLineWeight(4);
DownSignal.SetDefaultColor(Color.RED);
DownSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
DownSignal.SetLineWeight(4);
#end code
|