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.
Timer Functionality in Core API
-
- Posts: 552
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: Timer Functionality in Core API
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.