Called by Trading Blox Builder as the result of a call to the broker statement. This script can be used to determine if the order will be placed or not. The Can Add Unit script can be used to implement risk limits.  For example, the Turtle System's Correlation Limiter uses the Can Add Unit script to limit the number of units which can be taken based on market correlation.

 

The Can Add Unit script is only called for entry orders created by calls to the Broker object in scripting. It is not called for entries due to Actual Broker Positions.

 

The entire order object is available. It contains information about this potential order to be placed. See the Order object for available properties and functions.

 

If multiple Can Add scripts are in a system, the order will be rejected if ANY Can Add script rejects the order.

 

The following is an example of a Can Add Unit script:

 
  IF instrument.closelyCorrelatedLongUnits >= maxCloselyCorrelatedUnits OR
      instrument.looselyCorrelatedLongUnits >= maxLooselyCorrelatedUnits THEN
 
      order.Reject( "Too Many correlated units" )
  ENDIF

 


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


Topic ID#: 184

 

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