ExitUnitOnStopClose

Top  Previous  Next

Exits the specified unit for the current instrument on the next close if it is lower than the stop price for long positions or higher than the stop price for short positions. This function is generally used by an Exit Block to lighten up a position.

 

Syntax

 

ExitUnitOnStopClose( unitNumber, stopPrice )

 

Parameters

unitNumber

 

the unit to exit

stopPrice

 

the price which the close must exceed to trigger the order

 

Example

' Exit the first unit on the next close if it hits our stop.

broker.ExitUnitOnStopClose( 1, exitStop )