A single Activation at time order can be submitted using the SubmitNewOrder method on the AccountList object:
' Submit an order.
moOrder = moAccounts.SubmitNewOrder( _
oAccount, _
oMarket, _
BuySell.Buy, _
PriceType.StopMarket, _
TimeType.Normal, _
1, _
0, _
CDbl(6534), _
OpenClose.Undefined, _
"", _
0, _
ActivationType.AtOrAfterTime, _
"05 Jul 2012 18:00:00")
The parameters for the SubmitNewOrder method are described
here.
| penPriceType | Set to PriceType.StopMarket for a stop market order. |
| penTimeType | Set to TimeType.Normal for a day order that will exist for the current trading day only. |
| piVolume | Set to the order volume you want. |
| pdblLimitPrice | Limit price is not needed for a stop market order so set this to 0. |
| pdblStopPrice | Set to the stop trigger price you want. Be sure that you are using the correct overloaded SubmitNewOrder method and providing either a display price as a double or a tick price as an integer. |
| penOpenClose | Set to OpenClose.Undefined. |
| psTag | Free text field for developer use. |
| piTrailTicks | Set to 0 to disable trailing. |
| penActivationType | Set to ActivationType.AtOrAfterTime to activate the order at the specified time. |
| psActivationValue | This string contains the details for when to activate the order. |
In this example, the order will be held on our servers until the time is 05 Jul 2012 18:00:00. At that time it will submit the order to the exchange.
The format of the ActivationValue is "activation time;cancel time"
| activation time | Required. The time to activate the order. The time can be specified as either a full date time in the format "dd MMM yyyy HH:mm:ss" or as a number of seconds from now. |
| cancel time | Optional. The time to cancel the order if the order is still working or not yet activated. The time can be specified as either a full date time in the format "dd MMM yyyy HH:mm:ss" or as a number of seconds from now. |
Examples for psActivationValue:
- "05 Jul 2012 18:00:00" - activates the order at the specified time (all times are U.S. Central Time) as long as the market is in a pre-open, open or other mode that allows order submission. Using the datetime format of "dd MMM yyyy HH:mm:ss" is highly recommended.
- "100" - activates the order after the specified number of seconds. In this case it is 100 seconds from now. At that time the order will be submitted as long as the market is in a mode that allows order submission.
- "05 Jul 2012 18:00:00;05 Jul 2012 18:01:00" - activates the order at the specified time (all times are U.S. Central Time) as long as the market is in a pre-open, open or other mode that allows order submission. The second parameter specifies the time to cancel the order at if it has not completed. In this example the order will be cancelled one minute after it is activated.
- "100;200" - activates the order after the specified number of seconds. In this case it is 100 seconds from now. At that time the order will be submitted as long as the market is in a mode that allows order submission. The second parameter specifies the time to cancel the order as a number of seconds from now. In this case it is 200 seconds from now so the order will be cancelled 100 seconds after is it activated.
- "100;05 Jul 2012 18:00:00" - activates the order after the specified number of seconds. In this case it is 100 seconds from now. At that time the order will be submitted as long as the market is in a mode that allows order submission. The second parameter specifies the time to cancel the order.