如何在长期进入的先前栏处设置停止损失?

发布于 2025-01-26 12:59:19 字数 112 浏览 1 评论 0原文

我想将停车损失设置为先前长期入场的低点。

我正在尝试value (your_condition,low [1],0),但我不知道“ your_condition”是什么。

I would like to set my stop loss at the previous bar low of long entry.

I'm trying value when(your_condition, low[1], 0), but I don't know what "your_condition" is.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

王权女流氓 2025-02-02 12:59:19

stop strategy.exit()设置SL价格:

停止(系列int/float)可选参数。停止损失(需要特定的价格)。如果指定,则下达停止订单以以指定的价格(或更糟)退出市场位置

因为该功能在每个蜡烛关闭时都会在每个蜡烛上运行(以及带有蜡烛的数据,刚刚关闭)您可以设置此功能,以便stop参数将设置low作为停止损失价格:

strategy.exit(id="Close Long", stop=low)

stop parameter in strategy.exit() sets SL price:

stop (series int/float) An optional parameter. Stop loss (requires a specific price).If it is specified, a stop order is placed to exit market position at the specified price (or worse)

Since the function runs on each candle when it closes (and with the data of the candle that just closed) you can set this function so that the stop parameter will set low as the stop loss price:

strategy.exit(id="Close Long", stop=low)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文