order data flow

Imported from previous forum

When an investor goes online to say tdameritrade.com and places an order for say MSFT stock then how does the data go from the td ameritrade website to the say NYSE software? Is it sent as a message. if it is then how? what type/kind of message is sent? is there an intermediate software between tdameritrade and NYSE. if there is then can you please explain how that works and helps? is there a specification to adhere to for this kind of communication. If there is then what is that specification? Does every stock exchange have its own specifcation? How does the stock exchange send an acknowledgment for whether the trade went through or otherwise? Please be as technical as possible

The type of message flow you are describing takes place between a sellside broker and an exchange. Most exchanges will accept order flow in FIX these days. However, there may be subtle differences in the way FIX is used by each exchange. Whereas FIX use in buyside to sellside messaging is less fragmented.

Exchanges should be able top provide specifications detailing how they receive FIX order flow. You should also look into what the FPL ECN/Exchanges Working Group has been up to. They have a Best Practices document that should be helpful.

When an investor goes online to say tdameritrade.com and places an order
for say MSFT stock then how does the data go from the td ameritrade
website to the say NYSE software? Is it sent as a message. if it is then
how? what type/kind of message is sent? is there an intermediate
software between tdameritrade and NYSE. if there is then can you please
explain how that works and helps? is there a specification to adhere to
for this kind of communication. If there is then what is that
specification? Does every stock exchange have its own specifcation? How
does the stock exchange send an acknowledgment for whether the trade
went through or otherwise? Please be as technical as possible

Deepak,

You are asking a very broad question, so it’s not practical to give a comprehensive “technical as possible” answer here in this forum. However, I’ll give you an overview and point to some resources that may help you with the learning curve.

The first thing that happens after a customer transmits an order to a BD is that it gets validated on the BD end (is this an acceptable trade? for this particular customer? at this time? in this specific account? Is the mark open? Did he/she give permission to execute it outside of normal market hours? Etc. Otherwise, reject the order and inform the customer. For retail investors that would generally be a standard SSL encrypted browser-based order sent over the public Internet to the BD.

The more “complex” part of the equation occurs after that order has been received at the BD, and is now a “live order” for execution.

Each BD has its own “order router” that is connected with separate, secure, dedicated, communication links (leased lines or VPNs) out to specific exchanges, ECN’s, ATS, and other potential contra parties. The job of that order router is as follows:

  1. get the best deal for the customer
  2. get the trade done
  3. minimize the “all in” trading cost for the BD

The connections to that order router are often changing.

To learn more about order routing you should go to Interactive Brokers, read all the documentation, study the unbundled commission structures and play extensively with the free demo.
http://www.interactivebrokers.com As you can see there, an investor can actually route their order to a specific execution venue. Plus, there are many to choose from.

To get a feel for various exchanges see:
http://www.itsdoc.org/wiki/tiki-index.php?page=Exchange+and+Market+List
Deep in the Web sites of each exchange are generally technical specifications for directly connecting to it, along with any port costs, fees and charges, etc.

To learn one example of the “technical as possible” ways an order router can connect to an exchange see:
http://www.batstrading.com/subscriber_resources.php Specifications and
http://www.batstrading.com/connectivity_choices.php connectivity.

Yes, each contra party can be different. Yes, there are generally similarities. No, it’s not easy to maintain all the connections to give you universal connectivity to everywhere, at every time. It’s very much a VOLUME based business.

Most exchanges, ecns, ATSs and various contra parties accept orders to trade in FIX specifications. You can read all about FIX on this web site. See: http://www.fixprotocol.org/specifications/ Please note that not all parties use the same version of FIX, or all the features within each version that they do implement. Interactive Brokers offers retail customers a FIX connectivity option. I’m not aware of any other “retail” brokers that allow/encourage a low cost FIX connection.

Note also – most of the time each pair of FIX connections requires a dedicated circuit and a technical testing and certification step. This makes it cost prohibitive for most retail investors to maintain numerous connections with various contra parties. I.e. unless you are trading a LOT of shares, the cost will be absolutely prohibitive.

Also note that FIX generally covers only the “buy and sell” orders. A wholly separate system is generally used to get high-speed market data (bids, offers, order book, trade executions) in and consolidate that information into a unified view. Dedicated fix circuits are generally too slow for this. (See Batstrading.com above for speed notes)

You might be interested in an open source FIX engine that handles a lot of the administrative aspects of maintaining a FIX connection:
http://www.quickfixengine.org/ or a commercial version: http://www.cameronsystems.com/products/fix_engine.html
Although it’s very dated you can take a look at: http://fixprotocol.org/implementation-guide/ to get a feel for the effort and cost involved in maintaining each fix connection.

Here are a few more links to bone up:

Electronic Trading
http://www.itsdoc.org/wiki/tiki-index.php?page=Electronic+Trading

Algorithmic Trading
http://www.itsdoc.org/wiki/tiki-index.php?page=Algorithmic+Trading

Various Standards (Including FIX)
http://www.itsdoc.org/wiki/tiki-index.php?page=Standards

The above just scratches the surface of your question but I hope it give you a start on answering you question.

Rick Labs

PS – Sometime in the future FIX may evolve to the point where it may be offered as an ultra low cost, low latency web service offered by virtually all contra parties. The FIX standard has recently (in v5.0) separated it’s transport layer from the upper “business” layer. This will greatly facilitate this evolution. However web services still have quite a way to go before they will be generally accepted. The long tradition of having dedicated leased lines or private VPN’s between each contra party will not die anytime soon! This is indeed very unfortunate as some sophisticated individual investors and smaller portfolio managers would no doubt benefit from access to the newer type algorithmic order types that are now extensively available to larger institutional investors. In time however the FIX protocol may become available to many more investors at very low cost.