Feature guide · 5 min read
Demand/Supply Boxes
Tracks the most recent up and down fractals as dotted level lines. When price breaks back through one, it draws a box on the last opposite-colored candle before the break.
- Settings toggle
- Enable Demand/Supply Boxes
- NinjaTrader 8 name
- ToredaFractalDS
- Ships enabled
- No
What it does
The indicator tracks the most recent up fractal (a high with `Periods` lower highs on each side) and down fractal as dotted level lines — teal above, maroon below. When price breaks back through one of those levels, it draws a box:
- A break up through the top-fractal level draws a demand box spanning the last red candle before the break, and fires `LongSignal`.
- A break down through the bottom-fractal level draws a supply box spanning the last green candle, and fires `ShortSignal`.
Each level can be broken once. After that it is frozen until a new fractal replaces it, so a level that has already done its job cannot keep firing.
How to read it
The box marks the candle that was still going the wrong way immediately before the break — the last of the old direction. That is the area the move originated from, which is why it is worth watching if price comes back to it.
The signal fires on the break bar's close
With the default WickBody break type, the entry bar may already have retraced part of the move by the time the bar closes. Body mode waits for a close through the level instead, which is slower but cleaner.
Inputs
| Input | Default | Meaning |
|---|---|---|
| Periods | 5 | Bars on each side required to confirm a fractal. Higher = fewer, more significant levels. Max 100. |
| Break Type | WickBody | WickBody breaks on High/Low, so a wick counts. Body breaks on Close only. |
| Change Box Color On Close | Off | When on, a demand box that price closes below flips to supply colors and vice versa, so a failed zone shows as the opposite type. |
| Max Boxes | 100 | Oldest boxes are removed beyond this count. |
| Show Swing Markers | On | Draws a × at each confirmed fractal high and low. |
| Demand/Supply Background & Border | Green / Red | Box colors. Backgrounds are drawn at 80% transparency. |
| Swing High/Low Color | Yellow | Marker colors. |
| Draw Visuals | On | Master drawing switch. |
Adding it to a chart
- Right-click the chart → Indicators… → find ToredaFractalDS, click Add, set the inputs, click OK.
- Color inputs shown as #RRGGBB are typed as hex text, e.g. `#6FA8DC`. An invalid value falls back to a default and prints a note in the NinjaScript Output window rather than failing the indicator.
- Boxes are drawn on the bar the break happens and never move. The level lines run from the fractal bar to the current bar until they are broken.
Notes and limitations
- A break with no prior opposite-colored candle on record freezes the level but produces no box and no signal.
- The signal fires on the break bar's close, so with WickBody the entry bar may already have retraced part of the move.
For strategy builders
NinjaTrader 8 only
Every plot is registered transparent, so it changes nothing on a chart until you color it in the indicator dialog. Levels are NaN when there is no value — never 0, which would compare as a real price — and flags are 1/0.
| Plot | Meaning |
|---|---|
| LongSignal / ShortSignal | 1 on the bar a demand / supply box fires, else 0. |
| FractalTop / FractalBottom | The live fractal break levels — the dotted lines. NaN until the first fractal confirms. |
| DemandTop / DemandBottom | Bounds of the most recent demand box. NaN until one exists. |
| SupplyTop / SupplyBottom | Bounds of the most recent supply box. |
This content is for educational purposes only and is not financial advice. Trading involves substantial risk of loss. See our risk disclosure for details.