This option will sort all the exit orders for a particular unit and fill the one closest to the open. Use Smart-Fill-Exit option when the system's exit orders requires that the best, or nearest price be reported in the Positions & Orders Report.
In a system that generates many exit orders at different prices, this Global Parameter Properties feature set to TRUE will limit the orders in the Positions & Orders report to the order that has the best protection price.
instrument.SetExitStop function sets an IPV for the instrument with the best protective exit stop price. This nearest exit price is then applied the following day.
How this feature works can be seen by stepping this feature's operational state and the adding the exit price rule to the order.SetRuleLabel or order.SetOrderReportMessage function. Stepped output results the details of which orders are nearest and then get placed in the Positions & Order Report, and the TradeLog.csv report can be seen easily.
To aid in this process discovery, Trading Blox Builder provides an Entry-Exit blox named "Donchian Smart Fills" where multiple exit orders can be placed at the same time, and the operation of how this feature operates can be seen by using "Donchian Smart Fills" in system where both states of this feature are exercised.
This feature can also be enabled and disabled in scripting using this function with either a TRUE or FALSE value. It is also possible to use scripting to discover this feature's operational state by examining the test.smartFillExit property (see example).
Syntax: |
---|
test.SetSmartFillExit( aTrueFalseValue ) |
Parameter: |
Description: |
---|---|
aTrueFalseValue |
Parameter will respond to any True or False value. True = 1, False = -1 |
Example: |
---|
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OR ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Note that for multiple exit orders to work
Print "test.smartFillExit: ", test.smartFillExit |
Returns: |
---|
test.smartFillExit: 1 |
Links: |
---|
General Properties, Global Parameter Properties, instrument.SetExitStop, test.smartFillExit |
See Also: |
Edit Time: 10/23/2020 11:43:45 AM |
Topic ID#: 560 |