AlexsOptions
New member
V1 :
Shows % change compared to yesterday's close and current price. If % change is positive it will be green if neg. it will be red. The leader (highest % change) for the day will be in pink.
http://tos.mx/TsidmSY
V2:
Shows green if above yesterdays high, shows red if below yesterday's high and shows white if current price is above yesterdays low and below yesterdays high.
http://tos.mx/S8B534Z
You can change the tickers as you wish, just know you will have to change the code in order to change the name, it's all hard coded in & if anyone is able to shorten it up that'd be helpful. No clue how TOS's language is structured so have no clue how I would shorten up the huge checks against all other tickers.
V1 CODE :
V2 CODE :
Shows % change compared to yesterday's close and current price. If % change is positive it will be green if neg. it will be red. The leader (highest % change) for the day will be in pink.
http://tos.mx/TsidmSY
V2:
Shows green if above yesterdays high, shows red if below yesterday's high and shows white if current price is above yesterdays low and below yesterdays high.
http://tos.mx/S8B534Z
You can change the tickers as you wish, just know you will have to change the code in order to change the name, it's all hard coded in & if anyone is able to shorten it up that'd be helpful. No clue how TOS's language is structured so have no clue how I would shorten up the huge checks against all other tickers.
V1 CODE :
Code:
input SNP = "SPY";
input IWM = "IWM";
input QQQ = "QQQ";
input XLC = "XLC";
input XLY = "XLY";
input XLP = "XLP";
input XLE = "XLE";
input XLF = "XLF";
input XLV = "XLV";
input XLI = "XLI";
input XLB = "XLB";
input XLRE = "XLRE";
input XLK = "XLK";
input XLU = "XLU";
def IWMC = close(IWM, period = AggregationPeriod.DAY);
def IWMO = close(IWM, period = AggregationPeriod.DAY)[1];
def IWMD = IWMC - IWMO;
def IWMPCT = IWMD / IWMO;
def QQQC = close(QQQ, period = AggregationPeriod.DAY);
def QQQO = close(QQQ, period = AggregationPeriod.DAY)[1];
def QQQD = QQQC - QQQO;
def QQQPCT = QQQD / QQQO;
def XLCC = close(XLC, period = AggregationPeriod.DAY);
def XLCO = close(XLC, period = AggregationPeriod.DAY)[1];
def XLCD = XLCC - XLCO;
def XLCPCT = XLCD / XLCO;
def XLYC = close(XLY, period = AggregationPeriod.DAY);
def XLYO = close(XLY, period = AggregationPeriod.DAY)[1];
def XLYD = XLYC - XLYO;
def XLYPCT = XLYD / XLYO;
def XLPC = close(XLP, period = AggregationPeriod.DAY);
def XLPO = close(XLP, period = AggregationPeriod.DAY)[1];
def XLPD = XLPC - XLPO;
def XLPPCT = XLPD / XLPO;
def XLEC = close(XLE, period = AggregationPeriod.DAY);
def XLEO = close(XLE, period = AggregationPeriod.DAY)[1];
def XLED = XLEC - XLEO;
def XLEPCT = XLED / XLEO;
def XLFC = close(XLF, period = AggregationPeriod.DAY);
def XLFO = close(XLF, period = AggregationPeriod.DAY)[1];
def XLFD = XLFC - XLFO;
def XLFPCT = XLFD / XLFO;
def XLVC = close(XLV, period = AggregationPeriod.DAY);
def XLVO = close(XLV, period = AggregationPeriod.DAY)[1];
def XLVD = XLVC - XLVO;
def XLVPCT = XLVD / XLVO;
def XLIC = close(XLI, period = AggregationPeriod.DAY);
def XLIO = close(XLI, period = AggregationPeriod.DAY)[1];
def XLID = XLIC - XLIO;
def XLIPCT = XLID / XLIO;
def XLREC = close(XLRE, period = AggregationPeriod.DAY);
def XLREO = close(XLRE, period = AggregationPeriod.DAY)[1];
def XLRED = XLREC - XLREO;
def XLREPCT = XLRED / XLREO;
def XLKC = close(XLK, period = AggregationPeriod.DAY);
def XLKO = close(XLK, period = AggregationPeriod.DAY)[1];
def XLKD = XLKC - XLKO;
def XLKPCT = XLKD / XLKO;
def XLBC = close(XLB, period = AggregationPeriod.DAY);
def XLBO = close(XLB, period = AggregationPeriod.DAY)[1];
def XLBD = XLBC - XLBO;
def XLBPCT = XLBD / XLBO;
def XLUC = close(XLU, period = AggregationPeriod.DAY);
def XLUO = close(XLU, period = AggregationPeriod.DAY)[1];
def XLUD = XLUC - XLUO;
def XLUPCT = XLUD / XLUO;
def SNPC = close(SNP, period = AggregationPeriod.DAY);
def SNPO = close(SNP, period = AggregationPeriod.DAY)[1];
def SNPD = SNPC - SNPO;
def SNPPCT = SNPD / SNPO;
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"SPY: " + AsPercent(SNPPCT) + "", if SNPPCT > XLFPCT and SNPPCT > XLVPCT and SNPPCT > XLIPCT and SNPPCT > XLBPCT and SNPPCT > XLYPCT and SNPPCT > XLREPCT and SNPPCT > XLUPCT and SNPPCT > XLEPCT and SNPPCT > XLYPCT and SNPPCT > XLCPCT and SNPPCT > QQQPCT and SNPPCT > XLPPCT and SNPPCT > IWMPCT then Color.PINK else if SNPPCT > 0 then Color.GREEN else Color.RED
);
######################
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"IWM: " + AsPercent(IWMPCT) + "", if IWMPCT > XLFPCT and IWMPCT > XLVPCT and IWMPCT > XLIPCT and IWMPCT > XLBPCT and IWMPCT > XLYPCT and IWMPCT > XLREPCT and IWMPCT > XLUPCT and IWMPCT > XLEPCT and IWMPCT > XLYPCT and IWMPCT > XLCPCT and IWMPCT > QQQPCT and IWMPCT > XLPPCT and IWMPCT > SNPPCT then Color.PINK else if IWMPCT > 0 then Color.GREEN else Color.RED
);
########################
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"QQQ: " + AsPercent(QQQPCT) + "", if QQQPCT > XLFPCT and QQQPCT > XLVPCT and QQQPCT > XLIPCT and QQQPCT > XLBPCT and QQQPCT > XLYPCT and QQQPCT > XLREPCT and QQQPCT > XLUPCT and QQQPCT > XLEPCT and QQQPCT > XLYPCT and QQQPCT > XLCPCT and QQQPCT > IWMPCT and QQQPCT > XLPPCT and QQQPCT > SNPPCT then Color.PINK else if QQQPCT > 0 then Color.GREEN else Color.RED
);
######################
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLC: " + AsPercent(XLCPCT) + "",if XLCPCT > XLFPCT and XLCPCT > XLVPCT and XLCPCT > XLIPCT and XLCPCT > XLBPCT and XLCPCT > XLYPCT and XLCPCT > XLREPCT and XLCPCT > XLUPCT and XLCPCT > XLEPCT and XLCPCT > XLYPCT and XLCPCT > QQQPCT and XLCPCT > IWMPCT and XLCPCT > XLPPCT and XLCPCT > SNPPCT then Color.PINK else if XLCPCT > 0 then Color.GREEN else Color.RED
);
#########################
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLY: " + AsPercent(XLYPCT) + "", if XLYPCT > XLFPCT and XLYPCT > XLVPCT and XLYPCT > XLIPCT and XLYPCT > XLBPCT and XLYPCT > XLCPCT and XLYPCT > XLREPCT and XLYPCT > XLUPCT and XLYPCT > XLEPCT and XLYPCT > XLCPCT and XLYPCT > QQQPCT and XLYPCT > IWMPCT and XLYPCT > XLPPCT and XLYPCT > SNPPCT then Color.PINK else if XLYPCT > 0 then Color.GREEN else Color.RED
);
#############################
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLP: " + AsPercent(XLPPCT) + "", if XLPPCT > XLFPCT and XLPPCT > XLVPCT and XLPPCT > XLIPCT and XLPPCT > XLBPCT and XLPPCT > XLCPCT and XLPPCT > XLREPCT and XLPPCT > XLUPCT and XLPPCT > XLEPCT and XLPPCT > XLCPCT and XLPPCT > QQQPCT and XLPPCT > IWMPCT and XLPPCT > XLYPCT and XLPPCT > SNPPCT then Color.PINK else if XLPPCT > 0 then Color.GREEN else Color.RED
);
#############
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLE: " + AsPercent(XLEPCT) + "", if XLEPCT > XLFPCT and XLEPCT > XLVPCT and XLEPCT > XLPPCT and XLEPCT > XLBPCT and XLEPCT > XLCPCT and XLEPCT > XLREPCT and XLEPCT > XLUPCT and XLEPCT > XLIPCT and XLEPCT > XLCPCT and XLEPCT > QQQPCT and XLEPCT > IWMPCT and XLEPCT > XLYPCT and XLEPCT > SNPPCT then Color.PINK else if XLEPCT > 0 then Color.GREEN else Color.RED
);
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLF: " + AsPercent(XLFPCT) + "", if XLFPCT > XLVPCT and XLFPCT > XLIPCT and XLFPCT > XLBPCT and XLFPCT > XLREPCT and XLFPCT > XLKPCT and XLFPCT > XLUPCT and XLFPCT > XLEPCT and XLFPCT > XLPPCT and XLFPCT > XLCPCT and XLFPCT > QQQPCT and XLFPCT > IWMPCT and XLFPCT > XLYPCT and XLFPCT > SNPPCT then Color.PINK else if XLFPCT > 0 then Color.GREEN else Color.RED
);
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLV: " + AsPercent(XLVPCT) + "", if XLVPCT > XLFPCT and XLVPCT > XLIPCT and XLVPCT > XLBPCT and XLVPCT > XLREPCT and XLVPCT > XLKPCT and XLVPCT > XLUPCT and XLVPCT > XLEPCT and XLVPCT > XLPPCT and XLVPCT > XLCPCT and XLVPCT > QQQPCT and XLVPCT > IWMPCT and XLVPCT > XLYPCT and XLVPCT > SNPPCT then Color.PINK else if XLVPCT > 0 then Color.GREEN else Color.RED
);
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLI: " + AsPercent(XLIPCT) + "", if XLIPCT > XLFPCT and XLIPCT > XLVPCT and XLIPCT > XLBPCT and XLIPCT > XLREPCT and XLIPCT > XLKPCT and XLIPCT > XLUPCT and XLIPCT > XLEPCT and XLIPCT > XLPPCT and XLIPCT > XLCPCT and XLIPCT > QQQPCT and XLIPCT > IWMPCT and XLIPCT > XLYPCT and XLIPCT > SNPPCT then Color.PINK else if XLIPCT > 0 then Color.GREEN else Color.RED
);
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLB: " + AsPercent(XLBPCT) + "", if XLBPCT > XLFPCT and XLBPCT > XLVPCT and XLBPCT > XLPPCT and XLBPCT > XLREPCT and XLBPCT > XLKPCT and XLBPCT > XLUPCT and XLBPCT > XLEPCT and XLBPCT > XLPPCT and XLBPCT > XLCPCT and XLBPCT > QQQPCT and XLBPCT > IWMPCT and XLBPCT > XLYPCT and XLBPCT > SNPPCT then Color.PINK else if XLBPCT > 0 then Color.GREEN else Color.RED
);
##########
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLRE: " + AsPercent(XLREPCT) + "", if XLREPCT > XLFPCT and XLREPCT > XLVPCT and XLREPCT > XLPPCT and XLREPCT > XLBPCT and XLREPCT > XLKPCT and XLREPCT > XLUPCT and XLREPCT > XLEPCT and XLREPCT > XLPPCT and XLREPCT > XLCPCT and XLREPCT > QQQPCT and XLREPCT > IWMPCT and XLREPCT > XLYPCT and XLREPCT > SNPPCT then Color.PINK else if XLREPCT > 0 then Color.GREEN else Color.RED
);
##############################
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLK: " + AsPercent(XLKPCT) + "", if XLKPCT > XLFPCT and XLKPCT > XLVPCT and XLKPCT > XLPPCT and XLKPCT > XLBPCT and XLKPCT > XLUPCT and XLKPCT > XLREPCT and XLKPCT > XLEPCT and XLKPCT > XLPPCT and XLKPCT > XLCPCT and XLKPCT > QQQPCT and XLKPCT > IWMPCT and XLKPCT > XLYPCT and XLKPCT > SNPPCT then Color.PINK else if XLKPCT > 0 then Color.GREEN else Color.RED
);
###########################
DefineGlobalColor("LabelColor", Color.LIGHT_GRAY);
AddLabel(yes,"XLU: " + AsPercent(XLUPCT) + "", if XLUPCT > XLFPCT and XLUPCT > XLVPCT and XLUPCT > XLPPCT and XLUPCT > XLBPCT and XLUPCT > XLCPCT and XLUPCT > XLREPCT and XLUPCT > XLEPCT and XLUPCT > XLPPCT and XLUPCT > XLCPCT and XLUPCT > QQQPCT and XLUPCT > IWMPCT and XLUPCT > XLYPCT and XLUPCT > SNPPCT then Color.PINK else if XLUPCT > 0 then Color.GREEN else Color.RED
);
V2 CODE :
Code:
input SNP = "SPY";
input IWM = "IWM";
input QQQ = "QQQ";
input XLC = "XLC";
input XLY = "XLY";
input XLP = "XLP";
input XLE = "XLE";
input XLF = "XLF";
input XLV = "XLV";
input XLI = "XLI";
input XLB = "XLB";
input XLRE = "XLRE";
input XLK = "XLK";
input XLU = "XLU";
def IWMC = close(IWM, period = AggregationPeriod.DAY);
def IWMH = high(IWM, period = AggregationPeriod.DAY)[1];
def IWML = low(IWM, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"IWM", if IWMC>IWMH then Color.GREEN else if IWMC < IWML then Color.RED else Color.WHITE);
def QQQC = close(QQQ, period = AggregationPeriod.DAY);
def QQQH = high(QQQ, period = AggregationPeriod.DAY)[1];
def QQQL = low(QQQ, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"QQQ", if QQQC>QQQH then Color.GREEN else if QQQC < QQQL then Color.RED else Color.WHITE);
def XLCC = close(XLC, period = AggregationPeriod.DAY);
def XLCH = high(XLC, period = AggregationPeriod.DAY)[1];
def XLCL = low(XLC, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLC", if XLCC>XLCH then Color.GREEN else if XLCC < XLCL then Color.RED else Color.WHITE);
def XLYC = close(XLY, period = AggregationPeriod.DAY);
def XLYH = high(XLY, period = AggregationPeriod.DAY)[1];
def XLYL = low(XLY, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLY", if XLYC>XLYH then Color.GREEN else if XLYC < XLYL then Color.RED else Color.WHITE);
def XLPC = close(XLP, period = AggregationPeriod.DAY);
def XLPH = high(XLP, period = AggregationPeriod.DAY)[1];
def XLPL = low(XLP, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLP", if XLPC>XLPH then Color.GREEN else if XLPC < XLPL then Color.RED else Color.WHITE);
def XLEC = close(XLE, period = AggregationPeriod.DAY);
def XLEH = high(XLE, period = AggregationPeriod.DAY)[1];
def XLEL = low(XLE, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLE", if XLEC>XLEH then Color.GREEN else if XLEC < XLEL then Color.RED else Color.WHITE);
def XLFC = close(XLF, period = AggregationPeriod.DAY);
def XLFH = high(XLF, period = AggregationPeriod.DAY)[1];
def XLFL = low(XLF, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLF", if XLFC>XLFH then Color.GREEN else if XLFC < XLFL then Color.RED else Color.WHITE);
def XLVC = close(XLV, period = AggregationPeriod.DAY);
def XLVH = high(XLV, period = AggregationPeriod.DAY)[1];
def XLVL = low(XLV, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLV", if XLVC>XLVH then Color.GREEN else if XLVC < XLVL then Color.RED else Color.WHITE);
def XLIC = close(XLI, period = AggregationPeriod.DAY);
def XLIH = high(XLI, period = AggregationPeriod.DAY)[1];
def XLIL = low(XLI, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLI", if XLIC>XLIH then Color.GREEN else if XLIC < XLIL then Color.RED else Color.WHITE);
def XLREC = close(XLRE, period = AggregationPeriod.DAY);
def XLREH = high(XLRE, period = AggregationPeriod.DAY)[1];
def XLREL = low(XLRE, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLRE", if XLREC>XLREH then Color.GREEN else if XLREC < XLREL then Color.RED else Color.WHITE);
def XLKC = close(XLK, period = AggregationPeriod.DAY);
def XLKH = high(XLK, period = AggregationPeriod.DAY)[1];
def XLKL = low(XLK, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLK", if XLKC>XLKH then Color.GREEN else if XLKC < XLKL then Color.RED else Color.WHITE);
def XLBC = close(XLB, period = AggregationPeriod.DAY);
def XLBH = high(XLB, period = AggregationPeriod.DAY)[1];
def XLBL = low(XLB, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLB", if XLBC>XLBH then Color.GREEN else if XLBC < XLBL then Color.RED else Color.WHITE);
def XLUC = close(XLU, period = AggregationPeriod.DAY);
def XLUH = high(XLU, period = AggregationPeriod.DAY)[1];
def XLUL = low(XLU, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"XLU", if XLUC>XLUH then Color.GREEN else if XLUC < XLUL then Color.RED else Color.WHITE);
def SNPC = close(SNP, period = AggregationPeriod.DAY);
def SNPH = high(SNP, period = AggregationPeriod.DAY)[1];
def SNPL = low(SNP, period = AggregationPeriod.DAY)[1];
AddLabel(yes,"SPY", if SNPC>SNPH then Color.GREEN else if SNPC < SNPL then Color.RED else Color.WHITE);