| | |
| | | |
| | | def can_buy_for_stategy_1(): |
| | | # 获取2秒内吃的档数 |
| | | rised_price = self.__get_rised_price(code, info) |
| | | rised_price, msg = self.__get_rised_price(code, info) |
| | | if rised_price < 0.1: |
| | | return False, STRATEGY_TYPE_RISE_HIGH_WITH_BLOCKS, "2S内涨幅小于10档" |
| | | pre_close_price = self.__pre_close_price_dict.get(code) |
| | |
| | | if rate < 0.07: |
| | | return False, STRATEGY_TYPE_RISE_HIGH_WITH_BLOCKS, "涨幅小于7%" |
| | | if code.find("30") == 0 and rate >= 0.19: |
| | | return True, STRATEGY_TYPE_RISE_HIGH_WITH_BLOCKS, f"2S内上升{int(rised_price * 100)}档 涨幅({rate})>19%" |
| | | return True, STRATEGY_TYPE_RISE_HIGH_WITH_BLOCKS, f"2S内上升{int(rised_price * 100)}档({msg}) 涨幅({rate})>19% " |
| | | if code.find("30") != 0 and rate >= 0.09: |
| | | return True, STRATEGY_TYPE_RISE_HIGH_WITH_BLOCKS, f"2S内上升{int(rised_price * 100)}档 涨幅({rate})>9%" |
| | | return True, STRATEGY_TYPE_RISE_HIGH_WITH_BLOCKS, f"2S内上升{int(rised_price * 100)}档({msg}) 涨幅({rate})>9%" |
| | | return False, STRATEGY_TYPE_RISE_HIGH_WITH_BLOCKS, f"不满足买入条件" |
| | | |
| | | def can_buy_for_stategy_2(): |
| | |
| | | else: |
| | | # 删除第一个元素 |
| | | del self.__latest_transaction_price_dict[code][0] |
| | | return self.__latest_transaction_price_dict[code][-1][0] - self.__latest_transaction_price_dict[code][0][0] |
| | | return self.__latest_transaction_price_dict[code][-1][0] - self.__latest_transaction_price_dict[code][0][0], f"{self.__latest_transaction_price_dict[code]}" |
| | | |
| | | |
| | | class StrategyBuyOrderRefManager: |