| | |
| | | from strategy import order_methods |
| | | |
| | | from strategy.logging_config import get_logger |
| | | from utils import tool |
| | | from utils import tool, huaxin_util |
| | | |
| | | # 获取logger实例 |
| | | logger = get_logger() |
| | |
| | | # current_quotes_buy == [[23.25, 800], [23.24, 1100], [23.23, 1100], [23.22, 2200], [23.21, 2300]] |
| | | # current_quotes_sell == [[23.27, 500], [23.29, 200], [23.3, 6900], [23.31, 500], [23.32, 200]] |
| | | current_created_at = current_info[7] # 当前信息创建时间 |
| | | if type(current_created_at) == int: |
| | | current_created_at = huaxin_util.convert_time(current_created_at) |
| | | # print(f"current_created_at====={current_created_at}") |
| | | # print(f"current_created_at type====={type(current_created_at)}") |
| | | |
| | |
| | | return __public_order_ref |
| | | finally: |
| | | __order_ref_lock.release() |
| | | |
| | | |
| | | def convert_time(time_str, with_ms=False): |
| | | time_str = str(time_str) |
| | | if time_str.startswith("9"): |
| | | time_str = f"0{time_str}" |
| | | ms = "{:0<3}".format(time_str[6:]) |
| | | time_ = f"{time_str[0:2]}:{time_str[2:4]}:{time_str[4:6]}" |
| | | if with_ms: |
| | | return f"{time_}.{ms}" |
| | | return time_ |