|
Event List files can be included in a data import to add point-in-time event information to specific dates for specific symbols. The most likely use of this feature would be to include historical earnings dates and values if you have access to such information.
As with symbol information files, event lists use CSV format.
The first row of the file must contain column names from the following list:
•Symbol – the symbol for which the event occurred
•Date – the date of the event
•Time – the time of the event (optional)
•Type – a numeric code > 0, or an event type name (any text that is not a number); names are matched without regard to case, and up to 64 distinct names may be used
•Value – any numeric value (e.g. dividend amount, or EPS, or index constituency flags)
These columns can be in any order. The names are used to identify them.
Rows after the header row can also be in any order. Each row defines at least one event for one symbol on one date. Additional Type,Value pairs may be appended to a row after its header-named columns; each pair defines another event that shares the same Symbol, Date and Time (up to 64 events per row). Give each pair on a row a distinct type, since only one event per type is retrievable for a given symbol and date.
For example, this file defines one event for AAPL and three (two of them with named types) for MSFT:
Symbol,Date,Time,Type,Value
AAPL,2026-01-30,163000,1,2.18
MSFT,2026-01-28,163000,1,3.05,EarnEst,2.90,Surprise,0.15
When first importing with an event list, it is suggested to use the LogFile option in your import definition. Events for which the symbol+date is not found in the imported bar data will be reported in the log.
Imported event data is accessed in script formulas by using the Event(type) function, which returns the value field if an event exists for the current symbol on the current date, or 0 if no event was found (with an option to return the most recent event -- see the function link for details). An event type can be referenced either by its number, e.g. Event(1), or by its quoted name, e.g. Event("EarnEst").
The Time field stored with each event record determines which bar the Event function will align the event with. If Time <= 16:00:00 (160000) then the event will be aligned with the bar which has the specified date. If Time > 160000 then the event will be aligned with the next bar after the bar with the specified date.
The intention with this distinction is to differentiate "before the open" vs. "after the close" earnings report times. If you have point-in-time earnings data and are using EventListFile to import it and Event(n) to reference it, you will want Event(n) to return a value only for the dates on which the market first reacted to earnings news.
Events dated after the last bar of imported data are retained. This is what allows UntilEvent and negative-offset references like Event(n)[-5] to see future-dated events during order generation. (A symbol's most recent imported bar must still exist on or before the event date for it to remain associated with that symbol.)
See also djia_earnings.rts and djia_earnings.csv in the Examples folder (note that this example does not use the Time field).
|