Pinescript订单输入,停止损失并获利
我只是要掌握Pinescript,更具体地编写了放置订单/交易的策略,但是有一个快速的问题。
我想创建一个基本的模板策略,该策略将进入交易,设置其停止损失并获利,这一切都开始。我对使用任何指标不感兴趣来设置这些值中的任何一个,所以我只想简单地设置:
- 输入价格 = 当前价格 + 10pips
- 停止损失 = entry_price -20pips
- 获利 = entry_price + 60pips
我感谢这不是与我交易的有用策略我只是在使用此练习来更好地理解Pinescript,并且一旦我有一个可以执行上述脚本,我打算以此为基础,因此这将是一个巨大的帮助!
谢谢大家
I am just getting to grips with PineScript and more specifically writing strategies to place orders/trades however, have a quick question.
I want to create a basic template strategy that will enter a trade, set its stop loss and take profit, and that's all to begin with. I am not interested in using any indicators to set any of these values as yet, so I just wish to simply set:
- Entry price = current price + 10pips
- Stop loss = entry_price - 20pips
- Take profit = entry_price + 60pips
I appreciate this isn't a useful strategy to trade with, I am just using this exercise to better understand PineScript and once I have a script that can execute the above I plan to then build on that, so this will be a huge help!
Thanks all
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下内容来获取PIP尺寸:
并使用它来获取入口价格:
然后:
然后退出职位:
You can use the following to get the pip size:
And use this to get the entry price:
Then:
Then to exit a position: