This script has Automatic Instrument Context by default. This means, when this script section executes, it is given direct access to all IPV Properties and Functions.
This script runs when one of the Broker Entry Functions executes. While this Unit Size script is active, the Entry-Order quantity is applied before it is sent to the Can Add Unit script section.
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.
Links: |
---|
Broker, Data Properties, Entry Order Functions, Order Object, Order Sizing |
See Also: |
|
Edit Time: 9/26/2020 3:13:05 PM |
Topic ID#: 639 |