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.


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


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


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




500 代幣
How to show dividend and earnings in tradingview
+6 回覆
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 回覆
Pretty cool !!!

Is there any other data (or documentation you can point me to) we can access using the "ESD_FACTSET:"?
+1 回覆
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 回覆
Daveatt MichelT
@MichelT, Thank you, very clear !!!!
+1 回覆
Es perfecto pero muy tarde
+1 回覆
Killing it like usual MichelT!
+1 回覆
You made my day @MichelT! Clean code, meaningful description & code comments. Thank you!
+1 回覆
MichelT e2e4mfck
@e2e4mfck, You are welcome!
+1 回覆