Improved market on close exits
AlertmonEOD This feature is under testing now.
Exits at market on close (MOC) have two issues.
The first is that the volatility is often extreme and fills are on average very poor.
The second is that MOC orders intermittently fail to execute, leaving you with a naked position. This is particularity dangerous on Friday night as you have exposure over the weekend.
There is also the issue that on stocks and the Dax, you cant use exit at 15:00 Central USA time / 2200 German time as the market is closed a second before your order arrives.
In the past numerous work around have been made for this complex issue.
Now we have a fix for both issues.
At up to 4 different times before the close, we can try to exit at an improved price levels. Should these fail, a market order will be sent at the time of TimeExitOffset_ticks4 + LimitExitDelay_seconds.
Approx 75 seconds before MOC we issue a limit order that aims to get a few ticks better price than the current price. As the market is volatile, there is a good chance this limit will fill at a good price. This limit order remains for about 60 seconds. (the user can change this) However other times the limit will not fill and your exit fill is poor. This should average out to give you reduced slippages, and improved liquidity.
On every symbol you can vary the time in ticks improvement, though I use 2 ticks as my default. This is much better than competing with every other user for a fill at the exact time of 15:00:00 Central USA time.
Inputs
Order_account: enter your account name. IE SIM123456
ComputerExitTime: This is the exit by your PC clock time, not the time on your chart. For markets like the DAX that close at 22:00:00 you must have time margin to spare.
This also assumes your PC clock is correct. Make sure windows time sync is working.
So lets say the Dax closes at 22:00:00 in German time, but this is 15:00:00 on your PC.
You could set ComputerExitTime to 14:58:30 with a 60 second LimitExitDelay. This means if the limit order doesn't fill, a market exit at 14:59:30 will occur. This gives 30 seconds
extra room for delays.
If the market was S&P500 futures that closes at 15:15:00, then there is no need to be so concerned about time tolerance, as an exit after 15:00:00 will still work.
LimitExitDelay_seconds: Default is 60 seconds.
Note every user should vary Computer exit time and LimitExitdelayseconds to ensure you are not competing for the same time / price of fills.
Critical limitation. AlertmonEOD will close ALL of the used symbol in your account. So you cannot mix overnight systems and day trading systems on the same symbol in the same account.
You can mix different symbols in the same account, and only the symbol that has AlertmonEOD indicator on it will be closed in the specified account. If you trade long term and short term systems using the same symbol, they must be done in different accounts.
It is possible future builds of AlertmonEOD will have a fix for this limitation.
Sysname: You can use this for alertmon to make sure the indicator is active on the chart. This name must be unique for every strategy.