| | |
| | | if last_price != 0: |
| | | growth = (price - last_price) / last_price * 100 # 计算涨幅百分比 |
| | | return growth |
| | | |
| | | finally: |
| | | history_price[symbol] = price |
| | | # print(f"price======={price}") |
| | |
| | | current_quotes_buy = current_info[5] # 买5档数据 |
| | | current_quotes_sell = current_info[6] # 卖5档数据 |
| | | current_created_at = current_info[7] # 当前信息创建时间 |
| | | if current_price <= 0: |
| | | current_price = current_quotes_buy[0][0] |
| | | |
| | | # print( |
| | | # f"买一价:{current_quotes_buy[0][0]},买二价:{current_quotes_buy[1][0]},买三价:{current_quotes_buy[2][0]},买四价:{current_quotes_buy[3][0]},买五价:{current_quotes_buy[4][0]}") |
| | | # print( |