Free Bid Ask Change NinjaScript

$0.00

This Free Bid Ask Change NinjaScript 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 useful for short-term, order flow, and high frequency trading because tracking the bid ask level changes is far more granular than tracking changes in the last traded price (or mark).

Overview

This Free Bid Ask Change NinjaScript 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 useful for short-term, order flow, and high frequency trading because tracking the bid ask level changes is far more granular than tracking changes in the last traded price (or mark).

This Bid Ask NinjaScript add-on is 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.

Free Bid Ask Change NinjaScript Output

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, each change is stored in a list that is 10 items long (separate lists for bid and ask). Index 0 of the list represents the first level change after your position is filled, index 1 represents the second level change etc.

This can be be useful in automated high frequency trading because it can anticipate which direction the next price tick will go. An example of how the Free Bid Ask Change NinjaScript can anticipate a price move: If the ask goes from $100 to $101 then back and forth several times while the bid stays at $99 this can imply that the buyers are staying steady while the sellers are backing off, hence the next price move will tick up to follow the sellers.

Another use case for the Free Bid Ask Change NinjaScript would be to exit your position at break-even if the very first change in bid or ask is in the opposite direction of your trade direction, e.g. if you open a sell position at $101 then the ask moves from $101 to $102 while the bid stays at $99, you can take this as a sign that the trading price is more inclined to move up rather than down. There's no need to code this idea yourself as you can find it ready to deploy in our Free Break Even Trading Exit NinjaScript.

Notes

The Free Bid Ask NinjaScript download is a single zip file that you import directly into NinjaTrader.

This code will not work with releases prior to NinjaTrader 8.

Got something to discuss?