This script section is similar to the Can Add Unit script section. It often applies various information and filters to an Active-Order to ensure the system's portfolio goals are supported. However, where it is different is how it executes before the Unit Size script section adds size to the unit. The Can Add Unit script section runs after the Unit Size script section is completed.
In this script section will execute right after an order generated by Broker-Object function. Orders are alwas always active because it is the order that caused this script section to be available. Because this script section executes ahead of the Unit Size script, any missing protective exit price can be applied or changed, and text that provides order-reason can be added to one or more units being being looped. Filters can be applied to ensure that the additional unit additions do not create risk boundaries greater than how the design requires the system rules of how those script sections are managed.
This Can Place Order script, which runs for entries and exits as they are being created and placed, can be used as a generic replacement for the Can Add Unit script.
In the Roundtable forum here: https://tinyurl.com/ybct9ast
The following conversation about how to add a unique reason to each unit transpired.
Post by Tim Arnold » Tue May 05, 2020 11:48 am
Thinking outloud, I guess I would start with the idea of setting an IPV flag before the adjustment, and using that in the Can Place Order script to know where this order is coming from and set the rule accordingly. If you have multiple rules that exit using the adjust position, you could expand this concept so the adjustFlag is a number from 1 to 10. Or, even a string that contains the rule label that you want to apply to the order.
adjustFlag = TRUE
AdjustOnOpen
adjustFlag = FALSE
Links: |
|---|
Broker, Data Properties, Entry Order Functions, Exit Order Functions, Order Object, Order Sizing |
See Also: |
Edit Time: 11/7/2020 3:40:10 PM |
Topic ID#: 679 |