Programming market state logic

Discussion in 'Strategy Development' started by wavetrader007, Dec 6, 2011.

  1. Hi,
    I've been successful so far developing some software for automated trading and I'm now at the point trying to program the logic for maintaining the current state of the market. I see the possible states being CLOSED,PREMARKET,OPEN,AFTERMARKET. I have looked at some other open source software and this is more of a challenge than I first thought and need some input on the following.

    My logic on holidays is that either the market is totally closed or partially open and say on a partial holiday where the market closes (for example) at 1PM that means that the market state would change from open to closed at 1PM, premarket trading would still happen but since the market closes at 1PM for that day it never goes into AFTERMARKET state. But the question remains are there time periods or days where I want to exclude premarket and aftermarket trading states or is it safe to assume that at the time of a partial open holiday it just closes early but premarket trading still happens? Long story short do I need to be able to say in my logic for these dates exclude the market from going into PREMARKET or AFTERMARKET trading or taking into account my Holiday logic will not go into AFTERMARKET state if the market closes early. I am mostly focused on the NASDAQ/NYSE but will eventually want to use the same component for other markets. I've been struggling on this and want to develop it right and my background is in software not markets so any advice would be much appreciated. Does NASDAQ/NYSE have days that are not holidays but have schedules where AFTERMARKET OR PREMARKET trading is not part of the day schedule?
    Thanks for any help or information - wavetrader007