Delay Timer

A delay timer can be set on any individual alert message. This can be useful if multiple commands are being sent in rapid succession but you want to offset one or more of the commands to allow time for processing.

For example, if you have have a custom alert situation where both a CLOSEPOSITION and a PLACE alert are being sent roughly at the same time and you want to avoid a race condition, you can inject a delay before the PLACE order command gets executed. This will provide sufficient time for the CLOSEPOSITION command to execute before PLACE.

The delay timer is evaluated first, prior to any other action or field. However, if you are using Multi-Account Placement to send an order to multiple accounts, CrossTrade creates a cloned request for each account in the comma-separated list. All fields in the alert message are cloned, including the delay timer. This implies that the delay will precede each individual request.

Valid Values

The delay timers can be any floating-point number of seconds with a maximum delay of 60 (one minute).

delay=1; (1 second delay)

delay=3.5; (3.5 second delay)

delay=6.78; (6.78 second delay)

delay=60; (60 second delay)

Example Payload

The following example will set a 3-second delay timer on the following PLACE order command:

key=your-secret-key; command=PLACE; account=sim101; instrument=NQ 12-24; action=BUY; qty=1; order_type=MARKET; TIF=DAY; delay=3;

Last updated