策略。外观:什么是“要点”在这种情况下? V5

发布于 2025-01-26 03:18:06 字数 288 浏览 4 评论 0原文

手册中的示例:

strategy.exit("exit", "long", profit = 10, loss = 5) // generate full exit bracket (profit 10 points, loss 5 points per contract) from entry with name "long"

这些要点易用吗?因此,如果该职位的价值100美元(打开时),那么利润= 10点10%= $ 10,所以我们以$ 110的价格出售了该职位?

Example from manual:

strategy.exit("exit", "long", profit = 10, loss = 5) // generate full exit bracket (profit 10 points, loss 5 points per contract) from entry with name "long"

Are these points percents? So if this position was worth $100 (when opened) then profit = 10 point is 10% = $10 so we sold the position for $110?

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

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

发布评论

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

评论(1

丢了幸福的猪 2025-02-02 03:18:06

这些是 pips

PIP是汇率可以基于的最小价格转移
在外汇市场大会上。

如果要进行基于百分比的退出,则应使用limitstop参数。

in_long_tp_per = input.float(2.0, "Take profit %") * 0.01
in_long_sl_per = input.float(1.0, "Stop loss %") * 0.01

long_tp_price = strategy.position_avg_price * (1 + in_long_tp_per)
long_sl_price = strategy.position_avg_price * (1 - in_long_sl_per)

if (strategy.position_size > 0)
    strategy.exit("exit", "long", limit = long_tp_price, stop = long_sl_price)

Those are pips.

A pip is the smallest price move that an exchange rate can make based
on forex market convention.

If you want to do a percentage based exit, you should use the limit and stop arguments.

in_long_tp_per = input.float(2.0, "Take profit %") * 0.01
in_long_sl_per = input.float(1.0, "Stop loss %") * 0.01

long_tp_price = strategy.position_avg_price * (1 + in_long_tp_per)
long_sl_price = strategy.position_avg_price * (1 - in_long_sl_per)

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