Parent: Object
The EventDataPoint class represents a single piece of event data, such as a fundamental data item (dividend, split, earlings), analyst rating, or chart pattern. WealthLab supports several Event Data Providers, both included out of the box and available via extensions. Each provider supplies its own set of historical event data.
You can access this event data by using the EventDataPoints property or the GetEventDataPoints method of the BarHistory class.
EventDataPoint supports both a parameterless constructor, and one which assigns values to the Name, Date, and optionally Value properties.
May contain some string data that is populated by the event data provider that generated this event data item. Each event data provider could use this property to represent different things, so consult with the documentation of the provider's extension for more details.
Returns the date that the event data item was reported.
using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Data; using System.Drawing; namespace WealthLab { public class MyStrategy1 : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.EventDataPoints.Count > 0) { EventDataPoint fdp = bars.EventDataPoints[bars.EventDataPoints.Count - 1]; DrawHeaderText("The most recent event item is a " + fdp.ItemName + " reported on " + fdp.Date.ToShortDateString(), WLColor.Green, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }
A Dictionary of string values keyed by string keys that can contain item-specific information.
Returns true if there are any items in the instance's Details Dictionary.
Returns true if the event data item's Date falls within the historical data that is currently contained in the BarHistory specified in bh.
Returns the name of the event. The implementation is based on the Name value, but removes certain prefixes that occur in some Event Data Providers.
using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Data; using System.Drawing; namespace WealthLab { public class MyStrategy1 : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.EventDataPoints.Count > 0) { EventDataPoint fdp = bars.EventDataPoints[bars.EventDataPoints.Count - 1]; DrawHeaderText("The most recent event item is a " + fdp.ItemName + " reported on " + fdp.Date.ToShortDateString(), WLColor.Green, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }
Describes the name of the event. For example, "Split", "Dividend", or "Analyst Rating".
Contains the name of the Event Data Provider that generated this event instance.
Returns descriptive text for this event data point. Generally, this is a combination of the item's ItemName and Value, but different event items can return different strings to express themselves.
using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Data; using System.Drawing; namespace WealthLab { public class MyStrategy1 : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.EventDataPoints.Count > 0) { EventDataPoint fdp = bars.EventDataPoints[bars.EventDataPoints.Count - 1]; DrawHeaderText("The most recent event item is a " + fdp.Text, WLColor.Green, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }
Returns the text that appears in the tooltip when the user hovers over the event's glyph icon in the chart. The text is composed of the Text property, with the item's ProviderName displayed below.
Returns the numeric value associated with the event data point. For example, a 2:1 split would have a Value of 2, while a $1.50 per share dividend would have a Value of 1.5.
using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Data; using System.Drawing; namespace WealthLab { public class MyStrategy1 : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.EventDataPoints.Count > 0) { EventDataPoint fdp = bars.EventDataPoints[bars.EventDataPoints.Count - 1]; DrawHeaderText("The most recent event item is a " + fdp.ItemName + " with a value of " + fdp.Value.ToString("N2"), WLColor.Green, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }
In EventDataPoint derived classes, you can override this method to return an instance of a class derived from BarGlyphBase that should be used to render the event to the chart.
In a derived class, you can override this property to return a System.Drawing.Bitmap that represents the event's glyph icon on the chart. The default value returns null, which causes the chart to proceduraly generate the glyph icon, using the GlyphText and GlyphColor properties.
Returns the background color to use when rendering the event glyph icon to the chart. This property is invoked in EventDataPoint derived classes that do not override the GetBarGlyph method. The default return value is null, which causes the color to be procedurally determined based on the item's ItemName.
Returns the text that should be rendered on the chart for this event. This property is invoked in EventDataPoint derived classes that do not override the GetBarGlyph method. The default implementation takes the first character of the instance's ItemName property.