| | |
| | | """ |
| | | import ctypes |
| | | import decimal |
| | | import json |
| | | import math |
| | | import random |
| | | import threading |
| | |
| | | return max(price1, price2) |
| | | |
| | | |
| | | # 获取买入价格笼子的最高价 |
| | | def get_buy_max_price(price): |
| | | price1 = price * (1 + 0.02) |
| | | price1 = math.ceil(price1 * 100) / 100 |
| | | price2 = price + 0.1 |
| | | return max(price1, price2) |
| | | |
| | | |
| | | # 获取买入价格笼子的最低价 |
| | | def get_shadow_price(price): |
| | | # fprice = round((100 - random.randint(2, 10)) * price / 100, 2) |
| | |
| | | return code.find("30") == 0 |
| | | |
| | | |
| | | class SetEncoder(json.JSONEncoder): |
| | | def default(self, obj): |
| | | if isinstance(obj, set): |
| | | return list(obj) |
| | | return json.JSONEncoder.default(self, obj) |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | print(timestamp_format(1726034271, "%H%M%S")) |