|
|
@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
"""# Finance Definitions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Python library defining base types for financial processing.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import abc
|
|
|
|
import abc
|
|
|
|
import dataclasses
|
|
|
|
import dataclasses
|
|
|
|
import datetime
|
|
|
|
import datetime
|
|
|
@ -95,11 +100,11 @@ class CryptoCurrency(Currency):
|
|
|
|
coingecko_id: str | None
|
|
|
|
coingecko_id: str | None
|
|
|
|
|
|
|
|
|
|
|
|
def __post_init__(self):
|
|
|
|
def __post_init__(self):
|
|
|
|
'''TODO
|
|
|
|
"""TODO
|
|
|
|
if not re.match(RE_CRYPTO_TICKER_FORMAT, self.ccxt_symbol):
|
|
|
|
if not re.match(RE_CRYPTO_TICKER_FORMAT, self.ccxt_symbol):
|
|
|
|
msg = f'ccxt_symbol was not in correct format: {self.ccxt_symbol}'
|
|
|
|
msg = f'ccxt_symbol was not in correct format: {self.ccxt_symbol}'
|
|
|
|
raise ValueError(msg)
|
|
|
|
raise ValueError(msg)
|
|
|
|
'''
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
def __str__(self):
|
|
|
|
return self.ccxt_symbol
|
|
|
|
return self.ccxt_symbol
|
|
|
@ -219,7 +224,7 @@ WELL_KNOWN_SYMBOLS = (
|
|
|
|
'CZK',
|
|
|
|
'CZK',
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
| { 'XXBT': BTC }
|
|
|
|
| {'XXBT': BTC}
|
|
|
|
| {str(k): k for k in COMMON_NAMES}
|
|
|
|
| {str(k): k for k in COMMON_NAMES}
|
|
|
|
| {'SPX500': SPX, 'SP500': SPX, 'Nasdaq 100': NDX}
|
|
|
|
| {'SPX500': SPX, 'SP500': SPX, 'Nasdaq 100': NDX}
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -283,8 +288,7 @@ EXCHANGES = [
|
|
|
|
StockExchange(name='Australian Securities Exchange', mic='XASX'),
|
|
|
|
StockExchange(name='Australian Securities Exchange', mic='XASX'),
|
|
|
|
StockExchange(name='Johannesburg Stock Exchange', mic='XJSE'),
|
|
|
|
StockExchange(name='Johannesburg Stock Exchange', mic='XJSE'),
|
|
|
|
StockExchange(name='Tehran Stock Exchange', mic='XTEH'),
|
|
|
|
StockExchange(name='Tehran Stock Exchange', mic='XTEH'),
|
|
|
|
StockExchange(name='Over The Counter (Unlisted)', mic='OTC'), # TODO: Unofficial
|
|
|
|
StockExchange(name='Over The Counter (Unlisted)', mic='OTC'), # TODO: Unofficial
|
|
|
|
|
|
|
|
|
|
|
|
StockExchange(name='NYSE Arca', mic='ARCX'),
|
|
|
|
StockExchange(name='NYSE Arca', mic='ARCX'),
|
|
|
|
StockExchange(name='BATS Global Markets', mic='BATS'),
|
|
|
|
StockExchange(name='BATS Global Markets', mic='BATS'),
|
|
|
|
StockExchange(name='NYSE American', mic='XASE'),
|
|
|
|
StockExchange(name='NYSE American', mic='XASE'),
|
|
|
|