瀏覽代碼

market: filter to mats that traded with a spread

raylu 3 周之前
父節點
當前提交
1e429f26d1
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      market.py

+ 6 - 0
market.py

@@ -13,6 +13,10 @@ def main() -> None:
 			continue
 		if price['Bid'] is None or price['Ask'] is None:
 			continue
+		if (high := price['HighYesterday']) is None or (low := price['LowYesterday']) is None:
+			continue
+		if (high - low) / high < 0.1:
+			continue
 		spread = (price['Ask'] - price['Bid']) / price['Ask']
 		if spread < 0.15:
 			continue
@@ -27,6 +31,8 @@ class RawPrice(typing.TypedDict):
 	FullTicker: str
 	Bid: float | None
 	Ask: float | None
+	HighYesterday: float | None
+	LowYesterday: float | None
 	AverageTraded7D: float | None # averaged daily traded volume over last 7 days
 
 @dataclasses.dataclass(eq=False, slots=True)