tradegoals23
New member
Hello all, I have a sector comparison chart I am using to determine leading sectors that day. I am writing to see if anyone can help me code this to reflect add Percent change from previous day's close to current value of the labels at the top right of the charte.. I would like to keep the current price and add the % changed to the label. For example: "VGT: 602.16 3.5%". Additionally, I would like a label bubble on the comparison item for easy reference when looking at the line chart.
Currently my code is as follows and only shows current value and I am using with comparison study. I have added images as well.
def VGT = Close ("VGT");
def XLF = Close ("XLF");
def XLV = Close("XLV");
def XLY = Close ("XLY");
def XLC = Close ("XLC");
def XLI = Close("XLI");
def XLP = Close ("XLP");
def XLE = Close ("XLE");
def XLU = Close("XLU");
def XLB = Close ("XLB");
def VNQ = Close ("VNQ");
AddLabel(Yes,"VGT: " + VGT, Color.Plum);
AddLabel(Yes,"XLF: " + XLF, Color.Cyan);
AddLabel(Yes,"XLV: " + XLV, Color.Magenta);
AddLabel(Yes,"XLY: " + XLY, Color.Violet);
AddLabel(Yes,"XLC: " + XLC, Color.Yellow);
AddLabel(Yes,"XLI: " + XLI, Color.Light_red);
AddLabel(Yes,"XLP: " + XLP, Color.Light_green);
AddLabel(Yes,"XLE: " + XLE, Color.Gray);
AddLabel(Yes,"XLU: " + XLU, Color.White);
AddLabel(Yes,"XLB: " + XLB, Color.Blue);
AddLabel(Yes,"VNQ: " + VNQ, Color.Pink);
I am not a coder so it's been difficult to learn via snippets of other codes. So please keep this in mind and forgive me if I am missing some information. Thank you a ton in advance.
Currently my code is as follows and only shows current value and I am using with comparison study. I have added images as well.
def VGT = Close ("VGT");
def XLF = Close ("XLF");
def XLV = Close("XLV");
def XLY = Close ("XLY");
def XLC = Close ("XLC");
def XLI = Close("XLI");
def XLP = Close ("XLP");
def XLE = Close ("XLE");
def XLU = Close("XLU");
def XLB = Close ("XLB");
def VNQ = Close ("VNQ");
AddLabel(Yes,"VGT: " + VGT, Color.Plum);
AddLabel(Yes,"XLF: " + XLF, Color.Cyan);
AddLabel(Yes,"XLV: " + XLV, Color.Magenta);
AddLabel(Yes,"XLY: " + XLY, Color.Violet);
AddLabel(Yes,"XLC: " + XLC, Color.Yellow);
AddLabel(Yes,"XLI: " + XLI, Color.Light_red);
AddLabel(Yes,"XLP: " + XLP, Color.Light_green);
AddLabel(Yes,"XLE: " + XLE, Color.Gray);
AddLabel(Yes,"XLU: " + XLU, Color.White);
AddLabel(Yes,"XLB: " + XLB, Color.Blue);
AddLabel(Yes,"VNQ: " + VNQ, Color.Pink);
I am not a coder so it's been difficult to learn via snippets of other codes. So please keep this in mind and forgive me if I am missing some information. Thank you a ton in advance.