# Yield and interest rate - underlying

#### M1keG

##### New member
Is there a function to obtain the interest rate and yield of the underlying ? (Options )….similar to, for example imp_volatility is to obtain the IV. Can’t find under fundamentals or other lists…

ToS displays both these numbers when using the risk analysis tool …I‘d like to automate its entry in an excel spreadsheet I use for scenario analysis of a large number of calendar spreads for SPX

tks!
Miguel G.

Solution
Is there a function to obtain the interest rate and yield of the underlying ? (Options )….similar to, for example imp_volatility is to obtain the IV. Can’t find under fundamentals or other lists…

ToS displays both these numbers when using the risk analysis tool …I‘d like to automate its entry in an excel spreadsheet I use for scenario analysis of a large number of calendar spreads for SPX

tks!
Miguel G.
Yield:
Code:
``````def DivYield = if IsNaN(DividendsPerShareTTM())
then DivPerShare[1]
else DividendsPerShareTTM()/Close;``````
Interest Rate:
Code:
``````def Interest_Rate = if IsNaN(InterestRate())
then Interest_Rate[1]
else InterestRate();``````

Calculations for all...

#### MerryDay

Staff member
Staff
VIP
Is there a function to obtain the interest rate and yield of the underlying ? (Options )….similar to, for example imp_volatility is to obtain the IV. Can’t find under fundamentals or other lists…

ToS displays both these numbers when using the risk analysis tool …I‘d like to automate its entry in an excel spreadsheet I use for scenario analysis of a large number of calendar spreads for SPX

tks!
Miguel G.
Yield:
Code:
``````def DivYield = if IsNaN(DividendsPerShareTTM())
then DivPerShare[1]
else DividendsPerShareTTM()/Close;``````
Interest Rate:
Code:
``````def Interest_Rate = if IsNaN(InterestRate())
then Interest_Rate[1]
else InterestRate();``````

Calculations for all available fundamentals:

#### M1keG

##### New member
Tks for sharing, sorry not an expert programming but these I understand are routines for running in ToS correct?, I’m looking for RTD functions to import data into excel (handle dozens of calendar spreads)…

#### MerryDay

Staff member
Staff
VIP
Tks for sharing, sorry not an expert programming but these I understand are routines for running in ToS correct?, I’m looking for RTD functions to import data into excel (handle dozens of calendar spreads)…
Yes, the above formulas are necessary to define the data you want to pull from ToS.
The routine to interface the ToS to Excel is beyond the scope of this forum but can be found with a Google search:

#### M1keG

##### New member
Tks, very familiar with that already, just still cant find an answer to my specific question anywhere.

Custom Dividend Yield Quote Column Questions 4
Percent yield label Questions 9
Yield Curve Chart Indicator for ThinkorSwim Indicators 13
Open Interest OI Questions 1
interest rates indicator Questions 2

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?