| | |
| | | def __is_latest_open_limit_up_or_limit_down(datas, day_count): |
| | | datas = copy.deepcopy(datas) |
| | | datas.sort(key=lambda x: x["bob"]) |
| | | items = datas[0-day_count] |
| | | items = datas[0-day_count:] |
| | | for item in items: |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) |
| | | if abs(limit_up_price - item["high"]) < 0.001 and abs(limit_up_price - item["close"]) > 0.001: |
| | |
| | | from utils import tool |
| | | |
| | | |
| | | def get_sell_price(price_type,limit_up_price,limit_down_price, current_price): |
| | | def get_sell_price(price_type, limit_up_price, limit_down_price, current_price): |
| | | price = None |
| | | if price_type == 0: |
| | | if not current_price: |
| | | raise Exception("没有获取到L1现价") |
| | | price = tool.get_buy_min_price(current_price) |
| | | if limit_down_price and price > round(float(limit_down_price), 2): |
| | | price = round(float(limit_down_price), 2) |
| | | elif price_type == 1: |
| | | if not limit_down_price: |
| | | raise Exception("没有获取到跌停价") |