|
@@ -58,18 +58,28 @@ def get_prices(f: typing.TextIO) -> typing.Mapping[str, float]:
|
|
|
hardcoded_prices = {
|
|
hardcoded_prices = {
|
|
|
'ANZ': 70601,
|
|
'ANZ': 70601,
|
|
|
'BFP': 23408,
|
|
'BFP': 23408,
|
|
|
|
|
+ 'BGS': 219000,
|
|
|
'CRU': 169623,
|
|
'CRU': 169623,
|
|
|
'FUN': 124010,
|
|
'FUN': 124010,
|
|
|
'GCH': 18303,
|
|
'GCH': 18303,
|
|
|
'GNZ': 30361,
|
|
'GNZ': 30361,
|
|
|
|
|
+ 'HAM': 4686751,
|
|
|
'HNZ': 93580,
|
|
'HNZ': 93580,
|
|
|
|
|
+ 'HPR': 1490000,
|
|
|
|
|
+ 'LU': 95730,
|
|
|
'PFG': 2677222,
|
|
'PFG': 2677222,
|
|
|
'RDS': 598170,
|
|
'RDS': 598170,
|
|
|
|
|
+ 'RDL': 1390000,
|
|
|
'SDM': 1721027,
|
|
'SDM': 1721027,
|
|
|
|
|
+ 'SEQ': 17977,
|
|
|
'SST': 5863587,
|
|
'SST': 5863587,
|
|
|
'SU': 157860,
|
|
'SU': 157860,
|
|
|
|
|
+ 'TAC': 245797,
|
|
|
|
|
+ 'TCU': 155561,
|
|
|
'TOR': 540169,
|
|
'TOR': 540169,
|
|
|
'VCB': 673713,
|
|
'VCB': 673713,
|
|
|
|
|
+ 'VOE': 3699358,
|
|
|
|
|
+ 'VOR': 2547315,
|
|
|
}
|
|
}
|
|
|
assert frozenset(prices).isdisjoint(hardcoded_prices), frozenset(prices).intersection(hardcoded_prices)
|
|
assert frozenset(prices).isdisjoint(hardcoded_prices), frozenset(prices).intersection(hardcoded_prices)
|
|
|
prices.update(hardcoded_prices)
|
|
prices.update(hardcoded_prices)
|
|
@@ -84,9 +94,7 @@ def get_prod_and_company_data(data: dict[str, list[Row]], prices: typing.Mapping
|
|
|
for section, rows in data.items():
|
|
for section, rows in data.items():
|
|
|
if (ticker := get_production_ticker(section)) is None:
|
|
if (ticker := get_production_ticker(section)) is None:
|
|
|
continue
|
|
continue
|
|
|
- price = prices.get(ticker)
|
|
|
|
|
- if price is None:
|
|
|
|
|
- continue
|
|
|
|
|
|
|
+ price = prices[ticker]
|
|
|
prod_amount = sum(row.num for row in rows) / 30
|
|
prod_amount = sum(row.num for row in rows) / 30
|
|
|
prod[ticker] = {'amount': prod_amount, 'volume': prod_amount * price}
|
|
prod[ticker] = {'amount': prod_amount, 'volume': prod_amount * price}
|
|
|
for row in rows:
|
|
for row in rows:
|