In order to save chart space and keep charts uncluttered I created a label for the 10 Yr Treasury Yield as follows:
It seems to work well. I also created a label for the 30 Yr Treasury Yield as Follows:
Interestingly, the 30 Yr Treasury Yield label is not working as it is not displayed on my chart...
hmm...any ideas?
Code:
def AD_Trend_Length = 1;
def AD = close("/10Y" );
def ADtrend = Average(AD[1], 1);
AddLabel(AD > ADtrend, "10Y: " + Round(AD, 2) , #Color.Dark_GRAY);#
Color.Dark_Green);
AddLabel(AD <= ADtrend, "10Y: " + Round(AD, 2) , #Color.Dark_GRAY);#
Color.Dark_Red);
### End Script
It seems to work well. I also created a label for the 30 Yr Treasury Yield as Follows:
Code:
def AD_Trend_Length = 1;
def AD = close("/30Y" );
def ADtrend = Average(AD[1], 1);
AddLabel(AD > ADtrend, "30Y: " + Round(AD, 2) , #Color.Dark_GRAY);#
Color.Dark_Green);
AddLabel(AD <= ADtrend, "30Y: " + Round(AD, 2) , #Color.Dark_GRAY);#
Color.Dark_Red);
### End Script
Interestingly, the 30 Yr Treasury Yield label is not working as it is not displayed on my chart...
hmm...any ideas?