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
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר סקריפט זה פרסם אותו עם קוד פתוח, כך שסוחרים יוכלו להבין ולאמת זאת. הידד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום הנו בכפוף ל כללי הבית . אתה יכול להגדירו כמועדף ולהשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?


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 השב