The Limit Order Book is lurking behind every price tick in every market you can imagine. From the ill-liquid real estate market, all the way to high frequency bond trading, the limit order book determines all price movements.
A simple example in my last post of supply and demand demonstrated how price changes in an equity market. I made several arguments justifying the existence of a bid ask spread, and showed how this leads to price formation. My goal in this post is to find clarity in the foggy world of support and resistance using limit order books. Support and resistance information can be used to build confidence when entering or exiting a trade.
Imaginary Price Levels
If you try searching for support and resistance, a wealth of information can be found usually in the form of some article accompanied by several charts with lines claiming to have found the magical levels.
Every such chart I have found, however, has one single thing in common. The stock price always, at some point, just slightly crosses these horizontal lines. To me, it feels like a slap in the face… the ultimate I told you so from market experts that can apparently see into the future. Here’s a great example I picked up on Google.
I realize that mathematical definitions of these levels exist, and I realize that human psychological traits are often correctly considered. Nevertheless, they still lack precision! The arguments for true black and white support and resistance levels always must always have a fair amount of uncertainty. Sadly, this is just another part of working in this business.
If I see a price move past a resistance level in real time (i.e., not being able to see the entire future nicely displayed in front of me like Figure 1), I often question if the level has been breached. This could perhaps leave you in the worst possible position as the market rockets the wrong way. The limit order book can reduce this uncertainty by displaying real information.
If you try searching for support and resistance, a wealth of information can be found usually in the form of some article accompanied by several charts with lines claiming to have found the magical levels.
Suppose a stock is testing a human psychological resistance level of $20.00 and your algorithm has signaled that you initiate a short position. You wish to enter the market at the highest possible price without missing the peak. More importantly though, you wish to confirm a resistance level still exists . If the current order book is displayed as below left, you would have confidence that enough sell pressure is present to hold the resistance.

Figure 2: The left side of the image shows more market depth on the offer (orange), which is resistance. The right image shows light depth, which is the absence of resistance.
On the other hand, if the order book is displayed as above right, it it would take only a moderate collection of market order buyers to break the $20.00 level– and break it fast in this example. Short sellers would run to cover, and the market could swiftly move against you.
Measure Support and Resistance
I found some research out of Wharton suggesting an order book metric (cumulative depth), and have heard more advanced ideas shared in my personal research symposiums. That said, I think this situation is being made too complex.
Translating the above example into math should be straight forward, and customizable to the strength of signal generated by your algorithm. Allow me to suggest a crude, yet effective starting place.
Suppose you are back watching an equity as it approaches what you think to be a $20.00 resistance level. You need a metric to identify the strength of the resistance, and have one of the given order books displayed above in Figure 2. In the order book on the right, you could find the average price it would take a market buyer to pass four levels of depth. This calculation ((2*19.99+8*20+1*20.01+2*20.22)/12) shows resistance strength of 20.0008.
Using an analogous calculation on the left shows resistance strength of 20.0063, a greater value that can act as a metric defining a resistance level.
The more expensive it is to surpass a level of resistance, the less likely it will happen.
Exactly how this metric is created has many degrees of freedom. If you suspect a resistance level exists at $20.00, you could initiate a position that depends on how expensive a set of market orders would have to be to consume past the resistance. You could also alter how far deep to look when calculating the average price.
These two measures involve simple math, and provide a deeper insight to market movements. They are based on the absolute lowest levels of price formation by supply and demand, and are certainly items to consider when building a full system. In my next post, I will provide a more specific strategy to consider implementing.