> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Monitoring for and trading a breakout

A common concept many traders use is the idea of a breakout. Points of interest are when the price breaks out from a consolidation range or from previous highs and lows.

## Key concepts in this example

* Determining and storing the first 30 bar high
* Submitting a long stop order to be filled when price breaks out from the 30 bar high
* Closing positions after a certain amount of bars have passed
* Resetting the 30 bar high at the start of every new trading session

## Important related documentation

* [IsFirstBarOfSession](/developer/desktop-sdk/references/common/bars/isfirstbarofsession)
* [BarsSinceNewTradingDay](/developer/desktop-sdk/references/common/bars/barssincenewtradingday)
* [BarsSinceEntryExecution()](/developer/desktop-sdk/references/strategy/barssinceentryexecution)
* [BarsSinceExitExecution()](/developer/desktop-sdk/references/strategy/barssinceexitexecution)

## Import instructions

1. Download the file contained in this Help Guide topic to your PC desktop
2. From the Control Center window, select the menu Tools > Import > NinjaScript
3. Select the downloaded file

[SampleBreakoutStrategy\_NT8.zip](https://ninjatrader.com/support/helpGuides/nt8/samples/SampleBreakoutStrategy_NT8.zip)