Logo

MQT_BarSizeStudy

Identify Your Most Volatile Trading Windows — With Per-Bar Labels & CSV Export

MQT_BarSizeStudy ranks custom time-of-day slots by average bar size (High-Low) across all loaded history. Optionally display per-bar size labels (ticks/points/both), filter by RTH, select specific days of the week, and export detailed CSV reports. Perfect for traders who want to pinpoint high-volatility windows and optimize entry timing.

Back to Indicators

Key Features

Custom Time Slot Analysis

Define your own slot size (in seconds) and the indicator ranks each time-of-day window by average bar size (High-Low in ticks).

Top Volatility Window (On-Chart)

Display a live on-chart window showing the top N most volatile time slots with average, max, and observation counts—updated every N bars.

Per-Bar Size Labels

Optionally show labels under each bar displaying size in Ticks, Points, or Both—with configurable displacement and color.

RTH Filtering

Use UseRthWindow to filter slot statistics to Regular Trading Hours only, or leave it off to analyze the full session.

Day-of-Week Selection

Enable/disable specific days (Sunday–Saturday) to focus your analysis on the trading days that matter most to your strategy.

CSV Export

Export a detailed CSV file with all time slots ranked by average bar size, including max values, timestamps, and observation counts.

Chart Examples

Bar size labels showing tick values under each bar

Ticks Display Mode

Per-bar labels showing size in ticks with Top Volatility Window in upper-right corner

Bar size labels showing tick values with detailed volatility stats

Detailed Volatility Stats

Top Volatility Window displays ranked time slots with average, max, and observation counts

How It Works

1

Define Your Time Slots

Set SlotSeconds (e.g., 30 seconds) to divide the trading day into custom windows. The indicator tracks each slot's average bar size (High-Low in ticks).

2

Collect Historical Data

As bars close, the indicator accumulates statistics for each time slot across all loaded history, optionally filtering by RTH and selected days of the week.

3

Display Top Volatility Window

Enable ShowTopVolatilityWindow to see a live on-chart ranking of the top N most volatile time slots, updated every N bars with average, max, and observation counts.

4

Export & Analyze

When the indicator reaches real-time or terminates, it prints the top N slots to the Output window and optionally exports a full CSV report for deeper analysis.

Indicator Settings

Parameter Description Default
TopN Number of top-ranked time slots to print to the Output window and include in the CSV export. 25
SlotSeconds Size of each time-of-day slot in seconds (e.g., 30 = 30-second windows). 30
UseRthWindow If true, only bars within the RTH window (defined by RthStartTime/RthEndTime) are included in slot statistics. true
RthStartTime RTH start time in HHmmss format (local PC time). Example: 83000 = 8:30:00 AM. 83000
RthEndTime RTH end time in HHmmss format (local PC time). Example: 150000 = 3:00:00 PM. 150000
ExportCsv If true, exports a CSV file with all time slots ranked by average bar size. true
CsvFileName Name of the CSV file to export (saved to NinjaTrader user data directory). MQT_BarSizeStudy.csv
ShowTopVolatilityWindow Display a live on-chart window showing the top N most volatile time slots. true
TopVolatilitySlots Number of top slots to display in the on-chart volatility window (1-50). 15
TopVolatilityWindowPosition Position of the volatility window on the chart (TopLeft/TopRight/BottomLeft/BottomRight). TopLeft
TopVolatilityUpdateEveryNBars Update the volatility window every N bars (1 = every bar, higher = less frequent updates). 20
ShowBarSizeLabels Display per-bar size labels under each bar. true
LabelMode Label display mode: Ticks, Points, or TicksAndPoints. Ticks
LabelDisplacementTicks Number of ticks below the bar's low to place the label (0-1000). 2
LabelFontSize Font size for bar size labels (note: chart default text style is used on some NT8 builds). 12
LabelBrush Color of the bar size labels. DimGray
LabelOnlyDuringRth If true, only show labels for bars that fall within the RTH window (independent of stats filter). false
LabelEveryNBars Show a label every N bars (1 = every bar, higher = less frequent labels). 1
RunSunday Include Sunday bars in the analysis. false
RunMonday Include Monday bars in the analysis. true
RunTuesday Include Tuesday bars in the analysis. true
RunWednesday Include Wednesday bars in the analysis. true
RunThursday Include Thursday bars in the analysis. true
RunFriday Include Friday bars in the analysis. true
RunSaturday Include Saturday bars in the analysis. false

Frequently Asked Questions

What does MQT_BarSizeStudy analyze?

It divides the trading day into custom time slots (defined by SlotSeconds) and ranks each slot by average bar size (High-Low in ticks) across all loaded historical data.

How do I filter the analysis to Regular Trading Hours only?

Enable UseRthWindow and set RthStartTime and RthEndTime to your desired RTH window. Only bars within this window will be included in the slot statistics.

Can I see the results on the chart in real-time?

Yes. Enable ShowTopVolatilityWindow to display a live on-chart window showing the top N most volatile time slots, updated every N bars with average, max, and observation counts.

What are the per-bar labels?

When ShowBarSizeLabels is enabled, the indicator displays the size of each bar (High-Low) under the bar. You can choose to display in Ticks, Points, or Both.

Can I filter labels independently from statistics?

Yes. LabelOnlyDuringRth filters only the labels (independent of the stats filter). You can also use LabelEveryNBars to reduce label frequency.

How do I export the results?

Enable ExportCsv and specify a CsvFileName. When the indicator reaches real-time or terminates, it exports a CSV file to your NinjaTrader user data directory with all time slots ranked by average bar size.

Can I analyze specific days of the week only?

Yes. Use the Days group parameters (RunSunday, RunMonday, etc.) to enable/disable specific days. Only bars from enabled days will be included in the analysis.

What slot size should I use?

It depends on your trading style. Scalpers might use 30-60 seconds, while swing traders might use 300-600 seconds (5-10 minutes). Experiment with different values to find the optimal window for your strategy.

Back to Indicators