Pinescript:获取战略年份。
我想知道是否有可能在策略中的每一个贸易贸易中获得购买年份。
我尝试使用 strument.closedtrades.entry_time [num_trade] ,但我无法从这个Unix时间戳中获得这一年。
另一方面,我试图使用 年[straution.closedtrades.entry_bar_index [num_trade]] ,但由于许多已使用的栏,这会引起错误。
知道是否可以吗?
I would like to know if it is possible in pinescript to get the buy year for every trade in strategy.closedtrades?
I tried to use strategy.closedtrades.entry_time[num_trade] but I was not able to get the year out of this Unix timestamp.
On the other hand I have tried to use
year[strategy.closedtrades.entry_bar_index[num_trade]], but this raises an error because of to many used bars.
Any idea if this is possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
Year()
函数来获取时间戳年度。例如:您可以通过封闭的交易进行
循环,并做您想要的事情。例如:
You can use the
year()
function to get the year of a timestamp. For example:You can
loop
through the closed trades, and do the thing you want. For example: