This premium NinjaScript strategy will create a snapshot of the level 2 book on every OnMarketDepth cycle. This means that at any time you can access the volume of bid/ask orders on the books waiting to be filled 10 price levels out.
This NinjaScript download is a single zip file that you import directly into NinjaTrader. It’s not assembled which means you have full access to view and change the source code either in NinjaScript Editor or your preferred way to edit .cs files.
There are many possibilities with this for automated trading, e.g. enter long when the volume of waiting orders on the bid side outnumber the waiting orders on the ask side. The example image on this page shows the basic data you’ll have access to, and from this information you can explore in countless directions.
Possible use case:
Add this to an existing entry signal as a filter to only enter long when the total bid book volume is 20% greater than the total ask book volume, as this could indicate that the path upward has less resistance than the path downward. This example entry method comes with the code.
This code will not work with releases prior to NinjaTrader 8. Click here if you don’t know how to install NT strategies. Use at your own risk, and backtest backtest backtest before you go live with any strategy.