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.
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”.
- Session structure review
- Breakout and range study
- Teaching and communication
- Post-session debriefs
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 bookingHow 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
);
}
}
}
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.
