cTrader custom indicator builder

Build a cTrader support and resistance indicator

A support and resistance indicator scans price history and draws horizontal levels where buying or selling pressure has previously clustered. You choose the detection method (pivot points, swing highs/lows, or price rejection zones), define the parameters, and Pineify writes the C# source file with compiler diagnostics.

Direct answer

Pineify can generate a single-file cTrader C# custom indicator that detects and draws support and resistance levels. It uses Bars.HighPrices and Bars.LowPrices for swing detection, mathematical formulas for pivot calculations, and ChartHorizontalLine or ChartRectangle for drawing levels on the chart. You define the detection method, lookback period, and display options through indicator parameters.

What to know first

  • One self-contained C# source file for a cTrader S/R indicator
  • Multiple detection methods: pivot points, swing highs/lows, price clusters
  • ChartHorizontalLine for levels, ChartRectangle for zones, ChartText for labels
  • Compiler diagnostics before you build and load the indicator in cTrader

Methods for detecting support and resistance

There is no single correct way to calculate support and resistance. The method you choose determines what the indicator finds and how it reacts to new price data. Each approach has trade-offs between responsiveness, stability, and the number of levels drawn.

Specify the method when requesting the indicator. A vague request like "find support and resistance" will produce a vague indicator. Name the calculation, the lookback parameters, and the conditions for drawing or removing a level.

  • Pivot points: calculated from prior period High, Low, and Close. Classic, Fibonacci, Camarilla, and Woodie formulas produce different level sets.
  • Swing highs and lows: local extremes identified by comparing a bar with N bars on each side. Larger N values find fewer, more significant swings.
  • Price rejection clusters: zones where multiple candle wicks have touched without closing through. Requires defining the cluster width and minimum touch count.
  • Dynamic levels: moving averages or volatility bands that shift with price. These are continuous curves rather than fixed horizontal lines.

Define the parameters that matter

A pivot point indicator needs the period (daily, weekly, monthly) and the formula variant. A swing indicator needs the lookback bars on each side and the minimum distance between levels. A cluster detector needs the price bin width and the minimum number of touches.

Also decide how the indicator handles old levels. Should it remove levels that price has broken through decisively? Should it change the color when a resistance level becomes support (polarity reversal)? These rules shape the final indicator behavior.

  • For pivots, name the period and formula (Classic, Fibonacci, Camarilla)
  • For swings, define the lookback/lookahead bar count and minimum level spacing
  • For clusters, set the price bin width and minimum touch count
  • For level management, state whether broken levels are removed, recolored, or kept

cTrader API features for S/R indicators

The cTrader Algo API provides the building blocks for S/R indicators. Bars.HighPrices, Bars.LowPrices, and Bars.ClosePrices give access to historical OHLC data for swing detection and pivot calculations. Chart.DrawHorizontalLine draws a level at a specific price across the chart.

For zone-based display, Chart.DrawRectangle creates a shaded band between two price levels. Chart.DrawText adds labels such as "S1", "R2", or "Daily Pivot" next to each line. Notifications.PlaySound and Notifications.SendEmail can trigger alerts when price approaches or crosses a defined level.

Support and resistance levels are observations, not predictions

A level marks where price has previously reacted. It does not guarantee a future reaction. Price can break through any support or resistance level at any time. The indicator draws what happened; you decide whether it matters for what comes next.

If you want to test whether a strategy based on these levels has any edge, implement the entry, exit, and sizing rules in a cBot and backtest it. The indicator draws visual references; the cBot tests the trading rules.

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, but it does not verify that the detection logic matches your intent or that the levels have predictive value.

Review the calculation method, lookback parameters, and level management rules before building in cTrader. Add the indicator to a chart and inspect the drawn levels against the price bars you care about. Adjust parameters until the output matches your visual expectations.

Practical checks I use

I name the detection method first

Before writing any code, I decide between pivots, swings, clusters, or another approach. Each method produces a different set of levels with different update behavior.

I define when levels are removed

An indicator that only adds levels without removing or fading old ones becomes cluttered over time. I specify the expiration or break-through rules.

I separate level detection from trading decisions

The indicator marks levels. Whether to trade those levels is a separate question that requires testing in a cBot, not in the indicator itself.

Primary sources

Pineify is an information tool, not investment advice. Support and resistance levels are historical observations, not forecasts. Review and test the indicator before relying on it for any trading decisions.

Frequently asked questions

Describe the S/R indicator you need

Name the detection method, parameters, and display rules. Pineify will generate one cTrader C# source file for you to review and build.

Build an S/R indicator