| | |
| | | |
| | | __trade_price_dict = {} |
| | | |
| | | # 最近的非涨停价成交的信息,数据结构:{code:(价格,时间)} |
| | | __trade_price_not_limit_up_info_dict = {} |
| | | |
| | | |
| | | # 设置成交价 |
| | | def set_trade_price(code, price): |
| | | def set_trade_price(code, price, time_str, limit_up_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 get_trade_price(code): |
| | | return __trade_price_dict.get(code) |
| | | |
| | | |
| | | def get_trade_not_limit_up_info(code): |
| | | """ |
| | | 获取最近的非涨停价成交的信息 |
| | | @param code: |
| | | @return:(价格,时间) |
| | | """ |
| | | return __trade_price_not_limit_up_info_dict.get(code) |