Sets the Sort Value for the order that will assigned to the order.sortValue property.
Loop over the orders setting this value, and then use the system.SortOrdersBySortValue to sort the orders.
Syntax: |
---|
order.SetSortValue( sortValue ) |
Paramter: |
Description: |
---|---|
sortValue |
Assign a numeric sort value. Number is any user value based upon how the user wants the orders sorted. Orders are sorted in an ascending lowest to highest value sequence. |
Returns: |
---|
Places the assigned sortValue in the order's sortValue property. |
Example: |
---|
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Returns: |
---|
When script shown above is created it will show the order prior to being sorted and getting a random value for its order ranking property. After the orders have been assigned a random sort value, all the orders are sorted in ascending numerical order. After the sorting the orders are shown again. All reporting output will be found in the Print Output.csv file in the Trading Blox/Results folder. |
Access to Order Object properties and functions in other scripts is made possible by using the AlternateOrder Object as the prefix ahead of the "." property or function. AlternateOrder Object is discussed below.
Notes: |
---|
Always check to be sure the order is available after a Broker function call using the system.orderExists() function prior to accessing it.
Using the alternateOrder object when orders are not in context will provide the same access as the Order object. However, the alternateOrder object must be brought into context using the system.SetAlternateOrder object function prior to any attempt to use is properties and functions.
Once orders are brought into context their properties and function are available to reference and changes. |
Links: |
---|
PRINT, referenceID, SetAlternateOrder, SetSortValue, SortOrdersBySortValue, |
See Also: |
AlternateOrder Object, AlternateSystem Object, Order Functions, Order Object, Order Properties |
Edit Time: 10/23/2020 11:43:15 AM |
Topic ID#: 561 |