*** FractalBreak Indicator (bot avail.) free

by NiLo in category Trend at 25/08/2020
Description

This indicator provides an overview of both the last bear and bull fractal. The indicator shows whether the fractal in question is broken and is subsequently followed by a retest. Retesting the price level of a bear fractal after a break is a signal to go short. Conversely, a retest in the price level of a bull fractal after a break is a signal to go long.

Always use appropriate risk management!!
Use at your own risk!!
 

Would you be so kind to give a thumbs up if you download this indicator?
That will keep me motivated to create more of these awesome indicators.
Thank you!

 

Version history
Aug 25, 2020 Version 2.1 (minor updates)
July 7, 2020 Version 2.0 (bugfix)
July 3, 2020 Version 1.0 (Initial version)

 

Check this instruction video where I'll show you how to apply the FractalBreak strategy and I'll show you how to activate this indicator in your own cTrader environment.

 

FractalBreak Indicator

 

NOW AVAILABLE (Fully automated tradingbot on cTrader platform for FractalBreak strategy)

Soon I will release a bot that you can easily activate in your own cTrader software so that the bot takes all the work out of your hands to trade with this profitable FractalBreak strategy. The bot will automatically set the correct stoploss, takeprofit and applies additional risk management. I will explain how you can set up your own cTrader software in a few minutes to have this bot activated and optimized per market, timeframe and period via this strategy. This bot works in all markets, as long as the market is open.

Here's a sneak preview of some highly profitable markets:
cTrader backtest, EURAUD, from 1 July 2019 to 1 July 2020, starting balance € 10,000, ending balance € 20,138
cTrader backtest, EURNZD, from 1 July 2019 to 1 July 2020, starting balance € 10,000, ending balance € 26,729
cTrader backtest, GBPUSD, from 1 July 2019 to 1 July 2020, starting balance € 10,000, ending balance € 31,262
cTrader backtest, XAUUSD, from 1 July 2019 to 1 July 2020, starting balance € 10,000, ending balance € 35,915

Leave a comment below, and I'll notify you when this bot has been released on the cTrader platform.

Happy trading!!

 

My other cTrader products:
EMA 3 Crossing autotrading Bot (https://ctrader.com/algos/cbots/show/2309)
EMA 3 Crossing indicator (https://ctrader.com/algos/indicators/show/2286)
FractalBreak autotrading Bot (https://ctrader.com/algos/cbots/show/2282)
FractalBreak indicator (https://ctrader.com/algos/indicators/show/2274)

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
´╗┐using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class FractalBreakIndicator : Indicator
    {
        [Output("BullFractals", LineColor = "Turquoise", PlotType = PlotType.DiscontinuousLine, Thickness = 1)]
        public IndicatorDataSeries BullFractalBreak { get; set; }

        [Output("BearFractals", LineColor = "Orange", PlotType = PlotType.DiscontinuousLine, Thickness = 1)]
        public IndicatorDataSeries BearFractalBreak { get; set; }

        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            ProcessBearFractalBreak();
            ProcessBullFractalBreak();
        }

        private void ProcessBearFractalBreak()
        {
            bool shortPosition = false;
            int confirmationIndex = -1;

            // Find last bear and bull fractal
            int index = this.Bars.Count - 2;
            int? bearFractalIndex = FindLastBearFractal(index);
            int? bullFractalIndex = FindLastBullFractal(index);
            if (bearFractalIndex != null)
            {
                // DRAW BEAR FRACTAL LINE
                for (int i = 0; i < Bars.Count; i++)
                {
                    if (i < bearFractalIndex.Value)
                        BearFractalBreak[i] = double.NaN;
                    else
                        BearFractalBreak[i] = Bars[bearFractalIndex.Value].Low;
                }
                var txt1 = Chart.DrawText("BearFase1", "FRACTAL (WAITING FOR BREAK)", bearFractalIndex.Value, Bars[bearFractalIndex.Value].Low, Color.Orange);
                var txt2 = Chart.DrawText("BearFase2", "", bearFractalIndex.Value, Bars[bearFractalIndex.Value].Low, Color.Orange);
                var txt3 = Chart.DrawText("BearFase3", "", bearFractalIndex.Value, Bars[bearFractalIndex.Value].Low, Color.Orange);
                var txt4 = Chart.DrawText("BearFase3_desc", "", bearFractalIndex.Value, Bars[bearFractalIndex.Value].Low, Color.Orange);

                // Find fractal break (bear)
                int? fractalBreak = FindBearFractalBreak(bearFractalIndex.Value);
                if (fractalBreak != null)
                {
                    BearFractalBreak[fractalBreak.Value] = Bars[fractalBreak.Value].Close;
                    txt2 = Chart.DrawText("BearFase2", "BREAK", fractalBreak.Value, Bars[fractalBreak.Value].Low, Color.Orange);
                    txt1 = Chart.DrawText("BearFase1", "FRACTAL", bearFractalIndex.Value, Bars[bearFractalIndex.Value].Low, Color.Orange);

                    if (bullFractalIndex != null)
                    {
                        int i = fractalBreak.Value + 1;
                        for (; i < this.Bars.Count; i++)
                        {
                            if (this.Bars[i].High >= this.Bars[bearFractalIndex.Value].Low && this.Bars[i].Close < this.Bars[bearFractalIndex.Value].Low && this.Bars[i].Close < this.Bars[bullFractalIndex.Value].Close && fractalBreak.Value < i && i < Bars.Count - 1)
                            {
                                // CONFIRMED -> SHORT
                                BearFractalBreak[i] = Bars[bearFractalIndex.Value].Low;
                                txt3 = Chart.DrawText("BearFase3", "SHORT", i, Bars[i].Low, Color.Orange);
                                txt4 = Chart.DrawText("BearFase3_desc", "CONFIRMED", fractalBreak.Value + 1, Bars[bearFractalIndex.Value].Low, Color.Orange);
                                shortPosition = true;
                                confirmationIndex = i;
                                break;
                            }
                            else
                            {
                                // DRAW BEAR FRACTAL RETEST LINE
                                if (!shortPosition)
                                    BearFractalBreak[i] = Bars[bearFractalIndex.Value].Low;
                                else
                                    BearFractalBreak[i] = double.NaN;
                            }
                        }

                        if (!shortPosition)
                            txt4 = Chart.DrawText("BearFase3_desc", "WAITING FOR CONFIRMATION", fractalBreak.Value + 1, Bars[bearFractalIndex.Value].Low, Color.Orange);

                        for (i += 1; i < this.Bars.Count; i++)
                            BearFractalBreak[i] = double.NaN;
                    }
                }
            }
        }

        private void ProcessBullFractalBreak()
        {
            bool longPosition = false;
            int confirmationIndex = -1;

            // Find last bear and bull fractal
            int index = this.Bars.Count - 2;
            int? bearFractalIndex = FindLastBearFractal(index);
            int? bullFractalIndex = FindLastBullFractal(index);
            if (bullFractalIndex != null)
            {
                // DRAW BULL FRACTAL LINE
                for (int i = 0; i < Bars.Count; i++)
                {
                    if (i < bullFractalIndex.Value)
                        BullFractalBreak[i] = double.NaN;
                    else
                        BullFractalBreak[i] = Bars[bullFractalIndex.Value].High;
                }
                var txt1 = Chart.DrawText("BullFase1", "FRACTAL (WAITING FOR BREAK)", bullFractalIndex.Value, Bars[bullFractalIndex.Value].High, Color.Turquoise);
                var txt2 = Chart.DrawText("BullFase2", "", bullFractalIndex.Value, Bars[bullFractalIndex.Value].High, Color.Turquoise);
                var txt3 = Chart.DrawText("BullFase3", "", bullFractalIndex.Value, Bars[bullFractalIndex.Value].High, Color.Turquoise);
                var txt4 = Chart.DrawText("BullFase3_desc", "", bullFractalIndex.Value, Bars[bullFractalIndex.Value].High, Color.Turquoise);

                // Find fractal break (bull)
                int? fractalBreak = FindBullFractalBreak(bullFractalIndex.Value);
                if (fractalBreak != null)
                {
                    BullFractalBreak[fractalBreak.Value] = Bars[fractalBreak.Value].Close;
                    txt2 = Chart.DrawText("BullFase2", "BREAK", fractalBreak.Value, Bars[fractalBreak.Value].High, Color.Turquoise);
                    txt1 = Chart.DrawText("BullFase1", "FRACTAL", bullFractalIndex.Value, Bars[bullFractalIndex.Value].High, Color.Turquoise);

                    if (bearFractalIndex != null)
                    {
                        int i = fractalBreak.Value + 1;
                        for (; i < this.Bars.Count; i++)
                        {
                            if (this.Bars[i].Low <= this.Bars[bullFractalIndex.Value].High && this.Bars[i].Close > this.Bars[bullFractalIndex.Value].High && this.Bars[i].Close > this.Bars[bearFractalIndex.Value].Close && fractalBreak.Value < i)
                            {
                                // CONFIRMED -> LONG
                                BullFractalBreak[i] = Bars[bullFractalIndex.Value].High;
                                txt3 = Chart.DrawText("BullFase3", "LONG", i, Bars[i].High, Color.Turquoise);
                                txt4 = Chart.DrawText("BullFase3_desc", "CONFIRMED", fractalBreak.Value + 1, Bars[bullFractalIndex.Value].High, Color.Turquoise);
                                longPosition = true;
                                confirmationIndex = i;
                                break;
                            }
                            else
                            {
                                // DRAW BULL FRACTAL RETEST LINE
                                if (!longPosition)
                                    BullFractalBreak[i] = Bars[bullFractalIndex.Value].High;
                                else
                                    BullFractalBreak[i] = double.NaN;
                            }
                        }

                        if (!longPosition)
                            txt4 = Chart.DrawText("BullFase3_desc", "WAITING FOR CONFIRMATION", fractalBreak.Value + 1, Bars[bullFractalIndex.Value].High, Color.Turquoise);

                        for (i += 1; i < this.Bars.Count; i++)
                            BullFractalBreak[i] = double.NaN;
                    }
                }
            }
        }

        private int? FindBearFractalBreak(int bearFractalIndex)
        {
            for (int i = bearFractalIndex + 1; i < this.Bars.Count; i++)
            {
                if (this.Bars[i].Close < this.Bars[bearFractalIndex].Low)
                    return i;
            }

            return null;
        }

        private int? FindBullFractalBreak(int bullFractalIndex)
        {
            for (int i = bullFractalIndex + 1; i < this.Bars.Count; i++)
            {
                if (this.Bars[i].Close > this.Bars[bullFractalIndex].High)
                    return i;
            }

            return null;
        }

        private int? FindLastBearFractal(int startIndex)
        {
            for (int i = startIndex; i >= 4; i--)
            {
                if (this.Bars[i].Low > this.Bars[i - 2].Low && this.Bars[i - 1].Low > this.Bars[i - 2].Low && this.Bars[i - 3].Low > this.Bars[i - 2].Low && this.Bars[i - 4].Low > this.Bars[i - 2].Low)

                    return i - 2;
            }

            return null;
        }

        private int? FindLastBullFractal(int startIndex)
        {
            for (int i = startIndex; i >= 4; i--)
            {
                if (this.Bars[i].High < this.Bars[i - 2].High && this.Bars[i - 1].High < this.Bars[i - 2].High && this.Bars[i - 3].High < this.Bars[i - 2].High && this.Bars[i - 4].High < this.Bars[i - 2].High)

                    return i - 2;
            }

            return null;
        }
    }
}
Comments
0