This is script is only called when a Broker Entry Function is executed. During the execution of an Entry-Function the Broker object will call the Unit Size script so that the logic in the attached Money Manager module can process the Entry information.
How the order information is handled in the UNIT SIZE script can vary because different systems require different order sizing methods. At its simplest form of Unit Sizing a quantity of contracts or shares are added to the order's quantity property. Fixed Fractional Sizing, Account Fixed Allocation, or any other method used to determine sizing will usually have a qualifying process in the logic to determine if the allocation or risk expense will allow a quantity that is larger than the instrument.roundlot value. When the quantity calculation falls below this minimum instrument quantity for establishing an order, the order.Reject("Reason") function is executed. When orders are rejected their instrument.symbol, instrument.date and reason for the rejection are placed into the Trading Blox Filter.Log file. In addition the order.continueProcessing property will be changed from it default value of TRUE to FALSE.
Orders completing their processing in UNIT SIZE are then processed in the CAN ADD UNIT script section so that orders that are not rejected can be managed by that script section so as to determine if the order can be sent to the brokerage for processing. Order can be filtered, adjusted and rejected in the CAN ADD UNIT script. Order rejections in this script are handled and reported in the same way as they are rejected in the UNIT SIZE script.
For more information on UNIT SIZE scripts review the information shown in Order Sizing.
order.continueProcessing and order.processingMessage properties will be set when the order.SetQuantity function is called. When a quantity is set, the equity, volume, Portfolio Manager, and Risk Manager filters are called and checked. If any of these fail, then the status will be available at this time.
Edit Time: 5/10/2017 8:43:36 AM
Topic ID#: 639