Page 1 of 1

Timer Functionality in Core API

Posted: Fri Feb 17, 2023 9:39 pm
by asmf
In the Core API, is there any functionality similar to IntervalListener? Or do I need to roll a custom Timer inside my code?

I'm looking for some timer mechanism that makes a callback every X seconds. 

The implementation in Simplified works great for my use case (IntervalListener, getInterval, onInterval). Just need some additional functionality that Core API provides.

More specifically, I'd like to get the interval to be synced up with the market data feed, not necessarily with my system's time.  Perhaps more similar to the onBar functionality.

Re: Timer Functionality in Core API

Posted: Mon Feb 20, 2023 11:24 am
by Andry API support
You need to create an instance of Layer1ApiRequestCurrentTimeEvents class. Send this message from your module when starting or finishing your strategy with isAdd parameter set to true/false respectively. Please see this class javadoc for details.