How To Trade Half Days With Ease

Years ago when I created a program to enter my orders, it made trading so much easier.

How hard can it be to enter an order manually? It turns out there are so many options to include on an order.

It takes way more time than you think, not to mention the mistakes that you inevitably make.

One of the biggest benefits was automatically including a time stop with my exit orders.

Several of my systems hold for the entire trading day, so I include an order that exits the position automatically just before the market closes at, say, 3:55pm ET.

My initial logic was to store a DateTime object and use the time part of it to determine the time of day.

It worked well – until the first half day, like last week before July 4th.

Since the market closes at 1:00pm ET on half days, I would be stuck in my positions well after the close.

This is not just annoying – it could end up being disastrous!

I quickly realized there’s a far better way to implement this so you don’t get caught off guard on half days.

Instead of storing the variable as a DateTime or a time of day, use an integer for the number of minutes before the market close.

Once a year check the list of half days for the upcoming year.

Store that list in a file or database that your code can check when computing the exit time to use in your orders.

If it’s a half day, the market close is 1pm, otherwise 4pm.

In your code, subtract your number of minutes from the market close of the current day.

This way your code will work gracefully on regular trading days and half days.

And you will no longer panic at 1pm when you realize you’ve forgotten that it’s a half day – something that’s happened to me plenty of times. 🙂