Skip to content

Commit

Permalink
Fixed open figi mapping for FX (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
myrmarachne committed Jul 10, 2024
1 parent b6eba1e commit ce23e9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit ce23e9c

Please sign in to comment.