|
|
@@ -26,7 +26,7 @@ def main() -> None:
|
|
|
|
|
|
print()
|
|
|
for score, ticker in sorted(analyze_markets(raw_prices)):
|
|
|
- print(ticker, score)
|
|
|
+ print(f'{ticker:3}: {score:10.1f}')
|
|
|
|
|
|
markets: dict[str, list[Market]] = collections.defaultdict(list)
|
|
|
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
|
|
|
@@ -38,7 +38,7 @@ def main() -> None:
|
|
|
markets[market.exchange_code].append(market)
|
|
|
executor.shutdown()
|
|
|
|
|
|
- print(' mat bid ask spread bids filled asks filled profit p75 fill time')
|
|
|
+ print('\n mat bid ask spread bids filled asks filled profit p75 fill time')
|
|
|
for commodities in markets.values():
|
|
|
commodities.sort(reverse=True)
|
|
|
for m in commodities:
|
|
|
@@ -83,11 +83,12 @@ def analyze_markets(raw_prices: typing.Sequence[RawPrice]) -> typing.Iterator[tu
|
|
|
lowest_traded = price['Traded30D'] or 0
|
|
|
if lowest_traded == 0:
|
|
|
continue
|
|
|
- score = (ic1_price['Ask'] or 10_000_000) - highest_ask
|
|
|
- score += lowest_bid - (ic1_price['Bid'] or 0)
|
|
|
+ score = (lowest_bid - (ic1_price['Bid'] or 0)) / lowest_bid * 100
|
|
|
+ if highest_ask > 0:
|
|
|
+ score += ((ic1_price['Ask'] or 10_000_000) - highest_ask) / highest_ask * 100
|
|
|
if score > 0 and (trade_activity_deficit := lowest_traded - (ic1_price['Traded30D'] or 0)) > 0:
|
|
|
score *= trade_activity_deficit
|
|
|
- if score > 500:
|
|
|
+ if score > 5:
|
|
|
yield score, ticker
|
|
|
|
|
|
def analyze_raw_price(price: RawPrice) -> Market | None:
|