PINE脚本:是否有一种方法可以考虑计算平均值的一天中的特定小时?
例如:我正在使用以下代码来计算过去7天的平均每日体积:
isess = session.regular
t = ticker.new(syminfo.prefix, syminfo.ticker, session=isess)
AvgVol7 = ta.sma(volume, 7)
SecAvgVol7 = request.security(t, 'D', AvgVol7[1], gaps=barmerge.gaps_off , lookahead=barmerge.lookahead_on)
但是我想做的是计算过去7天的相同平均每日体积,但仅考虑从凌晨6点到凌晨6点下午6点。有办法做到吗?
For example: I'm using the following code to calculate the average daily volume of the past 7 days:
isess = session.regular
t = ticker.new(syminfo.prefix, syminfo.ticker, session=isess)
AvgVol7 = ta.sma(volume, 7)
SecAvgVol7 = request.security(t, 'D', AvgVol7[1], gaps=barmerge.gaps_off , lookahead=barmerge.lookahead_on)
But what I would like to do is to calculate the same average daily volume of the past 7 days, but only consider hours from 6am to 6pm. Is there a way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)