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

Fixed open figi mapping for FX #174

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def _ticker_from_openfigi_response(self, contract_data: Dict[str, str], figi: st
'Equity': (SecurityType.STOCK, ['ticker', 'exchCode', 'marketSector']),
'Mutual Fund': (SecurityType.STOCK, ['ticker', 'exchCode', 'marketSector']),
'Future': (SecurityType.FUTURE, ['ticker', 'marketSector']),
'CROSS': (SecurityType.FX, ['ticker', 'marketSector']),
'SPOT': (SecurityType.FX, ['ticker', 'marketSector']),
'CROSS': (SecurityType.FX, ['securityDescription']),
'SPOT': (SecurityType.FX, ['securityDescription']),
}

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ def test_incorrect_figi_to_ticker__no_data_preloading(self):
def test_figi_to_ticker__no_data_preloading(self):
mapper = BloombergTickerMapper(data_caching=False)

figis = ["BBG000H4FSM0", "BBG000BDTBL9", "BBG0013HFN45"]
figis = ["BBG000H4FSM0", "BBG000BDTBL9", "BBG0013HQFX8", "BBG0013HFN45"]
expected_tickers = [BloombergTicker("SPX Index", SecurityType.INDEX),
BloombergTicker("SPY US Equity", SecurityType.STOCK),
BloombergTicker("EURCHF Curncy", SecurityType.FX),
BloombergTicker("USDCHF Curncy", SecurityType.FX)]

for figi, ticker in zip(figis, expected_tickers):
Expand Down
Loading