I just adapted a little utility script to visualise EPS % increase (quarters vs Year -1) and sales.
I used the code from @ARUN_SAXENA and modified it to fix what I saw as issues.
(Using base 3M instead of 1M +
request.earnings(syminfo.tickerid, earnings.actual, ignore_invalid_symbol=true)
request.financial(syminfo.tickerid, "EARNINGS_PER_SHARE", "FQ")
Data will differ from MarketSmith because they use sometimes actual EPS sometimes standard, but think we can at least trust what we see in term of %
The tool is far from being perfect !
- Displays NaN when both EPS used for calculation are negative
- Displays + when increase is positive :)
- Modified calculation system, use the closer EPS to 0 when both reported and standard EPS are negative
We are now very close to the calculation method of MarketSmith.
Sometimes number differs but results are often close when differents.
To be honest I always confirm with shared graph on Twitter.
if you have any constructive suggestions, please let me know in the comments
- Removed the grid transparency
- Added the possibility to choose the position of the table
- Tried to display Yearly EPS but highly inaccurate results convinced me to only keep the code under comments in case someone one day is able to calculate manually ?
- I'm still not satisfied with the code.
- CELH one result is missing
-AEHR, this shoudn't happen but in Da, We, Mo, results differs. The problem is that we need to search previous earning with time and sometimes it defers from one stock to another.
I would love to find a way to get previous earning without using the time.
(Now the '#' is diplayed correctly)
- Added the possibility to display ROE
- Added the possibility to show EPS used for calculation
Please tell me if you don't like this update, because it adds a left scale whether this new option is checked or not
I complained about if few updates ago :)
So I decided to replace them by Arrow on the chart showing EPS date and EPS % variation as you can see on MarketSmith graph
I have no solution to plot them at the bottom of the graph, if you know how, don't hesitate to tell me in comment
(I can't reply to personal messages for now)
- You can select arrow colors
- You can select the 'EPS' text color
(Corrected the #+999% in APA which was #+712%)
- Renamed all the variables in the code that were confusing
(+ some comments here and there to facilitate understanding)
- Integrated the calculation of QoQ EPS without changing the general appearance of the script
(This way I hope I won't be HARASSED anymore :p)
- Added the viewing of 3 additional quarters
- I really hope that, like me, you'll love the new look ! (If not you can still save it to your taste)
- Now possible to see Sales on the graph under EPS information
- Changed the QoQ visual
- Added Sales QoQ
- Reorganised Input
- Now possible to change text Color on the graph independently
- Changed color of the case where variation% = 0% in black color. (Both EPS & Sales)
- Corrected the display of +/-∞% by N/A.
- Corrected the synchronization between the EPS and Sales rows in the table
$LYTS and $WING were not correct, now they are.
- Modified NaN% value to N/A
- Modifier N/A color
- Corrected the 0% color
- Changed GROSS MARGIN into GM
- Corrected the case where eps1 was negative and eps4 was 0 -∞% -> N/A
- NaN vs NaN -> N/A vs N/A on QQQ
- Recorrected the 0% color
(I think TV displayed me an old previous version of the script so I had to re-write the two last points)
I decided to identifiy this time and replace the sales and variation number by N/A. I will remove this if TradingView correct this bug.
- Now displays Sales in $Mil or $Bil
- Corrected the case where sales are the same number at day+1 after eanring event
- Changed the Graph for better presentation
- Input have been reorganised and simplified
- We can now display the %variation anyway even if the actual/reported EPS is negative
- Limitation added to -999%
- We can now display surprises on the table
- Input reorganised
- Changed to Presentation Graph
(I did it because I was asked many times, I am not very satisfied with the result, the table functions of tradingview are not flexible enough to do everything I would like to do.
There are now inputs that manage the appearance of both tables.)
- Changed the presentation graphique
- Organized the alignment of the column (Surprise, ROE, GM)
- Used another method for sales and EPS to have as much historical data as possible, currently 3 variations in % on IOT against only one before
Impressive results for example on IOT where we can display 4 additional lines compared to the previous method
- Corrected the Gross Margin and Return on Equity offset
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.