英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论