This free NinjaScript strategy will store the last 10 changes in the bid/ask price in a list. You can use this in many ways, e.g. exit position if the first one or two level changes move against you. This is more granular and can tell you more than tracking the last 10 changes in the last traded price.
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.
Details / Instructions:
The way we check for a level change is if the bid price OR ask price has changed. You can easily make it AND instead of OR if you like. Whenever the bid or ask changes it is stored in a list that is 10 items long. Index 0 of the list represents the first level change after your position exists, index 1 represents the second level change etc.
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.