A single Activation on price 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.AtOrAboveTradeTicks, _
"12867")
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.AtOrAboveTradeTicks to activate the order when the specified price or higher trades. Set to ActivationType.AtOrBelowTradeTicks to activate the order when the specified price or lower trades. |
| 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 Market trades at or above a price of 12867 in ticks. At that time it will submit the order to the exchange.
The format of the ActivationValue is "ticks;activation cancel time;cancel time;volume"
| ticks | Required. The price in ticks trading that causes the order to be activated. |
| activation cancel time | Optional. The time to cancel the order if it has 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. |
| cancel time | Optional. The time to cancel the order after it has been 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. |
| volume | Optional. The last trade total volume at the activation price that needs to have traded before the order is activated. So to have the order activate when the last trade total volume for the activation price is 1000 or more specify 1000 here. Note that if the market trades through the activation price the order will be activated regardless of volume. |
Examples for psActivationValue:
- "12867" - activates the order when the specified price (must be entered as Ticks and not as display price) as long as the market is in a pre-open, open or other mode that allows order submission.
- "12867;100" - activates the order when the specified price (must be entered as Ticks and not as display price) as long as the market is in a pre-open, open or other mode that allows order submission. If the order has not been activated within 100 seconds it is cancelled.
- "12867;100;05 Jul 2012 18:00:00" - activates the order when the specified price (must be entered as Ticks and not as display price) as long as the market is in a pre-open, open or other mode that allows order submission. If the order has not been activated within 100 seconds it is cancelled. If the order is activated but not completed by 05 Jul 2012 18:00:00 then the order is cancelled.
- "12867;;1000" - activates the order when the specified price (must be entered as Ticks and not as display price) has traded 1000 or more lots since that price became the last traded price, as long as the market is in a pre-open, open or other mode that allows order submission.