Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BDH override pricing source doesn't change prices #32

Open
arbitrager44 opened this issue Feb 16, 2020 · 0 comments
Open

BDH override pricing source doesn't change prices #32

arbitrager44 opened this issue Feb 16, 2020 · 0 comments

Comments

@arbitrager44
Copy link

I have the code below to pull the historic prices from a set of corporate bonds. If I run the code, the price output is exactly the same despite the overrides. If we look at the prices in BB using a simple HP and changing the source, the prices are indeed different. What am I doing wrong here?

import pandas as pd
import datetime
import pybbg
import numpy as np

con = pybbg.Pybbg()
cusips = ['00774MAC9 Corp', '20848FAA8 Corp', '073685AD1 Corp', 
		'032654AJ4 Corp', '03027XAM2 Corp', '92343VER1 Corp',
		'92343VES9 Corp', '952845AE5 Corp']

end_dt = datetime.date.today()
delta = datetime.timedelta(days = 180)
st_dt = end_dt - delta
st_dt = st_dt.strftime('%Y%m%d')
end_dt = end_dt.strftime('%Y%m%d')

trial_1 = con.bdh(cusips, 'Px_mid', st_dt, end_dt)
trial_1.sort_index(inplace=True)
print(trial_1)


trial_2 = con.bdh(cusips, 'Px_mid', st_dt, end_dt, 
		overrides={'Pricing_source':'BVAL'})
trial_2.sort_index(inplace=True)
print(trial_2)

trial_3 = con.bdh(cusips, 'Px_mid', st_dt, end_dt, 
		overrides={'Pricing_source':'TRAC'})
trial_3.sort_index(inplace=True)
print(trial_3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant