What it does

Inside/Outside Bar Marker is a clean pattern-highlighting tool for traders who want local compression and expansion events to stand out on the chart. It works best as a timing or context aid alongside structure and location tools.

Who this is for

This page is a good fit for traders who want a readable Inside/Outside Bar Marker workflow without having to reverse-engineer the setup from forum posts or screenshots.

Key terms for this tool

Review the core trading and platform terms tied to this page before changing settings or using the study in a live workspace.

What it is not

Inside/Outside Bar Marker is a chart-context tool. It does not place trades, manage risk automatically, or promise that a specific pattern will resolve in one direction. Use it to organize decisions, not to outsource them.

Chart examples

This chart capture shows the study on a real NinjaTrader workspace. Use it as visual reference, then confirm behavior on your own instrument, session, and timeframe.

Best fit

  • Highlighting compression and expansion bars quickly.
  • Adding local pattern context to opening range or level-based workflows.
  • Reviewing whether marked bars matter more at specific chart locations.

Before using it live

  • Import the NinjaTrader 8 ZIP through NinjaTrader's normal import flow.
  • Test the marker frequency on the exact chart type you trade.
  • Use it with location context so every marked bar is not treated equally.
  • Review how the tool behaves on your actual session template, chart type, and instrument.

Settings to review

Show inside bars

Turns inside-bar markers on or off.

Show outside bars

Turns outside-bar markers on or off.

Marker style

Controls how the pattern is annotated on the chart.

Installation notes

  1. Import the NinjaTrader 8 ZIP through NinjaTrader's normal import flow.
  2. Test the marker frequency on the exact chart type you trade.
  3. Use it with location context so every marked bar is not treated equally.

Downloads

FreeIndicators Inside/Outside Bar Marker for NinjaTrader 8 NinjaTrader 8
Download

After the download

Keep the next step tied to this exact tool

Install it cleanly, subscribe for future updates if this workflow matters, or move straight into a structured request if the tool needs another platform or a custom version.

Source code

These source examples are provided for copy/paste workflows on other charting platforms. Review and test any script in a simulator before using it on a live chart.

TradeStation EasyLanguage / MultiCharts PowerLanguage InsideOutsideBarMarker.eld.txt
{
  Inside/Outside Bar Marker
  FreeIndicators.com source example.
  Works as a starting point for TradeStation EasyLanguage and MultiCharts PowerLanguage.
}

Vars: InsideBar(False), OutsideBar(False);

InsideBar = High < High[1] And Low > Low[1];
OutsideBar = High > High[1] And Low < Low[1];

If InsideBar Then Plot1(High, "Inside");
If OutsideBar Then Plot2(Low, "Outside");
MetaTrader 4 MQL4 InsideOutsideBarMarker.mq4
// Inside/Outside Bar Marker
// FreeIndicators.com source example for MetaTrader 4.
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 DodgerBlue
#property indicator_color2 Crimson
#property indicator_color3 SeaGreen

double Buffer1[];
double Buffer2[];
double Buffer3[];

int init() {
   SetIndexBuffer(0, Buffer1);
   SetIndexBuffer(1, Buffer2);
   SetIndexBuffer(2, Buffer3);
   return(0);
}

int start() {
   int counted = IndicatorCounted();
   int limit = Bars - counted - 1;
   for(int i = limit; i >= 0; i--) {
      bool insideBar = High[i] < High[i + 1] && Low[i] > Low[i + 1];
      bool outsideBar = High[i] > High[i + 1] && Low[i] < Low[i + 1];
      Buffer1[i] = insideBar ? High[i] : EMPTY_VALUE;
      Buffer2[i] = outsideBar ? Low[i] : EMPTY_VALUE;
   }
   return(0);
}
MetaTrader 5 MQL5 InsideOutsideBarMarker.mq5
// Inside/Outside Bar Marker
// FreeIndicators.com source example for MetaTrader 5.
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots 3

double Buffer1[];
double Buffer2[];
double Buffer3[];

int OnInit() {
   SetIndexBuffer(0, Buffer1, INDICATOR_DATA);
   SetIndexBuffer(1, Buffer2, INDICATOR_DATA);
   SetIndexBuffer(2, Buffer3, INDICATOR_DATA);
   return(INIT_SUCCEEDED);
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[]) {
   int start = prev_calculated > 1 ? prev_calculated - 1 : 1;
   for(int i = start; i < rates_total - 1; i++) {
      bool insideBar = high[i] < high[i - 1] && low[i] > low[i - 1];
      bool outsideBar = high[i] > high[i - 1] && low[i] < low[i - 1];
      Buffer1[i] = insideBar ? high[i] : EMPTY_VALUE;
      Buffer2[i] = outsideBar ? low[i] : EMPTY_VALUE;
   }
   return(rates_total);
}
TradingView Pine Script v5 InsideOutsideBarMarker.pine
//@version=5
indicator("Inside/Outside Bar Marker", overlay=true)

insideBar = high < high[1] and low > low[1]
outsideBar = high > high[1] and low < low[1]
plotshape(insideBar, "Inside", shape.triangleup, location.belowbar, color=color.blue, text="IB")
plotshape(outsideBar, "Outside", shape.triangledown, location.abovebar, color=color.orange, text="OB")

Limitations

  • Pattern frequency can get noisy on some chart types.
  • A marked bar still needs location and follow-through context.
  • Outside bars and inside bars do not predict direction by themselves.

Frequently asked questions

Does it repaint?

This indicator is designed as a chart reference tool, not as a hindsight-only backfitted signal. Even so, you should still test it bar by bar on your chart type to confirm how it behaves on the active bar.

Which platforms are covered?

NinjaTrader 8, TradeStation EasyLanguage, MultiCharts PowerLanguage, MetaTrader 4, MetaTrader 5, TradingView Pine Script are currently represented through downloads or source pages.

Is source code included?

Yes. This page includes source examples or links to platform-specific source pages where applicable.