When an added unit is created, the instrument.SetUnitPositionMessage function will add a message to the unit number listed in the parameter area of the function.  The text of the message in the text-message area of the function will be the text assigned to the unit created.

 

Syntax:

instrument.SetUnitPositionMessage( [unitNumber], unitMessageText )

 

Parameter:

Description:

[unitNumber]

Integer value that identifies the unit number.  See: Unit Indexing

unitMessageText

Text information  that identifies the reason or method that helps to understand why the order appeared.

 

Example:

'  The ENTRY ORDER FILLED script section is
'  where a position's order becomes a unit.
'  It is good place to add a specific message
'  to a position's specific unit number.
'
'  The first unit in a position filled  will
'  return a UnitCount = 1.  Each unit added
'  unit to that same position will increment
'  the UnitCount by adding 1 to the previous
'  UnitCount in a position.
 
'  To add a message to a new unit this script
'  property statement will be provide the unit
'  number of the newest unit order filled:
UnitCount = instrument.currentPositionUnits
'
'  Add a specific message to a position's
'  newest unit use this statement:
instrument.SetUnitPositionMessage( UnitCount, "EntryRisk" )

 

Returns:

 

 

Links:

Position Properties, Unit Indexing

See Also:

Trade Control Functions, Trade Control Properties

 


Edit Time: 10/28/2020 1:09:33 PM


Topic ID#: 29

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software