MichelT

Earnings, Splits, Dividends

Example of requesting Earnings , Splits, Dividends using pine-script.

That way is inner representation of data in TradingView, so it can be changed any time. It's just an example of requesting of the data.

Description of the series.

Earnings:

time: report date (unix time stamp)
open: estimate value
low: reported value
close: actual value
high: fiscal period (unix time stamp)


Splits:

time: split date (unix time stamp)
close: split denominator
open: split numerator


Dividends:

time: ex-dividend date (unix time stamp)
close: amount
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Kommentarer

500 coins
Svara
How to show dividend and earnings in tradingview
+6 Svara
This is very useful, thanks for sharing.

I'm trying to use earnings in a strategy/backtest -- I want to close open positions before earnings are reported. So far I am unsuccessful because strategy.close_all() executes on the next bar. I want it to execute on the current bar, which means, I need to access the next bar's earnings. Normally accessing the future wouldn't make sense in a backtest, but since earnings dates are known in advance I think it's sound to use them.

Do you happen to know how I can accomplish this? I'm still very new to pine script.
+2 Svara
Pretty cool !!!

Is there any other data (or documentation you can point me to) we can access using the "ESD_FACTSET:"?
+1 Svara
MichelT Daveatt
@Daveatt, no, it's a special case used for exact those ESD-lollypops in the chart. The rest of data (from the 'Financials' tab in the chart window) is requested in the other way and there will be a method fundamentals() soon (I expect in the nearest weeks), so it'll be possible to get the fundamental data (e.g. quarterly earnings) via it. Actually, for those ESD-data there also will be special functions, but I don't have any ETA for them, so I just published the workaround, so you guys could get the data till the better solution come up.
+3 Svara
Daveatt MichelT
@MichelT, Thank you, very clear !!!!
+1 Svara
Es perfecto pero muy tarde
+1 Svara
Killing it like usual MichelT!
+1 Svara
You made my day @MichelT! Clean code, meaningful description & code comments. Thank you!
+1 Svara
MichelT e2e4mfck
@e2e4mfck, You are welcome!
+1 Svara