An event handler is a method or function that runs when a specified event occurs, such as a new bar, a tick update or a lifecycle event in an automated trading program.