ExitUnitAtLimit

Top  Previous  Next

Exits the specified unit for the current instrument on the next bar if the market  trades through the specified limit price. This function is generally used by an Exit Block to lighten up a position.

 

Syntax

 

ExitUnitAtLimit( unitNumber, limitPrice, [ quantity ] )

 

Parameters

unitNumber

 

the unit to exit

limitPrice

 

the price which the next bar must trade through to trigger the order

quantity

 

the optional quantity to exit for a partial exit of the unit

 

Example

' Exit the first unit if the market trades through our target.

broker.ExitUnitAtLimit( 1, limitPrice )