|
Order Object |
Top Previous Next |
|
The Order object represents an order that either has just been filled or that might be filled depending on the values returned by a script.
The Order object is only available in the following scripts:
The Order object can be used in the order scripts, and also in other scripts at certain times such as right after a successful broker call. Be sure it is clear what order is currently in context. To check if there is a valid order in the Order object, use the system.orderExists function prior to accessing it.
The alternateOrder object is the same as the order object, but it needs to be set to be used. To loop over all open orders one would set the alternateOrder object using the system.SetAlternateOrder function to access the properties of each order:
' Loop over the open orders setting the order sort value with a secret computation. FOR orderIndex = 1 to system.totalOpenOrders STEP 1 system.SetAlternateOrder( orderIndex ) alternateOrder.SetSortValue( Random( 100 ) ) NEXT |