Sets the custom value field of the unit.
There must be a position on, so this cannot be used in the Unit Size, Can Add Unit, or Can Fill Order scripts unless there is already a unit on and the intention is to reference the current open position unit and not the current order. In these scripts the order is being processed so the order object should be used if that is the intention.
This function is best used in the Entry Order Filled, Exit, Entry, or After Instrument Day scripts.
Syntax: |
---|
SetUnitCustomValue( [unitNumber,] value ) |
Parameter: |
Description: |
---|---|
[unitNumber,] |
The unit number (optional). If not supplied this will default to the first unit. |
value |
The custom value to be set. This value can be retrieved using the unitCustomValue property. |
Example: |
---|
' Set the custom value. |
Returns: |
---|
When value is printed, it will show the value entered. In this example, 1.5 will appear. Value will also appear in the Trade Log. |
Links: |
---|
|
See Also: |
Edit Time: 9/21/2020 2:40:53 PM |
Topic ID#: 564 |