|
|
@@ -1,17 +1,19 @@
|
|
|
from __future__ import annotations
|
|
|
|
|
|
+import sys
|
|
|
import typing
|
|
|
|
|
|
import cache
|
|
|
|
|
|
def main() -> None:
|
|
|
- for spent_30d, ticker in sorted(items(), reverse=True):
|
|
|
+ cx = sys.argv[1]
|
|
|
+ for spent_30d, ticker in sorted(items(cx), reverse=True):
|
|
|
print(f'{ticker:4} {spent_30d:11,.0f}')
|
|
|
|
|
|
-def items() -> typing.Iterator[tuple[float, str]]:
|
|
|
+def items(cx: str) -> typing.Iterator[tuple[float, str]]:
|
|
|
raw_prices: list[RawPrice] = cache.get('https://refined-prun.github.io/refined-prices/all.json')
|
|
|
for price in raw_prices:
|
|
|
- if price['ExchangeCode'] != 'IC1':
|
|
|
+ if price['ExchangeCode'] != cx:
|
|
|
continue
|
|
|
if (vwap_30d := price['VWAP30D']) is None or (traded_30d := price['Traded30D']) is None:
|
|
|
continue
|