Sets the stop price for an order to the specified price.


This function can only be used in the Unit Size, Can Add Unit, and Can Fill Order scripts.


It cannot be used in the Entry Order Filled script because the order is already filled. However, it can be Use the instrument.SetExitStop instead.



Function is only valid for Entry Orders and is ignored for Exit Orders since there is only the protective stop price for exit orders when one is assigned with a Broker Exit Order function.



order.SetStopPrice( stopPrice )





Stop price assigned to  the order.



order.stopPrice contains the instrument's protective exit price when one is assigned by a Broker Entry function, or by the order.SetStopPrice.  When the order.stopPrice does not contain a price value, the order.noStopPrice will return True.



Unit Size script:

' Increment the stop by one tick.
order.SetStopPrice( order.stopPrice + instrument.minimumTick )


Can Fill Order script:

' Move the stop by the amount of the slippage.
order.SetStopPrice( order.fillPrice - order.entryRisk )


Alternate Order Object:

Access to Order Object properties and functions in other scripts is made possible by using the AlternateOrder Object as the prefix ahead of the "." property or function. AlternateOrder Object is discussed below.



Always check to be sure the order is available after a Broker function call using the system.orderExists function prior to accessing it.


Using the alternateOrder object when orders are not in context will provide the same access as the Order object.  However, the alternateOrder object must be brought into context using the system.SetAlternateOrder object function prior to any attempt to use is properties and functions.


Once orders are brought into context their properties and function are available to reference and changes.




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