Yield Curve Chart Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
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
 

Attachments

  • YzlTIlV.png
    YzlTIlV.png
    184.1 KB · Views: 184
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 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));
 
I like to invert the 10-year Yield TNX by adding a minus thus -TNX in a Study-Comparison indicator on the charts. This makes it easy to see gaps and correlations between the ticker and the Yield.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
413 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top