cTrader custom indicator builder

Build a cTrader session indicator from plain rules

A session indicator draws colored zones on a cTrader chart to show when major trading sessions are active. You define the session times, time zone, colors, and whether to extend high/low lines. Pineify writes the C# source file and checks compiler diagnostics so you can review and build it in cTrader.

Direct answer

Pineify can generate a single-file cTrader C# custom indicator that draws session boxes for the Asian, London, and New York sessions. It uses ChartRectangle for shaded zones, ChartHorizontalLine or ChartTrendLine for session high/low projections, and Server.TimeInUtc or TimeZoneInfo for time calculations. You control the session boundaries, colors, and display options through indicator parameters.

What to know first

  • One self-contained C# source file for a cTrader session indicator
  • Configurable session start/end times, time zones, and display colors
  • Optional session high/low horizontal lines extending into the next session
  • Compiler diagnostics that help you find C# and cTrader API errors before building

What a session indicator draws

A typical session indicator divides the 24-hour trading day into the three major global sessions: Asian (Tokyo/Sydney), London (European), and New York. It draws a semi-transparent rectangle from the session start time to the session end time, with the rectangle height spanning the session high to low price.

Some session indicators also draw horizontal lines extending from the session high and low into the following session. These lines can serve as reference levels for breakout or reversal strategies based on prior session ranges.

  • Colored rectangles showing each session time range and price range
  • Vertical lines or markers at session open and close times
  • Horizontal lines projecting prior session highs and lows
  • Text labels identifying each session on the chart

Define the sessions with precise times

Session boundaries depend on your trading convention. Common definitions use UTC or a specific financial center time zone. For example, you might define the London session as 08:00 to 16:30 London time, which shifts by one hour during daylight saving transitions.

When requesting a session indicator, specify the exact start and end times for each session, the reference time zone, and whether the indicator should account for DST changes. The cTrader Algo API provides Server.TimeInUtc for server time, and you can use .NET TimeZoneInfo for converting between zones.

  • Specify start and end times for each session you want drawn
  • Name the time zone (UTC, London, New York, Tokyo) for those boundaries
  • State whether DST shifts should adjust the drawn rectangles
  • Define whether sessions overlap (London-New York) or are drawn separately

cTrader API features used by session indicators

cTrader Algo provides chart drawing objects that session indicators commonly use. Chart.DrawRectangle creates a named rectangle between two time-price points, which works for session boxes. Chart.DrawHorizontalLine draws a price level across the chart for session high/low projections. Chart.DrawText adds labels to identify each session.

For time calculations, the indicator reads Bars.OpenTimes to identify which bars fall within a session. Server.TimeInUtc gives the current server time in UTC. Standard .NET TimeZoneInfo handles conversions and DST transitions when the session times are defined in a local time zone.

cTrader has some built-in session features

Before building a custom indicator, check whether cTrader built-in features cover your needs. The status bar shows currently active sessions. The Active Symbol Panel displays trading schedules and countdown timers. The MarketSessions API exposes Sydney, Tokyo, London, and New York objects with IsOpen, StartTime, and EndTime properties.

A custom indicator adds visual session boxes on the price chart, configurable display options, and extended session-range lines that the built-in features do not draw. If you need those visual elements, a custom indicator is the right tool.

Check the source, then build it in cTrader

Pineify checks the generated source for compiler and cTrader API diagnostics. A clean result means no reported compile errors under the supported reference. It does not verify that your session times match reality or that session-range levels will produce useful signals.

Review the time zone logic, session boundaries, and drawing code before copying the source into cTrader. Add the indicator to a chart and compare the drawn rectangles against known session times on the symbols you trade.

Practical checks I use

I name the time zone before the hours

Session times without a time zone reference are ambiguous. I specify "08:00-16:30 Europe/London" rather than just "08:00-16:30" to avoid DST confusion.

I check the rectangles against known session boundaries

After building the indicator, I compare the drawn session boxes against published exchange and session hours for a few historical dates.

I treat session levels as reference, not signals

Session highs and lows mark where price traded during a time window. They do not predict future breakouts or reversals on their own.

Primary sources

Pineify is an information tool, not investment advice. Session boundaries and range levels do not predict future price behavior. Review and test the indicator before relying on it for any trading decisions.

Frequently asked questions

Describe the session indicator you need

Define the sessions, time zones, colors, and display options. Pineify will generate one cTrader C# source file for you to review and build.

Build a session indicator