public static class EarningsDate
public static bool EarningsDate.InWindow(WealthScript ws, int bar, string earningsString, int barsBefore, int barsAfter)
public static DateTime EarningsDate.GetNextUseCache(string symbol, DateTime lastProviderDate)
public static DateTime EarningsDate.GetNext(string symbol, bool returnTimestamp = false) public static DateTime EarningsDate.GetNext2(string symbol)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using Community.Components; /*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/namespace WealthLab.Strategies { public class EarningsDateDemo : WealthScript { protected override void Execute() { /* Display the next earnings release date in the chart */ DateTime nextReportDate = new DateTime(2010, 1, 1); FundamentalItem fi = GetFundamentalItem (Bars.Count - 1, Bars.Symbol, "earnings per share"); if (fi != null) { nextReportDate = EarningsDate.GetNextUseCache(Bars.Symbol, fi.Date); PrintDebug(nextReportDate.ToShortDateString()); } else { nextReportDate = EarningsDate.GetNextUseCache(Bars.Symbol, nextReportDate); } DrawLabel(PricePane, "Next Earnings: " + nextReportDate.ToShortDateString() ); /* Highlight the "In Window" bars */ for(int bar = 20; bar < Bars.Count; bar++) { if (EarningsDate.InWindow(this, bar, "[z] Zacks Adjusted Earnings", 2, 1)) SetBackgroundColor(bar, Color.FromArgb(30, Color.Red)); } } } }