From 1772431bd0578e706d91a4c92ecbab78bda55dfb Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 20 十月 2023 12:23:45 +0800 Subject: [PATCH] 影子订单委托价格重新定义 --- utils/tool.py | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/utils/tool.py b/utils/tool.py index e23600c..b5b09da 100644 --- a/utils/tool.py +++ b/utils/tool.py @@ -222,8 +222,18 @@ return max(price1, price2) +# 鑾峰彇涔板叆浠锋牸绗煎瓙鐨勬渶浣庝环 +def get_shadow_price(price): + fprice = round((100 - random.randint(2, 10)) * price / 100, 2) + if price - 0.1 < fprice: + fprice = price - 0.1 + return round(fprice, 2) + + if __name__ == "__main__": - print(get_buy_min_price(20)) + print(get_shadow_price(20)) + print(get_shadow_price(20)) + print(get_shadow_price(20)) # print(trade_time_sub("11:29:59", 5)) # print(trade_time_sub("10:29:59", 10)) # print(trade_time_add_second("13:29:59", 60)) @@ -264,3 +274,4 @@ except: pass return None + -- Gitblit v1.8.0