| | |
| | | try: |
| | | l2_log.l_cancel_debug(code, f"计算L后囊括范围:{start_index}-{end_index}") |
| | | total_datas = local_today_datas.get(code) |
| | | if re_compute > 0 and tool.trade_time_sub(total_datas[-1]["val"]["time"], |
| | | total_datas[buy_single_index]["val"]["time"]) < 2 * 60: |
| | | # 间隔超过2分钟才能重新计算 |
| | | l2_log.l_cancel_debug(code, f"要间隔2分钟过后才能重新计算") |
| | | return |
| | | if total_datas: |
| | | # 计算的上截至位距离下截至位纯买额要小于2.5倍m值 |
| | | # thresh_hold_money = l2_trade_factor.L2PlaceOrderParamsManager.get_base_m_val(code) |
| | |
| | | # 统计未撤订单的数量与金额 |
| | | total_datas = local_today_datas.get(code) |
| | | # 是否是下单5分钟内 |
| | | if tool.trade_time_sub(tool.get_now_time_str(), total_datas[real_order_index]['val']['time']) > 1 * 60: |
| | | return False, "下单超过1分钟" |
| | | if tool.trade_time_sub(tool.get_now_time_str(), total_datas[real_order_index]['val']['time']) > 30: |
| | | return False, "下单超过30s" |
| | | |
| | | total_left_count = 0 |
| | | total_left_num = 0 |
| | |
| | | buy_progress_index) |
| | | cresult = FCancelBigNumComputer().need_cancel_for_deal_fast(code,buy_progress_index) |
| | | if cresult[0] and not DCancelBigNumComputer().has_auto_cancel_rules(code): |
| | | L2TradeDataProcessor.cancel_buy(code, f"下单5分钟内排单不足:{cresult[1]}") |
| | | L2TradeDataProcessor.cancel_buy(code, f"下单30s内排单不足:{cresult[1]}") |
| | | # ---------------------------------判断板块是否跟上来了------------------------------- |
| | | try: |
| | | pass |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | 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)) |
| | | print(trade_time_sub("13:00:01", |
| | | "11:29:55")) |
| | | |
| | | |
| | | class CodeDataCacheUtil: |