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?

AndiAna
  • 854
  • 6
  • 26

1 Answers1

1

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. enter image description here

smashapalooza
  • 932
  • 2
  • 2
  • 12