| | |
| | | 账户管理模块【管理账户下面的资金管理方法及仓位管理方法等】 |
| | | """ |
| | | from log_module.log import logger_common |
| | | # import time |
| | | # import datetime |
| | | # import decimal |
| | | from trade import huaxin_trade_api |
| | | |
| | | # import logging |
| | | # import threading |
| | | # 引入全局变量模块 |
| | | from strategy import data_cache |
| | | |
| | |
| | | logger.info(f"冻结的资金==={frozenCash}") |
| | | logger.info(f"可取资金==={fetchLimit}") |
| | | logger.info(f"上日结存==={preDeposit}") |
| | | |
| | | |
| | | # finance_management() |
| | | |
| | | # 构造循环请求资金管理线程 |
| | | # def finance_management_process(): |
| | | # while True: |
| | | # try: |
| | | # # now_start = time.time() |
| | | # # print(f"finance_management开始{now_start}") |
| | | # finance_management() |
| | | # # now_end = time.time() |
| | | # # print(f"finance_management完成一下{now_end}") |
| | | # except Exception as error: |
| | | # print(f"获取资金管理线程报错An error occurred: {error}") |
| | | # finally: |
| | | # time.sleep(1) |
| | | |
| | | |
| | | # 仓位管理函数 |
| | |
| | | logger.info( |
| | | f"今日新增持仓数量====================================【{len(data_cache.addition_position_symbols_set)}】") |
| | | |
| | | # position_management() |
| | | |
| | | # # 构造循环请求仓位管理线程 |
| | | # def position_management_process(): |
| | | # while True: |
| | | # try: |
| | | # # now_start = time.time() |
| | | # # print(f"position_management开始{now_start}") |
| | | # position_management() |
| | | # # now_end = time.time() |
| | | # # print(f"position_management完成一下{now_end}") |
| | | # except Exception as error: |
| | | # print(f"获取仓位管理线程报错An error occurred: {error}") |
| | | # finally: |
| | | # time.sleep(1) |