Timer Functionality in Core API

Custom indicators, trading strategies, data export and recording and more...
asmf
Posts: 3
Joined: Thu Dec 29, 2022 4:24 pm
Been thanked: 1 time

Timer Functionality in Core API

Post by asmf » Fri Feb 17, 2023 9:39 pm

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.

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Timer Functionality in Core API

Post by Andry API support » Mon Feb 20, 2023 11:24 am

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.

Post Reply