Hi Can anyone help me to add percent yield label to my charts, I saw one of the TD education coaches use and as DGI it would help me a lot. Thanks a lot. I found this searching but something is wrong and not getting the right data
def DivPayout = if IsNaN(DividendPayout())
then DivPayout[1]
else DividendPayout();
AddLabel(show_labels and DivPayout, "Dividend Payout = " + round(DivPayout,2) + "%", GlobalColor("neutral"));
def DivPerShare = if IsNaN(DividendsPerShareTTM())
then DivPerShare[1]
else DividendsPerShareTTM();
AddLabel(show_labels and DivPerShare, "Dividend Per Share = " + AsDollars(DivPerShare), GlobalColor("neutral"));
def DivYield = if IsNaN(DividendsPerShareTTM())
then DivPerShare[1]
else DividendsPerShareTTM()/Close;
AddLabel(show_labels and DivPerShare, "Dividend Yield = " + AsPercent(DivYield), GlobalColor("neutral"));
def DivPayout = if IsNaN(DividendPayout())
then DivPayout[1]
else DividendPayout();
AddLabel(show_labels and DivPayout, "Dividend Payout = " + round(DivPayout,2) + "%", GlobalColor("neutral"));
def DivPerShare = if IsNaN(DividendsPerShareTTM())
then DivPerShare[1]
else DividendsPerShareTTM();
AddLabel(show_labels and DivPerShare, "Dividend Per Share = " + AsDollars(DivPerShare), GlobalColor("neutral"));
def DivYield = if IsNaN(DividendsPerShareTTM())
then DivPerShare[1]
else DividendsPerShareTTM()/Close;
AddLabel(show_labels and DivPerShare, "Dividend Yield = " + AsPercent(DivYield), GlobalColor("neutral"));