Fundamental data is not just another price series
`request.financial()` and `request.earnings()` have timing, period, and availability rules that can confuse chart logic.
Fundamental data in Pine is tempting because it looks like any other requested series. You ask for a value, plot it, and the chart gives you a line. But earnings, fiscal periods, and financial statement fields are not the same kind of data as close, high, or volume. They arrive on their own schedule and carry their own meaning.
This one matters because the mistakes are usually subtle. The script compiles. The values appear. The problem is not that the data is missing. The problem is that the script treats a reported value, a fiscal period, and a chart date as if they were the same thing.
Why this catches people
The common trap is asking a chart question with an accounting data source. A user wants to know “which fiscal quarter is this value from?” or “did earnings happen today?” and the script starts comparing values to the bar date. That can work only if the script is clear about what the returned value represents and when TradingView makes it available on the chart.
request.financial() and request.earnings() are useful, but they have different jobs. Financial fields can represent periodic statement data. Earnings requests can represent earnings-related events and fields. Neither should be treated as a perfect timestamped replacement for reading a company’s filings.
The Pine bit
The first design choice is whether the indicator needs the value, the event, or the period label. Those are different outputs. If the script needs to compare current price behaviour around earnings, then the event timing matters. If the script needs a valuation ratio, then the latest available field may be enough. If it needs a fiscal quarter label, the code may need additional logic or may need to admit that the label is not directly available in the form the user wants.
I avoid assuming that an na means “no event ever.” It may mean no data for this symbol, no value at this bar, no available field, or simply a gap setting choice. The script should decide how to display unavailable data instead of letting it silently affect conditions.
earningsActual = request.earnings(syminfo.tickerid, earnings.actual)
hasEarningsValue = not na(earningsActual)
How I handle it in builds
In a client-facing indicator, I prefer to keep fundamental overlays descriptive rather than overconfident. If the script marks an earnings-related value, the label should say what was requested, not imply a complete accounting interpretation. That keeps the tool useful without pretending Pine has solved every fiscal-period edge case.
This also matters for backtests. A strategy that uses fundamental data needs to be clear about when the data became available. Otherwise the script can accidentally make decisions with information that looks historical but was not tradable at that moment.
Where this shows up
A practical design is to display fundamental values in their own panel or label style rather than blending them into ordinary price signals. That visual separation reminds the user that these values come from a different data process. A price level and an earnings field do not have the same timing assumptions.
I like to keep a fallback state for unsupported symbols. Fundamental requests are most useful on instruments where the requested data exists. On other symbols, a script should fail politely: muted cell, “not available” label, or no signal. What I avoid is letting missing fundamental data become a bearish condition or a false zero. That sort of silent conversion can make a filter look stricter than it really is.
How I test it
I test fundamental-data scripts on symbols where the data exists, symbols where it does not, and bars around the reported event. That prevents the script from treating missing data as a real value or turning an unavailable field into an accidental signal.
Checks before I trust it
- Decide whether the script needs a value, an event, or a fiscal-period label.
- Treat
naas an availability state that needs handling. - Avoid implying that the chart date and fiscal period are the same thing.
- Use labels that describe the requested field plainly.
- Be careful using fundamental values in strategy conditions without a timing review.
The point I keep coming back to is that fundamental data needs a little humility. Pine can bring the value onto the chart, but the script still has to respect what kind of value it is and when it was knowable.