From 70bbbc724f11ffa7d36aadcc0fed99e9394b2e82 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期五, 14 六月 2024 15:19:43 +0800
Subject: [PATCH] L2接口更新

---
 utils/tool.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/utils/tool.py b/utils/tool.py
index 65780fb..e0df628 100644
--- a/utils/tool.py
+++ b/utils/tool.py
@@ -344,6 +344,15 @@
         return MARKET_TYPE_UNKNOWN
 
 
+def is_stock(code):
+    """
+    鏄惁鏄偂绁�
+    :param code:
+    :return:
+    """
+    return code.find("00") == 0 or code.find("30") == 0 or code.find("60") == 0 or code.find("68") == 0
+
+
 def get_limit_up_rate(code):
     # 鑾峰彇娑ㄥ仠鍊嶆暟
     if code.find("00") == 0 or code.find("60") == 0:
@@ -368,6 +377,7 @@
     limit_up_price = to_price(decimal.Decimal(str(pre_close_price)) * decimal.Decimal(f"{get_limit_up_rate(code)}"))
     return limit_up_price
 
+
 # 灏嗘椂闂存埑s鏍煎紡鍖�
 def to_time_str(timestamp_second, format_="%H:%M:%S"):
     return datetime.datetime.fromtimestamp(timestamp_second).strftime(format_)

--
Gitblit v1.8.0