Need an example to retreive RHistory Data using RFA jar.
I need an equivalent of RHistory function present in EIKON in RFA/Elektron.
Need the example in Java/Scala.
Hello @gaurav.gupta2
RFAJava can consume history data i.e. Time Series One (TS1). However, it cannotprovide the function equivalent to RHistory e.g. specific the fields or Startdate and End date. RFA Java will retrieve all fields received from the feedaccording to the request with specific frequency i.e. daily, weekly, andmonthly. To do the equivalent RHistory function, the application has toimplement by itself after it receives historical data from RFA Java.
Fordetail of TS1; historical data that RFA Java consumes, please refer to TS1Reference manual document,[RFAJpackage]\Docs\TS1Data.pdf.
RFA Javaprovides the console application, TimeSeriesConsole , shows how to retrieveTS1 historical data from a remote service, decode it, and print it to theconsole. The source code and its help is in [RFAJpackage]\Examples\com\reuters\rfa\example\omm\idn\tsconsole
Anexample command line running TimeSeriesConsole at [RFAJpackage]\Examples to consume RIC PTT.BK in dailyfor 3 samples:
java -cp .;..\Libs\rfa.jar com.reuters.rfa.example.omm.idn.tsconsole.TimeSeriesConsole -session myNamespace::consSession -serviceName ELEKTRON -itemName PTT.BK -user pimchaya -count 3
For detail of each application’s parameter, please refer to package.html in the TimeSeriesConsolesource code folder.
An example output:
The result is 3 days back from now. I run in the morning 5 Apr. Hence, itshowed the history data of 4,3 and 2 Apr.
To set the frequency to be the other e.g.monthly or weekly, change the period in TS1TimeSeriesparameter in processComplete() method ofTimeSeriesConsole.java for example:
Set to monthly:
TS1TimeSeries timeseries = new TS1TimeSeries(_appContext, itemName, TS1Constants.MONTHLY_PERIOD, count);
Set to weekly:
TS1TimeSeries timeseries = new TS1TimeSeries(_appContext, itemName, TS1Constants.WEEKLY_PERIOD, count);
Then, compile and run it.
Unfortunately, there is no Scala example to retrieve historical data TS1. However, you can develop a Scalaapplication by following TimeSeriesConsole application.