March 31, 2021
New Functions to Get Splits, Dividends, and Earnings Data in Pine

More good news — we’ve added dividends, splits, and earnings functions to our Pine Script language, which will help you get information about splits, profits, and dividends for the symbols you are interested in.

All three functions have the same set of arguments — ticker, field, gaps, lookahead.

The ticker parameter is a symbol with prefix, such as NASDAQ:AAPL.

The gaps and lookahead parameters are similar to those in the security function.

However, the field parameter takes on different values.

For the dividends function, the field parameter allows you to specify the type of dividends you want to receive: or dividends.gross.

For the splits function, the field parameter allows you to specify the numerator or denominator of the split: splits.numerator or splits.denominator.

For the earnings function, the field parameter allows you to specify the type of profit you want to receive: earnings.actual or earnings.estimate.

Let’s take an example. With the earnings function, say you want to know the reported and estimated earnings of Microsoft (NASDAQ:MSFT). Your script might look like this:

study("My Script")
earnings_actual=earnings("NASDAQ:MSFT", earnings.actual)
earnings_estimate=earnings("NASDAQ:MSFT", earnings.estimate)


Read about all Pine updates in the Release Notes section in the User Manual.

We hope you find the new features useful. And please do keep giving us feedback and suggestions — we’re building TradingView for you, and we’re always keen to know what you think about our platform updates.

The fastest way to follow markets

Launch Chart