0

我正在使用下面的代码行来获取前 5 分钟的蜡烛 HLOC,它工作正常。有没有更好的方法来做到这一点?我想减少安全功能调用。

is_newbar(res) => change(time(res)) != 0

hl_5minFunc(sx) =>

h_5 = security(sx,'5', valuewhen(is_newbar('D'),high,0))

l_5 =security(sx, '5', valuewhen(is_newbar('D'),low,0))

o_5 = security(sx,'5', valuewhen(is_newbar('D'),open,0))

c_5 =security(sx,'5', valuewhen(is_newbar('D'),close,0))

[o_5, h_5, l_5,c_5]

//First Bar (5Min) of the day HLOC

[fopen_1,fhigh_1, flow_1, fclose_1] = security(syminfo.tickerid,"5", hl_5minFunc(syminfo.tickerid))
4

1 回答 1

0
is_newbar(res) => change(time(res)) != 0

[fopen_1,fhigh_1, flow_1, fclose_1] = security(syminfo.tickerid, "5", [valuewhen(is_newbar('D'), high, 0), valuewhen(is_newbar('D'), low, 0),valuewhen(is_newbar('D'), open, 0), valuewhen(is_newbar('D'), close, 0)])
于 2021-08-10T01:15:59.690 回答