The things you want to do can be accomplished in a couple of ways, depending upon your data feed. FYI there are commercial providers that provide this functionality to some degree for a price. If you need something other than what they provide then things quickly get much, much more expensive. I look at the type of data you mention above but for my order sizes I dont yet look at this type of data in near real-time - although I am working on a system that will allow this....... For now my system looks at this data a couple of times per day and yes I do look at changes in order flow.