| | |
| | | rate = round((price - pricePre) * 100 / pricePre, 2) |
| | | if tool.is_ge_code(code): |
| | | # 创业板的涨幅需要打折 |
| | | rate = rate/2 |
| | | rate = rate / 2 |
| | | if rate >= 0 and not trade_manager.ForbiddenBuyCodeByScoreManager().is_in_cache(code): |
| | | # 暂存涨幅为正的代码 |
| | | _code_list.append((rate, code, 1 if is_want_buy else 0)) |
| | |
| | | |
| | | |
| | | # 设置成交价 |
| | | def set_trade_price(code, price, time_str, limit_up_price): |
| | | def set_trade_price(code, price): |
| | | __trade_price_dict[code] = price |
| | | # 需要记录最近一次非涨停价成交的时间 |
| | | if limit_up_price and abs(limit_up_price - price) > 0.001: |
| | | # 非涨停价成交 |
| | | __trade_price_not_limit_up_info_dict[code] = (price, time_str) |
| | | |
| | | |
| | | def set_latest_not_limit_up_time(code, time_str_with_ms): |
| | | """ |
| | | 记录最近的一次上板时间(最近的一笔主动买就是上板时间) |
| | | @param code: |
| | | @param time_str: |
| | | @return: |
| | | """ |
| | | __trade_price_not_limit_up_info_dict[code] = time_str_with_ms |
| | | |
| | | |
| | | |
| | | # 获取成交价 |
| | |
| | | return __trade_price_dict.get(code) |
| | | |
| | | |
| | | def get_trade_not_limit_up_info(code): |
| | | def get_trade_not_limit_up_time_with_ms(code): |
| | | """ |
| | | 获取最近的非涨停价成交的信息 |
| | | 获取最近的非板上成交的时间 |
| | | @param code: |
| | | @return:(价格,时间) |
| | | @return:(价格, 时间) |
| | | """ |
| | | return __trade_price_not_limit_up_info_dict.get(code) |