Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by ty · Oct 15, 2020 at 06:10 PM · pythonpython apirspotdate

Trying to get forex forward curve historic, problems with NDA_RAW fields and Spot Date

Hi, I'm trying to get the EUR (for example) forward curve from yesterday and the day before.

So, in Excel, I got:

=@RHistory("EUR1M=";"NDA_RAW.Nda_date;NDA_RAW.Nda_ask;NDA_RAW.Nda_bid;NDA_RAW.Nda_days_maturity";"START:2020-10-07 END:2020-10-14 CODE:MULTI INTERVAL:1D";;"CH:IN;Fd";)

This gives me the Date, Bid, Ask and Days for Maturity for the 1M vertice. But NO Spot Date is given.

Even so, I tried:

get_data(instruments = "EUR1M=",
         fields = list("NDA_RAW.Nda_date", "NDA_RAW.Nda_ask", "NDA_RAW.Nda_bid", "NDA_RAW.Nda_days_maturity"),
         parameters = list("Frq" = "D",
                           "SDate" = format(Sys.Date() - 7, "%Y-%m-%d"),
                           "EDate" = format(Sys.Date() - 1, "%Y-%m-%d")))

and

get_timeseries(rics = "EUR1M=",
               fields = list("NDA_RAW.Nda_date", "NDA_RAW.Nda_ask", "NDA_RAW.Nda_bid", "NDA_RAW.Nda_days_maturity"),
               interval = "daily",
               start_date = paste0(Sys.Date() - 7, "T00:00:00"),
               end_date = paste0(Sys.Date() - 1, "T00:00:00"))

But none work.

If I want the Spot Date, in Excel:

=@TR("EUR1M=";"GV1_DATE;MATUR_DATE;DAYS_MAT";"Frq=D SDate=0 EDate=-8 CH=Fd RH=IN CODE=MULTI";G6)

Unfortunately this gives me just the Spot Date for the current cotation, NOT the yesterday or some historical date.

There are other problems like.. I want the outright and the RIC to gives me that is EUR1MV=, but this RIC don't work as well. This solution will have to be extended later to all tenors: SN, SW, 2W, 3W, 1M, 2M, ... 11M, 1Y, ... 2Y and other currencies.

What is the best way (preference in R or Python) to get those information, so I can have a table like that:

RIC    | Date       | Spot       | Expiring   | Mat_Days | Bid      | Ask
EUR1M= | 2020-10-14 | 2020-10-16 | 2020-11-16 | 31       | 1.169484 | 1.169718
EUR1M= | 2020-10-13 | 2020-10-15 | 2020-11-16 | 32       | 1.169524 | 1.170026

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by chavalit.jintamalit · Oct 16, 2020 at 01:06 AM

Hi @ty

Please refer to the answer from this question.


And this is more information for your API call.

1. Eikon Data API (get_timeseries) cannot access to view other than RIC's default view.


2. GV1_DATE, MATUR_DATE and DAYS_MAT fields are from realtime database so it does not support timeseries retrieval.

You can use "Data Item Browser" to check the fields supported parameters.


ahs1.png (111.4 KiB)
ahs2.png (68.4 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by marcin.bunkowski · Oct 20, 2020 at 09:42 AM

Hi @ty

I think that you can still make it using the example privided in this answer and doing it for series of valuation dates. The same can be done with tenors.

for single_date in daterange(start_date, end_date):
    tenor="1M"
    crosscode="EURUSD"   
    fwd_contract = cross.Definition(fx_cross_code=crosscode,
                                    instrument_tag=crosscode[:3]+tenor,
                                    fx_cross_type='FxForward',
                                    legs = [cross.LegDefinition(tenor=tenor)])
    response = fc.get_cross_analytics(fwd_contract, 
                                      fields = ['InstrumentTag', 'ValuationDate','StartDate','EndDate','FxSwapsCcy1Ccy2'],
                                      calculation_params = cross.CalculationParams(valuation_date=single_date.strftime("%Y-%m-%d")))
    result.append(response.data.df)
df = pd.concat(result)
df['StartDate'] = pd.to_datetime(df['StartDate'])
df['EndDate'] = pd.to_datetime(df['EndDate'])
df['ValuationDate'] = pd.to_datetime(df['ValuationDate'])
df["Mat_days"]= df['EndDate']-df['StartDate'] 
df["StartDate"] = df["StartDate"].dt.strftime("%Y-%m-%d")
df["EndDate"] = df["EndDate"].dt.strftime("%Y-%m-%d")
df["ValuationDate"] = df["ValuationDate"].dt.strftime("%Y-%m-%d")
df


ahs.jpg (32.5 KiB)
Comment
ty

People who like this

1 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
ty · Oct 20, 2020 at 01:36 PM 0
Share

Thank you @marcin.bunkowski! I'm trying to get the most from Refinitiv APIs, but it's hard sometimes to get what I want. Do you recomend any manual to learn more? I just use get.data and get.timeseries with DIB, but you gave me this new library solution and someone show me the raw_output option for another problem; both great solutions.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
11 People are following this question.

Related Questions

Why do TR.CurrEVEBITDALFY and TR.HistEnterpriseValueEBITDA differ?

How do I download Historical Data from Starmine?

Find or calculate intraday volatility.

How to get list of leaver companies of the ASX 100 using the Python API?

Python Data retrieving

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges