SetExitOnClose (Reserved Word)
SetExitOnClose is a built-in stop reserved word used to place an order to exit all shares or contracts in all positions on the close of the last bar of the trading session on an intra-day chart.
For historical simulations, SetExitOnClose generates a market order on the bar close event of the last intra-day bar for each day in the chart. When used in an automated strategy placing real-world orders, SetExitOnClose generates a limit order into the post market trading session, (if one exists), otherwise a market order is generated for the open of the next regular session day.
SetExitOnClose by default uses the closing session time specified by the custom session settings of the chart.
SetExitOnClose can only be used in a Strategy.
When automating a strategy, you will not want to use SetExitOnClose as a way to make sure that all of your positions are closed prior to the regular session end time. To do this, you will need to generate a closing order prior to the last bar in the chart.
Usage
SetExitOnClose
Parameters
None
Orders Generated
Market Order to Sell (Long Exit) or Market Order to Buy to Cover (Short Exit)
or
Limit Order to Sell (Long Exit) or Limit Order to Buy to Cover (Short Exit) (automated strategy with a post market session)
Signal Name
End of Day Exit
Example
Exit all shares or contracts in all positions on the last bar of the trading day on an intra-day chart.
SetExitOnClose;
See Also
Close at End of Day (strategy)