Total Shares Outstanding 在 v5 Pine Script 中不再工作。

huangapple go评论45阅读模式
英文:

Total Shares Outstanding not working any longer in v5 pine script

问题

我刚刚尝试了这个

indicator("MarketCap", overlay=true, timeframe="", timeframe_gaps=true)
Outstanding = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
MarketCap = Outstanding*close
plotchar(MarketCap, "MarketCap", "", location = location.top)

对于AAPL,但它返回0。

有人知道这里有什么问题吗?

英文:

I have just tried this

//@version=5
indicator("MarketCap", overlay=true, timeframe="", timeframe_gaps=true)
Outstanding = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
MarketCap = Outstanding*close
plotchar(MarketCap, "MarketCap", "", location = location.top)

for AAPL but its returning 0.

Anyone know what's wrong here?

答案1

得分: 1

你没有识别出 'TSO',你需要将你的 plotchar 系列切换为 'Outstanding'。版本 5 中的代码如下:

//@version=5
indicator("MarketCap", overlay=true, timeframe="", timeframe_gaps=true)
Outstanding = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
MarketCap = Outstanding*close
plotchar(Outstanding, "Outstanding", "", location = location.top)

根据你的评论要求,这里根据 MarketCap 绘制。两者似乎都正常工作。

英文:

You don't have 'TSO' identified, you need to switch your plotchar series to 'Outstanding'. Also it is request.financial() in version 5. Working code below

//@version=5
indicator("MarketCap", overlay=true, timeframe="", timeframe_gaps=true)
Outstanding = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
MarketCap = Outstanding*close
plotchar(Outstanding, "TSO", "", location = location.top)

Here it is plotted with MarketCap per your comment request. Both seem to work fine.
Total Shares Outstanding 在 v5 Pine Script 中不再工作。

huangapple
  • 本文由 发表于 2023年6月22日 14:56:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76529285.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定