简体   繁体   English

如何使用股票代码在 Pine Editor Tradingview 中访问股票当前价格数据

[英]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.

相关问题 如何使用符号列表获取股票的价格历史数据 - How to get price history data for stocks using a list of symbols 如何使用 nsetools 获取股票列表的当前市场价格? - How to get current market price of a list of stocks with nsetools? 使用 tradingview pine 脚本制定回测策略 - Using tradingview pine script to make strategy for backtesting 如何在 TradingView Pine-Script 中运行条件语句? - How to Run a Conditional Statement in TradingView Pine-Script? 使用 datareader 获取有关股票的数据 - Getting data about stocks using datareader 如何在python中正确下载股票数据 - How to properly download stocks data in python BeautifulSoup中股票的刮改价 - Scraping change price of stocks in BeautifulSoup 如何在 Python Importing Stocks 数据中解决这个问题? - How to solve this problem in Python Importing Stocks data? 如何测试一组数字的每个组合以获得可能的最高结果? (Python、交易、Pine 脚本、TradingView) - How can I test every combination of a set of numbers for the highest result possible? (Python, Trading, Pine Script, TradingView) 在VScode中将tradingview的pine脚本转换为python - Convert tradingview's pine script to python in VScode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM