如何进行超过 40 次 security() 调用?
How to make more than 40 security() calls?
我知道 pinescript 中 security() 的最大调用次数是 40,但我遇到了 pinecoder.com 中的以下解决方法:
The limit for security() calls is 40, but by using functions returning tuples with security(), you can fetch many more values than 40.
我不太明白解决方法是什么!如果有人能为我描述并举例说明,我将不胜感激。
使用 tuples.
一次 security()
调用获取 7 个数据点
//@version=4
study("Test", "Test", true)
// Fetching 7 datapoints with one security() call.
[o,h,l,c,h2,h3,h4] = security(syminfo.ticker, timeframe.period, [open,high,low,close,hl2,hlc3,ohlc4])
plot( o, "open", color.red)
plot( h, "high", color.green)
plot( l, "low", color.blue)
plot( c, "close", color.fuchsia)
plot(h2, "hl2", color.lime)
plot(h3, "hlc3", color.maroon)
plot(h4, "ohlc4", color.orange)
我知道 pinescript 中 security() 的最大调用次数是 40,但我遇到了 pinecoder.com 中的以下解决方法:
The limit for security() calls is 40, but by using functions returning tuples with security(), you can fetch many more values than 40.
我不太明白解决方法是什么!如果有人能为我描述并举例说明,我将不胜感激。
使用 tuples.
一次security()
调用获取 7 个数据点
//@version=4
study("Test", "Test", true)
// Fetching 7 datapoints with one security() call.
[o,h,l,c,h2,h3,h4] = security(syminfo.ticker, timeframe.period, [open,high,low,close,hl2,hlc3,ohlc4])
plot( o, "open", color.red)
plot( h, "high", color.green)
plot( l, "low", color.blue)
plot( c, "close", color.fuchsia)
plot(h2, "hl2", color.lime)
plot(h3, "hlc3", color.maroon)
plot(h4, "ohlc4", color.orange)