返回列表 发布新帖

如果涨停不买入,这个函数可行?

24 0
# 获取目标股票的涨停价格
stock_code = '000001.SZ'  # 示例股票代码
instrument_info = ContextInfo.get_instrumentdetail(stock_code)
up_stop_price = instrument_info["UpStopPrice"]

# 计划买入价格(示例值,实际应从策略逻辑中获取)
target_price = 10.50  # 示例买入价格

# 判断是否等于涨停价
if target_price >= up_stop_price:
    print(f"买入价格 {target_price} 达到或超过涨停价 {up_stop_price},取消下单")
else:
    # 执行正常下单逻辑
    print(f"买入价格 {target_price} 未达到涨停价 {up_stop_price},执行下单")
    # 这里添加实际的下单代码,例如:
    # order = place_order(stock_code, target_price, quantity, ...)

回复

您需要登录后才可以回帖 登录 | 立即注册

客服专线

400-080-8112

用思考的速度交易,用真诚的态度合作,我们是认真的!
  • 关注公众号
  • 添加微信客服
Copyright © 2001-2025 迅投QMT社区 版权所有 All Rights Reserved. 蜀ICP备19002686号-2
关灯 快速发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表