- ago
Hello, I just downloaded the app and still in trial mode and learning mode :). I am trying to bring the next earnings date data into a chart to see if it is working. I have installed the fundamental data extension and have checked the box to enable the next earnings date data. I have forced an update using the 'Update all checked providers' button. I dropped the indicator for next earnings date and next dividend on a chart. The next dividend indicator works fine but the next earnings date data displays no data and shows NaN. I have tried many different tickers and they all have the same result. What am i doing wrong? 8373-2024-09-29-10-13-44-pdf
0
149
Solved
8 Replies

Reply

Bookmark

Sort
- ago
#1
You forgot to tell us which earnings Event Provider you selected. For a "free" provider for earnings, I would recommend Zacks.


Now understand all the free providers will be slow, so you may wish to disable (uncheck) them to speed up "initial" strategy execution for the day. (Event data is cached after initial download.) All the paid providers are fast, so you won't have that trouble. For paid fundamental providers, you might consider YCharts or EODHD.
1
Best Answer
- ago
#2
Thanks for the prompt response and the info!. I just checked the box for next earnings date. I thought that would be sufficient to query the data providers for earnings date?

If I have to select other providers like Zacks then what does the next earnings date checkbox do?
0
- ago
#3
QUOTE:
what does the next earnings date checkbox do?

The Next Earnings Date checkbox simply enables the NextEarningsDate indicator, but you don't have to use that indicator. The Fundamental(bars,"Earnings",true) indicator can create a time plot of earnings for you directly if you plot it. Try that instead.

CODE:
   Fundamental earnings = new Fundamental(bars, "Earnings", true); //for Zacks earnings    PlotIndicator(earnings, WLColor.SeaGreen, PlotStyle.GradientBlocks);
Now if you were using YCharts for earnings, then you would pass "eps" instead (earnings per share).

NextEarningsDate indicator is really there to give you a countdown of earnings announcement dates.
1
- ago
#4
Thanks Superticker! I have that working now. It seems that the only data is the earnings date. There is no indication of whether it was a 'before open' or 'after close' event. Are there any of the earnings data sets that would have an attribute to indicate this?
0
- ago
#5
Well now we are getting more complicated. I'm not sure if the time stamp on the fundamental indicator is valid for hours. Can someone answer that?

But the EventDataPoint list does have valid DateTimes, so if you Get that list and look at the last item, it should give you the "time" the earnings was last posted. You'll need to check with MarketManager on whether that's during or after market hours, but you should start a MarketManger topic if you have questions about that.

The example below prints the earnings announcement time as both "Header text" and a "$" ToolTip that you can mouseover to see the date and time for the most recent earnings.
CODE:
using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Indicators; using WealthLab.Data; using System.Collections.Generic; namespace WealthScript2 {    public class MyStrategy : UserStrategyBase    {       public override void Initialize(BarHistory bars)       {          Fundamental earnings = new Fundamental(bars, "Earnings", true); //for Zacks earnings          PlotIndicator(earnings, WLColor.SeaGreen, PlotStyle.GradientBlocks);          List<EventDataPoint> earningsList = bars.GetEventDataPoints("Earnings"); //for Zacks earnings          string dateTimeText = earningsList[earningsList.Count-1].Date.ToString();          DrawHeaderText(dateTimeText,WLColor.SeaGreen,14);          DrawHint("$", dateTimeText, bars.IndexOf(earningsList[earningsList.Count-1].Date),true,hintBkgColor: WLColor.LightGreen);       }       public override void Execute(BarHistory bars, int idx) { }    } }
0
- ago
#6
Somehow the online manual for Zacks adjusted earnings is empty in the built-in Help. The team should correct this.

Let me quote the relevant part of the manual:

QUOTE:
Zacks provides earnings data going several years back. For each item's reported EPS value there are extra fields available in a popup when mousing over an Earnings item on a stock chart and in code-based Strategies via Detail method of an EventDataPoint object. Available field names for the extra details are:
•PeriodEnding
•Estimate - EPS estimate
•Surprise - EPS surprise $
•SurprisePct - EPS surprise %
•Time - release Time (of day)
1
- ago
#7
QUOTE:
EventDataPoint object. Available field names for the extra details are ...
•Time - release Time (of day)

Okay, I added "relative release Time" to the "$" ToolTip. Just mouseover the "$" sign. (I learned something.) Note, this code is for the Zacks event provider. Other providers may be different.

CODE:
   public override void Initialize(BarHistory bars)    {       Fundamental earnings = new Fundamental(bars, "Earnings", true); //for Zacks earnings       PlotIndicator(earnings, WLColor.SeaGreen, PlotStyle.GradientBlocks);       List<EventDataPoint> earningsList = bars.GetEventDataPoints("Earnings"); //for Zacks earnings       EventDataPoint earningsLatest = earningsList[earningsList.Count-1];       string dateTimeText = earningsLatest.Date.ToShortDateString();       DrawHeaderText(dateTimeText + "=latest earnings published date",WLColor.SeaGreen,14);       DrawHint("$", dateTimeText + "=published\n" + earningsLatest.Details["Time"] + "=release time",          bars.IndexOf(earningsLatest.Date),true,hintBkgColor: WLColor.LightGreen);    }
You can also mouseover the Zacks green-triangle ToolTip and it will list all these details, so you don't need all this code unless your strategy needs to act on this data.
0
- ago
#8
Thanks for the help! I tested this and confirmed that dates and times look good. The time of day is shown as 'After Close' or 'Before Open' in the tooltip.
2

Reply

Bookmark

Sort