Pine Script V4 - Resolve_error "Fund" for Marketcap label

Viewed 353

I'm stucked with an issue with on Pine Script v4 (Tried with v5 but it's same) I don't succeed to fix it. That's why I need your help.

I just want to add a label with the marketcap of the coin currently in use :

//@version=4
study("My Script", overlay=true)


//Marketcap

TSO = financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
MarketCap = TSO*close


label MarketCapL = label.new(time, close, text="  MarketCap | " + tostring(MarketCap, "##.###"),color=color.new(color.white,90), xloc= xloc.bar_time, style=label.style_none, textcolor= color.new(color.white,0), textalign=text.align_left), label.set_x(MarketCapL, label.get_x(MarketCapL)+ round(change(time)* 8)), label.set_y(MarketCapL, (label.get_y(MarketCapL) * 1.100)), label.delete(MarketCapL[1])

But it returns a

"Resolve_error "FUND""

Could someone help me ?

1 Answers

"Resolve_error "FUND"" indicates the "TOTAL_SHARES_OUTSTANDING" data is not existing for the current ticker.

To fix the issue add the recently implemented ignore_invalid_symbol argument which force the strategy to ignore the call of non-existing data:

TSO = financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ", ignore_invalid_symbol = true)
Related