• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Yield Curve Chart Indicator for ThinkorSwim

BenTen

Administrative
Staff
VIP
This indicator was shared by Ken Rose of TD Ameritrade to help you build your own Yield curve chart in ThinkorSwim. Be sure to visit the ToS' settings page and set your chart type to Line.

YzlTIlV.png


thinkScript Code

Code:
#TWITTER: @KROSE_TDA
#Yield curve two indexes
#declare lower;
def barn = if !IsNaN(close) then BarNumber() else Double.NEGATIVE_INFINITY;
input line_Weight = 3;
#input color = ("Light_Background", "Dark_Bacjkground");
Input Bubble_Offset = 12;
################################################
plot ThirtyYear = close("TYX");
thirtyYear.AssignValueColor(color.YELLOW);
thirtyYear.SetLineWeight(line_Weight);
addChartBubble  (barNumber()==highestAll(barn)-bubble_offset,thirtyYear,"30Yr",color.yellow);
#################################################
plot TenYear = close("TNX");
tenYear.AssignValueColor(color.GREEN);
tenYear.SetLineWeight(line_Weight);
addChartBubble  (barNumber()==highestAll(barn)-(bubble_offset -4),tenyear,"10Yr",color.GREEN);
########################################
plot FiveYear = close("FVX");
FiveYear.AssignValueColor(color.LIME);
FiveYear.SetLineWeight(line_Weight);
addChartBubble  (barNumber()==highestAll(barn)-(bubble_offset -6),fiveyear,"5Yr",color.LIME);
########################################
plot Threemonth = close("IRX");
threemonth.AssignValueColor(color.RED);
threemonth.SetLineWeight(line_Weight);
addChartBubble  (barNumber()==highestAll(barn)-(bubble_offset -8),threemonth,"3Mo",color.RED);

Shareable Link

https://tos.mx/EYw42x
 

wilmanv

Member
VIP
How Can I have 3-5 charts in the same window for compared tickers , sample FAANG Ticker, and compare the performance for any time frame

Thanks
 

Jonas99

Active member
VIP
@Jonas99 I believe the answer to whatever you asking is no.
I did it! TNX Label; @MerryDay This is what I am looking for:

Code:
declare upper;
input Temporalidad = AggregationPeriod.day;
Input Indicador=  {"SPY", "QQQ", "DIA", default "TNX"};
input Color_del_recuadro = {"magenta", "green", "pink", default "cyan", "orange", "red", "blue", "gray", "violet"};

def Indicador_ = close(Indicador,period = Temporalidad);

AddLabel(yes, Indicador +": " + Indicador_, GetColor(Color_del_recuadro));
 

Similar threads

Top