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
Best Answer
-
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.
0
Answers
-
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")
df1 -
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.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛