evanevans
Active member
In the following code, I'm working with the GetStrike function but I get the result of NaN for the else side of the final label statement below. Why? I can't for the life of me seem to write a workaround.
Code:
def InPosition = If GetQuantity()<>0 then 1 else 0;
def IsOption = if GetStrike()>0 then 1 else 0;
def Quantity = GetQuantity();
AddLabel(InPosition, Quantity, If Quantity>0 then Color.LIGHT_GREEN else Color.PINK);
AddLabel(InPosition, AsDollars((If IsOption then Quantity*100 else Quantity)*Close), Color.LIGHT_GRAY);