Back to Community
Adding treasury constant and bill

Hello,

I want to back test a strategy by comparing both "10 year treasury constant maturity rate" and "3 month treasury bill".
Anyone knows how get the values?

Thanks in advanced.

4 responses

Hi Karl Mun,

Thanks, but what i need to know is how to get the values at a specific time in Quantopian.
Any example commands?

Hi Karl. Yes, i am trying to feed the values into the Quantopian research algorithm to backtest a strategy.

I googled and managed to find some ideas on how to get the rate values.
Unfortunately, it doesn't give me the rate. All i get is "float64".

Can someone please assist?

from quantopian.pipeline.data.quandl import fred_dgs10

def initialize (context):  
    schedule_function(monthly, date_rules.month_start(), time_rules.market_open())

def monthly(context, data):  
    print(fred_dgs10.value)