Free data equals bad data. Cheap data equals bad data. You are not dealing with real data here. This data has been aggregated to the 1ms timeframe at best. I have seen other such data that is aggregated to 4ms timeframe. The providers call this real-time data but be careful. In data provider parlance, real-time can be anything that is provided less than 10 minutes from the time the event occurred.
Real trade message data from the exchange is timestamped with 1ns resolution. Trade messages typically contain the information for a single transaction. This information includes Exchange Time (when the transaction occurred), Sending Time (when the transaction message was sent to the wire), Price, Quantity Filled, Order Count (Aggressing order filled by N sitting orders), Aggressor Side (Sell the Bid, Buy the Ask).
The highest volume of messages in a session comes from order book updates. These consist of new limit orders, sitting order modification and/or cancellation. The volume of these messages can exceed trade messages by 5 to 1. There are also various administrative messages sent to indicate exchange status, market status, instrument status, statistics, etc.
Historical data from the exchange is stored as a PCAP (packet capture) file which contains the binary encoded messages for the entire session.
The exchanges publish very detailed specifications on the message protocols (usually based on SBE or FIX). Do a bit of google search to find the specifications for the exchange's message protocol to find out exactly what the messages contain and timing of the messages. Search "NYSE FIX Protocol" or "NASDAQ Market Data Message Spec" and go from there.
The only place to get this data is from the exchange. Of course, there are other providers of market data, but they offer aggregated data and are often restricted by the terms of their license agreement (in exchange for lower cost) with the exchange from providing the raw data. If you want the real data, the only way is to be directly licensed by the exchange to have access to this data.
If you can get the license, which retail traders and researchers usually cannot, you have been granted permission to connect to the market data feed and receive the serialized, encoded messages. Great! Now all you have to do is develop an application that can connect to the exchange session (must pass a rigorous certification process), receive the message packets (over UDP typically), decode them and present them for analysis by a trading strategy. If you want to display the data on a chart on a screen you have to pay more for the licensing fee. There are vendors who offer the "FIX Decoders", which is a great way to accelerate the development of your system to read market data. Of course, you'll want to place orders as well. The order feed is an entirely separate feed and protocol, but the process of getting licensed, certified and able to place orders is similar except for the fact that now other people become concerned with your risk profile and such. But I digress.
You also need to be collocated as well. The connection to the exchange servers does not work for servers that are not collocated.
In summary, any data you get that is not from the exchange has been aggregated or manipulated in some way by the data provider to fit within their business model, storage capacity, infrastructure, etc. It is not real data. I'm afraid far too many people simply are not aware of this.
28,1393603143937,56920,400 28,1393603143937,56920,1004 28,1393603143937,56910,600 28,1393603143937,56910,100 28,1393603143937,56910,100 28,1393603143937,56910,100 28,1393603143937,56910,100 28,1393603143937,56900,100 28,1393603143937,56900,800
why in this case the transaction prices are different at the same instant? I had thought about selling and buying prices but there are 3 different prices at the same instant $\endgroup$