| | |
| | | |
| | | limit_price = "" |
| | | if int(data["val"]["limitPrice"]) == 1: |
| | | limit_price = "涨停" |
| | | limit_price = "T" |
| | | elif int(data["val"]["limitPrice"]) == 2: |
| | | limit_price = "跌停" |
| | | limit_price = "D" |
| | | operateDesc = "" |
| | | if int(data["val"]["operateType"]) == 0: |
| | | if len(limit_price) > 0: |
| | | operateDesc = '买 ({})'.format(limit_price) |
| | | operateDesc = '买{}'.format(limit_price) |
| | | else: |
| | | operateDesc = '买' |
| | | elif int(data["val"]["operateType"]) == 1: |
| | | if len(limit_price) > 0: |
| | | operateDesc = '买撤 ({})'.format(limit_price) |
| | | operateDesc = '买撤{}'.format(limit_price) |
| | | |
| | | else: |
| | | operateDesc = '买撤' |
| | | |
| | | elif int(data["val"]["operateType"]) == 2: |
| | | if len(limit_price) > 0: |
| | | operateDesc = '卖 ({})'.format(limit_price) |
| | | operateDesc = '卖{}'.format(limit_price) |
| | | else: |
| | | operateDesc = '卖' |
| | | |
| | | elif int(data["val"]["operateType"]) == 3: |
| | | if len(limit_price) > 0: |
| | | operateDesc = '卖撤 ({})'.format(limit_price) |
| | | operateDesc = '卖撤{}'.format(limit_price) |
| | | else: |
| | | operateDesc = '卖撤' |
| | | format_data.append(operateDesc) |
| | |
| | | |
| | | if __name__ == "__main__": |
| | | try: |
| | | export_l2_excel("000530") |
| | | export_l2_excel("605218") |
| | | except Exception as e: |
| | | logging.exception(e) |