| | |
| | | """ |
| | | 可转债入口函数 |
| | | """ |
| | | import datetime |
| | | import json |
| | | import logging |
| | | import multiprocessing |
| | |
| | | "buy1Money": output_util.money_desc( |
| | | cb_market.buy1_price * cb_market.buy1_volume), |
| | | "preClosePrice": cb_market.pre_close_price} |
| | | r["createTime"] = int(datetime.datetime.strptime(r["createTime"], "%Y-%m-%d %H:%M:%S").timestamp()) |
| | | if underlying_market: |
| | | if not gpcode_manager.CodesNameManager().get_code_name(underlying_market.code): |
| | | # 异步请求名称 |
| | |
| | | try: |
| | | result = trade_call_back_queue.get() |
| | | if result: |
| | | async_log_util.info(logger_trade, f"正股涨停,准备买入可转债:{result}") |
| | | # 获取可以买的代码 |
| | | code, trade_time = result[0], result[1] |
| | | buy_infos = result[3] |
| | |
| | | # 获取股票代码的可转债代码 |
| | | cb_code = target_codes_manager.get_cb_code(code) |
| | | if CodeTradeStateManager().get_trade_state(cb_code, strategy_type) == CodeTradeStateManager.TRADE_STATE_ALREADY_BUY: |
| | | async_log_util.info(logger_trade, f"已经下单过:{result}") |
| | | continue |
| | | # 获取可转债的涨停价 |
| | | market_info = code_market_manager.get_market_info(cb_code) |