felipenoris / BLPData.jl

Julia language wrapper for the Bloomberg™ API
Other
19 stars 4 forks source link

Retrieving data for multiple securities from Bloomberg #16

Closed kasapsalim closed 2 years ago

kasapsalim commented 3 years ago

Hello,

I am rather new to Julia so please forgive me if this is asked before.

I used this in order to get a list of members of a specific stock index:

using BLPData, Dates, DataFrames session=BLPData.Session() xu030=DataFrame(BLPData.bds(session,"XU030 INDEX","INDX_MEMBERS")) .*" EQUITY"

and I can pull data for 2 stocks using

fields = "LAST_PRICE"; # Retrieve data for closing prices fromdate = Date(2021, 8, 2); # Start of date range for historical data todate = Date(2021, 8, 25); # End of date range for historical data

xu030Data=BLPData.bdh(session,["GARAN TI EQUITY","AKBNK TI EQUITY"],[fields], fromdate, todate )

How can I achieve this using xu030 as a multiple list of securities:

xu030Data=BLPData.bdh(session,[xu030],[fields], fromdate, todate )

its very easy ,in matlab:

[d,sec] = history(session,xu030,fields,fromdate,todate,period);

I also could not find an equivalent for this variable:

period = {'daily','non_trading_weekdays','previous_value'};

If there is a compatible way in your wrapper above formula will be like:

xu030Data=BLPData.bdh(session,[xu030],[fields], fromdate, todate ,period)

Thank you!

felipenoris commented 3 years ago

Hi! Yes, this test has an example of optional parameters on stocks: https://github.com/felipenoris/BLPData.jl/blob/23207b2133ad5279020fed9e33b946af3f19945a/test/terminal_testsets.jl#L130