|
SetStopPrice |
Top Previous Next |
|
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. Use the instrument.SetExitStop instead.
NOTE: This function is only valid for Entry Orders and is ignored for Exit Orders since there is no protective stop for exit orders.
Syntax
SetStopPrice( stopPrice )
Parameters
Example for the Can Fill Order script: ' Move the stop by the amount of the slippage. order.SetStopPrice( order.fillPrice - order.entryRisk )
Example for the Unit Size script: ' Increment the stop by one tick. order.SetStopPrice( order.stopPrice + instrument.minimumTick ) |