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.

 

Global Parameter Properties

Smart Fill Exit Option

In a system that generates many exit orders at different prices use this Global Parameter Properties feature set to TRUE to limit the orders in the Positions & Orders report to the order that has the best protection price.

 

Notes:

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:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  In order for multiple exit orders to work
'  correctly, Smart Fills must be set to true.
If NOT test.smartFillExit THEN
  '  Enable Smart Fill Exit Process so the nearest
  '  exit order will be executed first.
  test.SetSmartFillExit( TRUE )
ENDIF
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

OR

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'  Note that for multiple exit orders to work
'  correctly, Smart Fills must be set to true.
If NOT test.smartFillExit THEN
  MessageBox( "This system requires that the" _
              + " Global Parameter Smart Fills is" _
              + " set TO TRUE For the multiple exit" _
              + " orders TO be processed correctly." )
  test.AbortSimulation
ENDIF
 
'  Another option rather than the error message,
'  is to just set Smart Fills to true behind the scenes:
test.SetSmartFillExit( TRUE )

 

Print "test.smartFillExit: ", test.smartFillExit

Returns:

test.smartFillExit: 1

 

Links:

General Properties, Global Parameter Properties, instrument.SetExitStop, test.smartFillExit

See Also:

order.SetOrderReportMessage, order.SetRuleLabel

 


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


Topic ID#: 560

 

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