Free tool

Session Bar Numbers Indicator for cTrader

A simple chart overlay that prints bar numbers for a defined session start time. Built for intraday traders who want clean journaling, faster review, and fewer “which candle was it?” discussions.

What this indicator does

It numbers bars starting from a session start time you define (default: 09:00 UTC). By default it draws only odd numbers (1, 3, 5, …), so it stays readable.

  • Session start time is configurable (hour and minute).
  • Optional restriction to 5 / 10 / 15 minute charts.
  • Numbers print below the bar using a small vertical offset.

This is a utility, not a trading system. No entries, no exits, no signals. Just clarity.

Session Bar Numbers indicator screenshot

How to use it

Use it when you screenshot your setup, journal trades, or review execution. You can reference “bar 7” instead of guessing what someone meant by “that candle”.

Good for
  • Session structure review
  • Breakout and range study
  • Teaching and communication
  • Post-session debriefs
Want direct help?

If you want someone to sanity-check your DAX/FTSE routine, session plan, risk, and execution, go to the mentorship page.

Go to mentorship and booking

How to install it in cTrader

  • Open cTrader and go to the Automate tab.
  • Create a new Indicator.
  • Delete the template code and paste the code from the section below.
  • Click Build to compile.
  • Go back to the Trade tab and add the indicator to your chart.
  • Set your session start time and any restrictions you want.
Show full cTrader indicator code (copy & paste into Automate)
using cAlgo.API;

namespace cAlgo
{
    [Indicator(
        IsOverlay = true,
        TimeZone = TimeZones.UTC,
        AccessRights = AccessRights.None,
        AutoRescale = false
    )]
    public class SessionBarNumbers : Indicator
    {
        [Parameter("Session start hour", DefaultValue = 9, MinValue = 0, MaxValue = 23)]
        public int SessionStartHour { get; set; }

        [Parameter("Session start minute", DefaultValue = 0, MinValue = 0, MaxValue = 59)]
        public int SessionStartMinute { get; set; }

        [Parameter("Show only on 5 / 10 / 15 min", DefaultValue = true)]
        public bool RestrictToIntraday { get; set; }

        [Parameter("Vertical offset (pips)", DefaultValue = 5, MinValue = 0)]
        public int VerticalOffsetPips { get; set; }

        public override void Calculate(int index)
        {
            // Limit to 5, 10, 15 minute if requested
            if (RestrictToIntraday)
            {
                var tf = TimeFrame;
                if (tf != TimeFrame.Minute5 &&
                    tf != TimeFrame.Minute10 &&
                    tf != TimeFrame.Minute15)
                    return;
            }

            var time = MarketSeries.OpenTime[index];

            // Find session start index for this day
            int sessionStartIndex = FindSessionStartIndex(index, time.Date);
            if (sessionStartIndex == -1)
                return;

            // Bar number within session: 1,2,3,...
            int barNumber = index - sessionStartIndex + 1;

            // Only draw odd numbers: 1,3,5,...
            if (barNumber % 2 == 1)
                DrawBarNumber(index, barNumber);
        }

        private int FindSessionStartIndex(int fromIndex, System.DateTime date)
        {
            for (int i = fromIndex; i >= 0; i--)
            {
                var t = MarketSeries.OpenTime[i];
                if (t.Date != date)
                    break;

                if (t.Hour == SessionStartHour && t.Minute == SessionStartMinute)
                    return i;
            }

            return -1;
        }

        private void DrawBarNumber(int index, int number)
        {
            if (index < 0 || index >= MarketSeries.Low.Count)
                return;

            var low = MarketSeries.Low[index];
            var offsetPrice = low - (Symbol.PipSize * VerticalOffsetPips);

            // One label per bar index – same name every tick, so it just updates
            var labelName = "session_bar_" + index;

            ChartObjects.DrawText(
                labelName,
                number.ToString(),
                index,
                offsetPrice,
                VerticalAlignment.Top,
                HorizontalAlignment.Center,
                Colors.Gray
            );
        }
    }
}
Disclaimer: This software is provided “as is”, with no guarantees, no warranties, and no promise it still compiles or behaves the same after platform updates. Personal use only. All rights reserved. Redistribution or modification requires my explicit written consent.

This indicator provides no trading signals, no financial advice, and no guarantee of accuracy or suitability. You are fully responsible for your own trading decisions, execution, and risk.