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 /

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by danielbarroso · Apr 09, 2020 at 04:59 PM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikon

Python Eikon Integration - Function "FxCalcPeriod()"

Good afternoon,


At the organization I work at, we have been using python to integrate with Eikon to retrieve FX rates, Libor, Euribors and so on sucessfully.

Now we face a new challenge, which is: how to call the “=FxCalcPeriod()” function from a Python code and get the results from Eikon. This is the sample code we got in the Eikon Adfin Forex Calculation Guide: “=FxCalcPeriod("24FEB03";"EUR";"3M";"FROM:FXTRADE")”. We would like to know how to invoke it from Python x Eikon integration.

Thank you.

Regards,

Daniel Barroso


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.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov.1 · Apr 14, 2020 at 03:32 PM

FxCalcPeriod function is currently only available through a COM library known as AdfinX Analytics. It's possible to use this library in Python, although the use is not very straightforward and it's only possible in 32-bit Python. Here's an article that talks about using AdfinX Analytics COM library in Python.

https://developers.refinitiv.com/article/using-adfinx-analytics-python

Going forward we will be replacing Adfin Analytics client side libraries with Instrument Pricing Analytics (IPA) service on Refinitiv Data Platform that will provide equivalent calculations. The documentation for FX Cross contracts pricing is already published and there's a tutorial on using IPA service in Python. However currently this service is only available with credentials for Refinitiv Data Platform. We expect to make it available to Eikon users later this year.

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
Answer by przemyslaw.kowalec · Jul 21, 2020 at 10:33 AM

Hi, Could you send more information about instrument Pricing Analytics (IPA) for Eikon user?


What technology will you be able to connect to use and download data? when do you plan to implement? will it be possible to download data via websocket?
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 Alex Putkov.1 · Jul 21, 2020 at 01:58 PM

@przemyslaw.kowalec

IPA is now available to Eikon and Refinitiv Workspace users. You need to use Refinitiv Data Platform Library to access it. There are some examples available in recently launched Codebook service. Specifically, after launching Codebook, have a look at the following Jupyter notebooks under Examples/02 - Refinitiv Data Platform Library/

1.7.0 - Function - IPA - Bond Pricing
1.7.1 - Function - IPA - Option Pricing
2.7.0 - Content - FinancialContracts - Synchronous
2.7.1 - Content - FinancialContracts - Asynchronous
2.7.2 - Content - FinancialContracts - EventDriven

All of the above mentioned examples use IPA service with Eikon or Refinitiv Workspace account.

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 maria.vieira · Apr 26 at 05:06 PM

@danielbarroso

This is how to do it (I used the argument of FxCalcPeriod for my needs, but one can change that). Note that you have to be running this on Python 32 and follow the steps in

https://developers.refinitiv.com/en/article-catalog/article/using-adfinx-analytics-in-python

to install what you need.

####

import pythoncom

import win32com.client

import datetime

import time

from enum import Enum

import sys



class ConnectionToEikonEnum(Enum):

Error_InitializeFail =2 # from enum EEikonDataAPIInitializeResult

Error_Reinitialize =1 # from enum EEikonDataAPIInitializeResult

Succeed =0 # from enum EEikonDataAPIInitializeResult

Connected =1 # from enum EEikonStatus

Disconnected =0 # from enum EEikonStatus

Disconnected_No_license_agreement_sign_off=8 # from enum EEikonStatus

LocalMode =2 # from enum EEikonStatus

Offline =4 # from enum EEikonStatus


#Calls to methods in AdfinX Analytics library can only be made while our application is connected to Eikon

#This variable is used to tell whether our Python application is connected to Eikon and therefore can make calls to AdfinX Analytics

connectedToEikon = False


class EikonDesktopDataAPI_EventHandler:

def OnStatusChanged(self, EStatus):

if EStatus == ConnectionToEikonEnum.Connected.value or EStatus == ConnectionToEikonEnum.LocalMode.value:

print("EikonDesktopDataAPI is connected in regular or local mode")

global connectedToEikon

connectedToEikon = True

elif EStatus == ConnectionToEikonEnum.Disconnected.value:

print("EikonDesktopDataAPI is disconnected or not initialized")

elif EStatus == ConnectionToEikonEnum.Disconnected_No_license_agreement_sign_off.value:

print("EikonDesktopDataAPI is disconnected because the user did not accept license agreement")

elif EStatus == ConnectionToEikonEnum.Offline.value:

print("EikonDesktopDataAPI has lost connection to the platform due to network or platform issue")


#This creates an instance of EikonDesktopDataAPI object used to manage the connection between our Python application and Eikon

connectionToEikon = win32com.client.DispatchWithEvents("EikonDesktopDataAPILib.EikonDesktopDataAPI", EikonDesktopDataAPI_EventHandler)

print("Connecting to Eikon...")


if not connectedToEikon:

retval = connectionToEikon.Initialize()

if retval != ConnectionToEikonEnum.Succeed.value:

print("Failed to initialize Eikon Desktop Data API")

sys.exit()

else:

print("Already connected to Eikon")


while True:


try:

time.sleep(1)

except KeyboardInterrupt:

print("KeyboardInterrupt")

break


#Windows message pump is required for COM objects to be able to raise events

pythoncom.PumpWaitingMessages()


if connectedToEikon:

#This creates an instance of CreateAdxForexModule object from AdfinX Analytics library

FXModule = connectionToEikon.CreateAdxForexModule()

fx_calc_date = pythoncom.MakeTime(datetime.date(2022,4,26))


try:

solve_fx = FXModule.FxCalcPeriod(fx_calc_date,"EUR","1Y","FROM:MMTRADE")

print ("Solve fx:")

print (solve_fx)

except pythoncom.com_error as e:

print (str(e))


break



Comment

People who like this

0 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
REFINITIV
maria.vieira · Apr 26 at 05:11 PM 0
Share

Note the output is in the form of numbers such as 44679. These are the number of days counted from 1899-12-30 (not 31).

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 >
15 People are following this question.

Related Questions

How to get all investors for a list of stocks, historically with the python API

Download API Proxy Python for Windows.

What other parameters can be used with the statement pertaining to Corporate Actions data such as Stock Splits?

Company trees don't match in Eikon online tool and the Eikon Proxy API

Trying to fetch Close Bid Price for CMO tranche from Python

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • 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
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges