RealTest User Guide
RealTest User Guide

 

 

 

 

 

Category

Bar Data Values

Description

Get the event code for this bar or the most recent event code

Syntax

Event(type, latest {optional})

Parameters

type - event type number or quoted event type name

latest - most-recent (1) vs. this-bar-only (0) flag -- 0 is the default

Notes

If the current data file includes a user-defined Event List, this function looks up an event code for the current symbol and bar.

If an event is found that has type as its type number, then its value is returned.

The type can also be given as a quoted name, e.g. Event("EarnEst"), if the event list defined named types. Names are matched without regard to case; a name that does not appear in the event list matches nothing, so the function returns 0.

If latest is true (non-zero), then the most recent event of this type for this symbol prior to (or on) the current bar is returned.

If no matching event is found then 0 is returned.

An event is considered to have occurred "on a bar" if the event's time value (from the imported event list) is at or before the bar's time. For daily bars this cutoff is the ImportBarTime setting, which defaults to 16:00 (160000).

Example

HasEvent: Event(1)

Returns the event value if an event of this type exists for this bar, or 0 if none.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC