如何指定按时间而不是bar的偏移? V5
我的某些规则(检测某些事情)在市场开放后一个小时发出错误警报(或者只是不够定义,而不是足够好,哈哈)。由于我可以找到营业时间的时刻,因此我可以相对地解决它的棒,这有点酷。有没有办法将其指定为时间偏移以使其不依赖(子时)时间表?
例如,在我的代码中,Marketopen
规则是true
如果当前市场打开的时刻仍在当前栏中(因此它解决了Marketsopen <的标准< /代码>在任何时间范围内)。在1小时的时间范围内,这将很简单:
not(Marketopen)
将排除第一个小时,但也应该在次小时时间内工作。
Some of my rules (to detect something) gives false alarms for an hour after Market Open (or simply just not defined well enough anyways, ha-ha). Since I can locate the moment of Market Open, I can address bars relatively to it which is kinda cool. Is there a way to specify offset by time to make it undependent to (sub-hour) timeframe?
For example in my code, MarketOpen
rule is true
if the current the moment of Market Open is still in the current bar (so it addresses the bar of MarketOpen
in any timeframe). In 1H timeframe, it would be simple: not(MarketOpen)
would exclude the first hour, but it should work in sub-hour timeframes, too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只想在特定的时间内进行交易,则可以使用
session
:无论如何,如果要在市场开放后1小时获得1小时的时间,则可以使用此信息:
If you want to trade only in specific hours, you can use a
session
:In any case, if you want to get the time of 1 hour after the market is open, you can use this: