The Generator Block produces an empty discrete event message at the launch of the algorithm. As the message is empty, it contains no market information; however, an empty discrete message can be used to trigger other blocks that use discrete messages as inputs, such as a Pause block. The Generator Block can be used to trigger other discrete blocks at precise moments in time.
The Generator Block provides different modes for specifying when the block generates a discrete event message:
InitialStart: Generates a discrete message once at the launch of the algorithm, then becomes inactive for the life of the algorithm.
EveryStart: Generates a discrete message when the algorithm initially launches, as well as every time the algorithm is paused and then resumed.
UTCDateTime-Discrete: Generates a discrete message a specific time or specific date and time. This mode exposes the following ports:
Note: If you do not specify a date, the event will repeat daily at the specified time.
UTCDateTime-Combined: Generates a discrete message at a user-specified UTCDateTime. This mode shows the Date Time block setting that allows you to select the date and time from a calendar. Unlike the UTCDateTime-Discrete mode, this mode does not expose input ports for the value; however, it is automatically declared as a user-defined parameter. A calendar widget will be displayed in Algo Dashboard / Autotrader to allow the user to specify a value.
BoolTrue: Generates a discrete message when its True/False input becomes TRUE. This mode exposes a Boolean input port.
BoolChange: Generates a discrete message when the value of its True/False input changes, either from TRUE to FALSE or from FALSE to TRUE. This mode exposes a Boolean input port.
TimeInterval: Generates a discrete message at regular time intervals. This mode exposes the following input ports:
UserTrigger: Waits until a user triggers the block to generate a discrete message.
When using this type of generator, a button is added to Autotrader. Clicking the button triggers the generator. The algo must be deployed to test this trigger.
When using the Generator Block, it is important to know the exact timing at which the discrete event messages are generated.
When InitialStart or EveryStart is selected, the following sequence of events occurs when the algorithm is started:
When BoolChange or BoolTrue is selected, a continuous update changes the value of the Boolean input on the Generator Block and the following sequence of events occurs:
To change default block settings, double-click the block to open the Block Editor.
|Name||Name to display beneath the block on the ADL canvas|
|Mode||When the block should generate its discrete event message|
|Description||Optional text to explain how the block is used|