Users often need to turn on/off logic during specific time frames. There are multiple ways to do something in ADL, however the following focuses on using the Generator block to achieve this type of logic.
In the ADL canvas shown below, we have two Generator blocks set to AtStartTime. Only the UTC Time is selected, and the inputs to these blocks are user defined. You’ll notice that the Trade? AND block is currently false, preventing the algo from submitting orders.
When the time matches the Start Time, a discrete message will be output and will end up in the Value Accumulator block which is set to a # of 1 on the inside formula builder. When it gets this message, it outputs a 1 out of the continuous output port, and the following Boolean logic will turn that Trade? AND block to true, turning the Order block on.
When the Stop Time matches the stop time inputs you set, this generator fires another discrete message, which also goes into its own Value Accumulator block. This action turns off the Trade? AND block as well as the Order block.