NexusFi: Find Your Edge


Home Menu

 





CIPHER_COLORED for TOS


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,060 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 1 attachments




 
Search this Thread

CIPHER_COLORED for TOS

  #1 (permalink)
alagrande
glendale ca usa
 
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88

#CIPHER_COLORED
#CIPHER_LINES_DOUBLE
declare lower;
input Channel_Length = 4; #10
input Average_Length = 4; #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(1);
DEF wt2 = SimpleMovingAvg(wt1, 2);


plot zero = 0;
zero.SetDefaultColor( Color.GRAY );
plot obLevel1 = over_bought_1;
obLevel1.SetDefaultColor(Color.red);
plot osLevel1 = over_sold_1;
osLevel1.SetDefaultColor(Color.green);
plot obLevel2 = over_bought_2;
obLevel2.SetDefaultColor(Color.gray);
obLevel2.SetStyle(Curve.SHORT_DASH);
plot osLevel2 = over_sold_2;
osLevel2.SetDefaultColor(Color.gray);
osLevel2.SetStyle(Curve.SHORT_DASH);


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);

#WTA.ASSignValueColor( if WTB<WTC and wtA>wTC then color.CYAN else if WTB>WTC and wtA<wTC then color.YELLOW else color.gray);


ADDCLOUD(WTc, WTb, COLOR.white, COLOR.white);
ADDCLOUD(WTc, WTb, COLOR.white, COLOR.white);

ADDCLOUD(WTA, WT2, COLOR.RED, COLOR.GREEN);
ADDCLOUD(WTe, WTd, COLOR.CYAN, COLOR.MAGENTA);
ADDCLOUD(WTe, WTd, COLOR.CYAN, COLOR.MAGENTA);


ADDCLOUD(WT2, WT1, COLOR.RED, COLOR.GREEN);

ADDCLOUD(WT2, WT1, COLOR.RED, COLOR.GREEN);

ADDCLOUD(WT2, WT1, COLOR.RED, COLOR.GREEN);

#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, "wt1", if WT2<WTA and wt1>wTB then color.CYAN else if WT2>WTA and wt1<wTB 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);



#-------------------------------------------

#PERCENT_R
input length = 14;
input over_Sold = 20;
input over_Bought = 80;

def highest = Highest(high, length);
def divisor = highest - Lowest(low, length);

def "%R" = if divisor equals 0 then 0 else 100 - 100 * (highest - close) / divisor;
def OverBought = over_Bought;
def OverSold = over_Sold;
#"%R".SETLineWeight(1);

plot per = Average("%R", 3);
#per.HIDE();

per.DefineColor("OverBought", createcolor(40, 100, 100));
per.DefineColor("Normal", GetColor(7));
per.DefineColor("OverSold", Color.dark_RED);
per.AssignValueColor(if "%R" > over_Bought then per.Color("OverBought") else if "%R" < over_Sold then per.Color("OverSold") else per.Color("Normal"));
#OverBought.SetDefaultColor(GetColor(8));
#OverSold.SetDefaultColor(GetColor(7));
#OverSold.setLineWeight(1);

#--------------------------------------


#------------------------------------------

#RSI
input lengthR = 14;
input price = close;
input averageTypeR = AverageType.WILDERS;

def NetChgAvg = MovingAverage(averageTypeR, price - price[1], length);
def TotChgAvg = MovingAverage(averageTypeR, AbsValue(price - price[1]), lengthR);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

plot RSI = 100 * (ChgRatio + .5);
RSI.DefineColor("OverBought", GetColor(5));
RSI.DefineColor("Normal", GetColor(3));
RSI.DefineColor("OverSold", GetColor(1));
RSI.AssignValueColor(if RSI > 90 then RSI.Color("OverBought") else if RSI < 10 then RSI.Color("OverSold") else RSI.Color("Normal"));
RSI.Hide();


plot Up = if PER crosses above 50 then -90 else Double.NaN;
plot Down = if PER crosses below 50 then 90 else Double.NaN;

Up.SetDefaultColor(Color.GREEN);
Up.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Up.SetLineWeight(2);
UP.HIDE();
DowN.SetDefaultColor(Color.RED);
Down.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Down.SetLineWeight(2);
DOWN.HIDE();
#-------------------------------------------

Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2020-04-21 at 10.42.55 AM.png
Views:	337
Size:	176.6 KB
ID:	296158  
Reply With Quote




Last Updated on April 21, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts