|
Reject |
Top Previous Next |
|
Rejects the order and prevents further processing. This function can only be used in the Unit Size, Can Add Unit, and Can Fill Order scripts.
Syntax
Reject( message )
Parameters
Example for the Unit Size script: ' Compute the amount of equity to risk. riskEquity = system.tradingEquity * riskPerTrade
' Compute the risk in dollars. dollarRisk = order.entryRisk * instrument.bigPointValue
' Adjust the unit size to this percentage. tradeQuantity = riskEquity / dollarRisk
IF tradeQuantity < 1 THEN ' Reject the order if the trade quantity is less than 1. order.Reject( "Trade Quantity is less than 1." ) ELSE ' Set this into the order if the quantity. order.SetQuantity( tradeQuantity ) |