[英]How to Access data of current price of stocks in Pine Editor Tradingview using ticker id
我想在我的交易视图松树编辑器中编码指标,为此,我需要股票的当前价格或任何其他脚本到我的编码关键字来执行操作并在图表上生成新的输出,
Try this尝试这个
src = input(close, title="Source")
price = security(syminfo.tickerid, timeframe.period, src)
plot(price)
Here ticker id I used to display the current price on the chart这里是我用来在图表上显示当前价格的代码 ID
reference intradaygeeks contact if need more help twitter如果需要更多帮助,请参考日间极客联系推特
This seems to work.这似乎有效。
currentPrice = security(syminfo.tickerid, "", ema(close, 1), barmerge.gaps_on, barmerge.lookahead_off)
You could probably use something other than ema().您可能可以使用 ema() 以外的其他东西。 If you're writing a strategy, make sure your call to strategy includes
calc_on_every_tick=true
.如果您正在编写策略,请确保您对策略的调用包含
calc_on_every_tick=true
。
strategy("DCA Bot", overlay=true, calc_on_every_tick=true)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.