ERHorner
New member
I'm looking for assistance with adding AddLabel for each of the following: "spx", "djx", "ndx", "hui", "xau", "rut", "vix", "tnx". I would like to have the most current prices listed and to have the color of the label change based on the previous day closing price for each (Green for uptrend and Red for downtrend. Thank you for your help!
Below is what I have created so far. I know it's not correct, but wanted to give it a try based on some of the other scripts I've looked at. I just know know how to add the current prices or how to add the correct formula.
declare lower;
input n = close;
input o = open;
input spx = open;
AddLabel (Yes, “spx “ + close, if(spx<=open) then Color.GREEN else Color.Red);
def spx_1 = spx;
addlabel(1, "spx : " + Round(spx_1,2) + (if spx then " RISING "
else if spx then " FALLING "
else " NEUTRAL"),
if spx then Color.GREEN else if spx then Color.PINK else Color.YELLOW);
input djx = open;
AddLabel (Yes, “djx “ + close, if(djx<=open) then Color.GREEN else Color.Red);
input ndx = open;
AddLabel (Yes, “ndx “ + close, if(ndx<=open) then Color.GREEN else Color.Red);
input hui = open;
AddLabel (Yes, “hui “ + close, if(hui<=open) then Color.GREEN else Color.Red);
input xau = open;
AddLabel (Yes, “xau “ + close, if(xau<=open) then Color.GREEN else Color.Red);
input rut = open;
AddLabel (Yes, “rut “ + close, if(rut<=open) then Color.GREEN else Color.Red);
input vix = open;
AddLabel (Yes, “vix “ + close, if(vix<=open) then Color.GREEN else Color.Red);
input tnx = open;
AddLabel (Yes, “tnx “ + close, if(tnx<=open) then Color.GREEN else Color.Red);
Below is what I have created so far. I know it's not correct, but wanted to give it a try based on some of the other scripts I've looked at. I just know know how to add the current prices or how to add the correct formula.
declare lower;
input n = close;
input o = open;
input spx = open;
AddLabel (Yes, “spx “ + close, if(spx<=open) then Color.GREEN else Color.Red);
def spx_1 = spx;
addlabel(1, "spx : " + Round(spx_1,2) + (if spx then " RISING "
else if spx then " FALLING "
else " NEUTRAL"),
if spx then Color.GREEN else if spx then Color.PINK else Color.YELLOW);
input djx = open;
AddLabel (Yes, “djx “ + close, if(djx<=open) then Color.GREEN else Color.Red);
input ndx = open;
AddLabel (Yes, “ndx “ + close, if(ndx<=open) then Color.GREEN else Color.Red);
input hui = open;
AddLabel (Yes, “hui “ + close, if(hui<=open) then Color.GREEN else Color.Red);
input xau = open;
AddLabel (Yes, “xau “ + close, if(xau<=open) then Color.GREEN else Color.Red);
input rut = open;
AddLabel (Yes, “rut “ + close, if(rut<=open) then Color.GREEN else Color.Red);
input vix = open;
AddLabel (Yes, “vix “ + close, if(vix<=open) then Color.GREEN else Color.Red);
input tnx = open;
AddLabel (Yes, “tnx “ + close, if(tnx<=open) then Color.GREEN else Color.Red);
Last edited: