Search
GBP
Trading Tools
    Menu Close

    Triangle Count Oscillator for cTrader

    Triangle Count Oscillator for cTrader


    Support via Forum & AI Assistant

    The Triangle Count Oscillator is a custom-built technical tool for cTrader that identifies repeating triangular patterns formed from swing highs and lows. It automatically draws triangles on the chart when spacing and swing criteria are met, while simultaneously plotting an oscillator line that tracks the count of active patterns. This provides traders with an extra layer of visual and statistical insight into recurring market structures and momentum. The Triangle Count Oscillator is a pattern recognition indicator that blends geometric chart analysis with an oscillator for quantitative confirmation.
    (OS) Type: Windows & Mac OS Compatible
    Current version: 1.0.0
    Updated: Friday, 29 August 2025

    cTrader Indicator

    Need a cTrader broker?  Open a demo account

    Educational use only: Read our disclaimer

    £0.00 Excl. VAT.

    Free for personal use under our license agreement. Redistribution & resale are strictly prohibited.

    cTrader Software





    Indicator Overview

    This indicator scans price swings and connects them into triangular structures whenever the spacing rules and swing conditions are satisfied. Each valid triangle is drawn on the chart, and the oscillator line plots the running count of identified patterns. The goal is to highlight periods when triangular consolidations or reversals are frequent, offering traders potential areas of market compression and breakout opportunities.

     

    Background & History

    Geometric patterns have long been a part of technical analysis. Triangles, in particular, are widely studied as consolidation zones where supply and demand tighten before a breakout. The Triangle Count Oscillator is a modern algorithmic approach that systematically detects and quantifies these formations, making a subjective chart pattern objective and measurable.

     

    cTrader Triangle Count Oscillator Indicator

     

    How the Indicator Works

    The indicator identifies swing highs and swing lows over a given lookback window. Once three successive swing points are validated with sufficient spacing, a triangle is drawn. Each detected triangle increments the oscillator count, producing a line that reflects the number of triangular formations registered within the lookback period.

    • Swing points are confirmed when a bar’s high or low is higher or lower than the surrounding bars.

    • Only swings separated by the minimum spacing are considered valid.

    • Once three valid swings align, the algorithm closes a triangle and updates the oscillator.

     

    Key Features

    The Triangle Count Oscillator offers a dual view, presenting both a visual pattern on the chart and quantitative tracking through the oscillator line. This allows traders to spot structures as they form and monitor overall pattern frequency.

    • Automatic detection of swing-based triangular formations.

    • Configurable spacing and lookback controls.

    • Real-time triangle drawing with customizable colour.

    • Oscillator output showing active triangle counts.

     

    How to Use it for Trading (at a glance)

    The Triangle Count Oscillator helps traders spot when the market is compressing into triangular structures. These zones often act as energy builds before the price breaks out strongly in one direction.

    • When the oscillator value is rising, it means more triangles are being detected, which usually signals sideways consolidation.

    • Consolidation phases often lead to strong breakout moves, so a rising oscillator can be seen as a “warning” to prepare for volatility.

    • Once triangles stop forming and the oscillator levels off, traders can watch for breakout confirmation from price action, volume, or momentum indicators.

    • Triangles drawn directly on the chart can also be used to set support and resistance levels for breakout trading.

    Please keep it simple by using the oscillator as a market context tool: when triangle activity is high, avoid chasing random trades and instead prepare for the next clear breakout move.

     

    Inputs & Parameters

    The indicator offers flexible parameters that enable you to fine-tune the detection of swing points and triangles. These settings control spacing, lookback, and visualisation preferences.

    Parameter Default / Type Description
    Inputs
    Swing Lookback 3 (int) Number of bars used to confirm swing highs and lows.
    Lookback Bars 100 (int) Total number of bars to include in swing point memory.
    Draw Triangles true (bool) Option to show or hide triangle drawings on the chart.
    Triangle Color LightGray (string) Color of the drawn triangles.
    Min Bars Between Swings 5 (int) Minimum spacing required between detected swing points.
    Min Bars Between Triangles 10 (int) Bars that must pass before a new triangle can be drawn.
    Triangle Draw Lag 5 (int) Delay applied to triangle drawing to avoid premature signals.

     

    Formula

    The Triangle Count Oscillator identifies swing points in price data, connects them into triangles when spacing rules are satisfied, and then counts these formations. The oscillator output is the running total of valid triangles within the lookback window.

    Pipeline: Price series → Detect swing highs & lows → Validate spacing → Form triangle (3 points) → Increment triangle counter → Oscillator line.

    Swing Point Condition. A bar at index t is a swing high if Ht > Ht±i for i = 1…L. A swing low if Lt < Lt±i for i = 1…L.
    Spacing Rule. Only accept a swing point if it is at least S bars away from the previous swing.
    Triangle Formation. Given three sequential swing points A, B, C that meet spacing rules, connect them to form a triangle.
    Oscillator Count. TriangleCount[t] = max( SwingPoints.Count − 2 , 0 ).
    Symbol Meaning
    Ht, Lt High and Low price at bar t.
    L Swing lookback window for detecting highs/lows.
    S Minimum bar spacing required between swings.
    A, B, C Indices of three successive swing points forming a triangle.
    SwingPoints.Count Total number of swing points detected in the lookback window.
    TriangleCount[t] Oscillator value at time t, equal to number of triangles detected.

     

    Advantages

    The Triangle Count Oscillator removes the subjectivity from chart pattern recognition. It highlights when triangular consolidations are forming without requiring manual trendline drawing, saving time and providing consistency in pattern detection. The oscillator line gives a quantifiable measure of structural activity, making it easy to compare across instruments or timeframes.

     

    Disadvantages

    Because the indicator relies on strict swing point rules, it may miss patterns that a human eye would still interpret as valid. Triangles can also appear more frequently in choppy conditions, leading to false positives that do not resolve into meaningful breakouts. As with all pattern-based indicators, it should be used in combination with other methods rather than in isolation.

     

    How To Install & Remove

    First, ensure that you have the cTrader trading platform installed. Then, unzip the file and double-click it to install the platform automatically.

     

    Need Extra Help?

    Get instant answers with cTrader Sensei — our free AI assistant built for the cTrader platform. It can explain the indicator settings, suggest trading strategies, and guide you step-by-step through the use of this indicator. Rated 4.9 out of 5 in the ChatGPT Store.

    Chat with cTrader Sensei

    Prefer human help? Visit our support forum where our team and community can assist you.

    Note: cTrader Sensei runs on OpenAI's ChatGPT platform. To use it, you will be asked to create a free OpenAI account. Registration is quick and costs nothing.

    The free version works immediately, but upgrading to a ChatGPT Plus subscription unlocks the latest GPT model, which provides more accurate and detailed answers for trading, coding, and product support.

     

     

    Need a Broker

    If you're still looking for a broker with tight spreads and fast execution, visit our top cTrader broker site.