英文:
how can I rest all my customized index at 11pm sharply
问题
我如何可以在晚上11点准时重置所有自定义的索引?
以下代码对我不起作用。
我的示例
A = B + C
D = A[0] + A[1] + A[2]
rest_bar = timestamp(year, month, dayofmonth, 23, 0, 0)
if rest_bar:
A == 0
D == 0
英文:
how can I rest all my customized index at 11pm sharply?
below code is not working for me.
my sample
A = B + C
D = A[0] + A[1] + A[2]
rest_bar = timestamp(year, month, dayofmonth, 23, 0, 0)
if rest_bar
A == 0
D == 0
答案1
得分: 0
使用一个可变变量,rest_bar必须与其先前的值不同。
类似这样的:
//<设置初始值>
A = 0
B = 1
C = 1
A := B + C
D = A[0] + A[1] + A[2]
rest_bar = timestamp(year, month, dayofmonth, 23, 0, 0)
if rest_bar != rest_bar[1]
A := 0
D := 0
英文:
With a mutable variable
and rest_bar must be different from its previous value
Something like that
//<set initial values>
A = 0
B = 1
C = 1
A := B + C
D = A[0] + A[1] + A[2]
rest_bar = timestamp(year, month, dayofmonth, 23, 0, 0)
if rest_bar != rest_bar[1]
A := 0
D := 0
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论