我如何调用请求。
我需要在Heikin Ashi Security中致电Ta.Sar,这给了我一个买入/出售信号以在Japatin中执行蜡烛价值。
//SAR security example (not working)
start = input(0.02)
increment = input(0.02)
maximum = input(0.2, "Max Value")
out = (request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close) ta.sar(start, increment, maximum))
sarColor = out < low ? color.lime : color.red
plot(out, "ParabolicSAR", style=plot.style_cross, color=sarColor)
I need to call a ta.sar in heikin ashi security, that gives me a buy/sell signal to execute in japanise candles values.
//SAR security example (not working)
start = input(0.02)
increment = input(0.02)
maximum = input(0.2, "Max Value")
out = (request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close) ta.sar(start, increment, maximum))
sarColor = out < low ? color.lime : color.red
plot(out, "ParabolicSAR", style=plot.style_cross, color=sarColor)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
request.security()
函数3rd paramter是您希望返回的expression
。在您的情况下,您需要关闭
,而您要获得SAR。您还使用额外的括号,可以从代码中删除:如果您希望在以后使用关闭的情况下,可以同时获得关闭和SAR:
The
request.security()
function 3rd paramter is theexpression
you wish to return. In you case, you're requestingClose
, while you want to get sar. You also use an extra parenthesis you can delete from your code:You can get both Close and sar if you wish using Close at a later time: