I am not able to find any example for retrieving FX currency rates using RFA .NET code. I have downloaded the RFA QuickStart Consumer code, but it is related to market price which is not useful for this purpose.
Hi @anil.s
The above suggests you are getting a Status Messsage response - which should provide some clues, but since this is a very basic example it does not dump the Status out to console.
A few things to check
\Connections\Connection_RSSL\traceMsgToFile = true
The above should generate an XML trace file in the build folder called 'Connection_RSSL_xxxx.xml' which you can upload for analysis.
You can also add some extra code to the ProcessMarketPrice method to dump the Status text out to console when it does not pass the IF statement you mentioned above
if ((respMsg.HintMask & RespMsg.HintMaskFlag.Payload) != 0){ ........}else if ((respMsg.HintMask & RespMsg.HintMaskFlag.RespStatus) != 0){ RespStatus status = respMsg.RespStatus; Console.WriteLine("Status:" + status.StatusText);}
If after confirming your build folder has the correctly populated ExampleRFA.cfg file, you continue to have problems, then please upload the console output and the trace xml file.
If you know the RIC code for the currency rate, you can use that instead of the sample RIC code that is being used in the QuickStart Consumer code.
So, for example if the Quickstart example is using "TRI.N" for the RIC, you could replace this with "EUR=" or "GBP=" for Euro or Sterling related prices.
You can Consume the "CURRENCIES" RIC to get the Currencies Speed Guide page, which lists the codes for other Currency related pages. e.g. "G7CCY/1" details the guide pages for G7 Currencies. The pages show the RIC codes needed to drill down - e.g. "EUR/1" is Euro guide page. From there you can see the various Euro related RICs e.g. EUR="
You can use the convenient GUI viewing tool SpeedGuide to view the above pages.
The term “Market Price” is actually used to denote information which contains trades and quotes. You can retrieve FX rate from Market Price.
In order to retrieve FX rate, you have to specify FX rate's RIC as the item name.
Some sample FX rate RICs are
JPY=GBP=EUR=
The above RICs are USD cross rate. For non-USD cross rates, you have to use "<Currency Code A><Currency Code B>=". For example:
GBPJPY=EURCAD=
(Try swapping A - B currency if the request return not found).
If you need help in finding out the RIC for FX instrument, try the RIC Search tool available in the developers portal in the Home page > under Resources. Type in the name of currency and select FX and Money category to restrict results.
The last entry in the table is a RIC, which can be used in the RFA Quickstart consumer example.
I downloaded SpeedGuide and executed it with my server configuration. localhost:14002. The server is running in the background, however the connection failed with message "Received ChannelDownReconnecting event on channel Channel. Error initializing channel errorid=-1 text=Connection refused"
Update: When my code tries to connect with EZD service (running in the background), it gives error
Static: (Severity) Warning: RSSL Channel closing on connection "Default::Connection_RSSL localhost:14002" due to "channel disconnect"
Here is the log generated after using SpeedGuide. This log entries are taken from ezd.txt located at EZD server installation location.
<LLPC0312.1.ezd: Error: Tue Jan 30 13:32:30.439557 2018>SIPC Server initialization failed on port 14002: <..\..\..\src\ipc\sipcsrvr.c:1062> sipcBindSocket() failed (10048)<END>< LLPC0312.1.ezd: Error: Tue Jan 30 13:32:30.439588 2018>Unable to start Sink Sipc Server.
Now I am able to conenct with EZD server, but my code execution does not pass the following IF condition. It comes out of the IF block.
if ((respMsg.HintMask & RespMsg.HintMaskFlag.Payload) != 0)
I have provided attribute name as "GBPINR=R" and using service "ELEKTRON_DD"
The HintMask coming as 10, Payload coming as 64
I am able to connect with EZD now. There was URL access issue through proxy, which I sorted out to make it work
Thanks @Umar
I filled in the missing port numbers and hostname values in my cfg file and then it started workig. After running the example, I started getting the currency price in console.