Sets the exit stop for an active position specified unit.  

 

This function works where order are being processed to assign a value:

Order object script sections:

Unit Size

Can Add Unit

Can Fill Order

 

Instrument object scripts:

Entry Order Filled

Exit

Entry

Adjust Stops

After Instrument Day

 

NOTE:

If you set the stop with this function, the daily risk will be calculated using this value, but no order is placed. To place an actual stop in the market use a broker order like this: broker.ExitAllUnitsOnStop( instrument.unitExitStop ).

 

Syntax:

SetExitStop( [unitNumber,] stopPrice )

 

Parameter:

Description:

[unitNumber,]

The unit number (optional). If not supplied this will default to the first unit.

stopPrice

The value of the stop to be set.

 

Example:

' Move the stop by the amount of the slippage.
instrument.SetExitStop( order.fillPrice - order.entryRisk )
 
' Set the stop price for the specified unit.
instrument.SetExitStop( unitNumber, newStopPrice )

Returns:

Values assigned can be printed and used after assignment.  It is also available to the Broker object to execute.

 

Links:

unitExitStop

See Also:

Position Functions, Position Properties

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 543

 

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