Skip to content

IIndicatorsAccessor.Fractals

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

The fractal indicator is a trading indicator used in technical analysis that is used to identify potential trend reversal points in a market.

Overloads

Fractals(int periods)

The fractal indicator is a trading indicator used in technical analysis that is used to identify potential trend reversal points in a market.

Fractals Fractals(int periods)
api.Indicators.Fractals(periods: int) -> Fractals

Parameters

Name C# type Python type Description
periods int int Fractals Period

Returns Fractals — Fractals

Examples

var fractals = Indicators.Fractals(5);
// A fractal value is NaN on bars without a fractal
if (!double.IsNaN(fractals.UpFractal.Last(3)))
    Print("Up fractal at {0}", fractals.UpFractal.Last(3));
import math
fractals = api.Indicators.Fractals(5)
# A fractal value is NaN on bars without a fractal
if not math.isnan(fractals.UpFractal.Last(3)):
    api.Print(f"Up fractal at {fractals.UpFractal.Last(3)}")

Fractals(Bars bars, int periods)

The fractal indicator is a trading indicator used in technical analysis that is used to identify potential trend reversal points in a market.

Fractals Fractals(Bars bars, int periods)
api.Indicators.Fractals(bars: Bars, periods: int) -> Fractals

Parameters

Name C# type Python type Description
bars Bars Bars The Bars that will be used by indicator, you can pass another timeframe/symbol bars
periods int int Fractals Period

Returns Fractals — Fractals

Examples

var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyFractals = Indicators.Fractals(dailyBars, 5);
Print("Daily down fractal three bars ago: {0}", dailyFractals.DownFractal.Last(3));
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyFractals = api.Indicators.Fractals(dailyBars, 5)
api.Print(f"Daily down fractal three bars ago: {dailyFractals.DownFractal.Last(3)}")