lostcoastsurf
Member
Is it possible to do a switch statement or a IF NOT or AND NOT condition?
I'm trying to display one of three different labels base on if the current price is below the entry price by 3% or 5% or 7%, but I do not want to display all three labels, as when the price is 7% down it is also 5% and 3% down.
Something like:
Here's what I have so far.
I'm trying to display one of three different labels base on if the current price is below the entry price by 3% or 5% or 7%, but I do not want to display all three labels, as when the price is 7% down it is also 5% and 3% down.
Something like:
Code:
AddLabel(threeLoss IF NOT fiveLoss, "SELL 1/3");
Here's what I have so far.
Code:
def Entry = if IsNaN(GetAveragePrice()) then Entry[1] else GetAveragePrice();
def cut3 = Entry - (Entry * 0.03);
def cut5 = Entry - (Entry * 0.05);
def cut7 = Entry - (Entry * 0.07);
def sevenLoss = cut7 > close;
def fiveLoss = cut5 > close;
def threeLoss = cut3 > close;
AddLabel(threeLoss, " 3% loss SELL " + Round(cut3, 2));
AddLabel(fiveLoss, " 5% loss SELL " + Round(cut5, 2));
AddLabel(sevenLoss, " 7% loss SELL " + Round(cut7, 2));