Category Trend  Published on 10/10/2014

Price Action / BreakOut

Description

This is a Price Action Indicator, that helps you to identify the difference between trend / sideway market. Unlike Highest High Lowest Low indicator, here you don't need to set period. It adapts to the market, based on the logic of inside bars.

 

Buy, when price is above EMA and breaks up from the consolidation channel.

Sell, when price is below EMA and breaks down from the consolidation channel.


using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true)]
    public class Break_Out_Channel : Indicator
    {
//-----------------------------------------------------------------     
    [Output("Up", Color = Colors.DarkCyan, PlotType = PlotType.Line, LineStyle = LineStyle.LinesDots, Thickness = 1)]
    public IndicatorDataSeries Up { get; set; }
    
    [Output("Down", Color = Colors.DarkCyan, PlotType = PlotType.Line, LineStyle = LineStyle.LinesDots, Thickness = 1)]
    public IndicatorDataSeries Down { get; set; } 

    [Output("Mid", Color = Colors.DarkViolet, PlotType = PlotType.Line, LineStyle = LineStyle.LinesDots, Thickness = 1)]
    public IndicatorDataSeries Mid { get; set; }
//----------------------------------------------------------------- 
    public override void Calculate(int index)
    {
	
	if(index < 5)
	return;

    if(MarketSeries.Close[index] < Up[index-1] & MarketSeries.Close[index] > Down[index-1])
    {
    Up[index] = Up[index-1];
    Down[index] = Down[index-1];    
    }
    else
    {
    Up[index] = MarketSeries.High[index];
    Down[index] = MarketSeries.Low[index];    
    }

	Mid[index] = (Up[index] + Down[index])/2;	
   }
}   
}


RK
rkokerti

Joined on 28.06.2012

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Break_Out_Channel.algo
  • Rating: 5
  • Installs: 42577
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
shane.scott.pub's avatar
shane.scott.pub · 3 days ago

How to install.

If its a .cs file. Go to Indicators under the algos tab. Click new and give it a name in the left pane. Copy and paste the code that's here or in the .cs file into the window on the right for the indicator code. Its the same code. Then click build. Done. it will appear under custom when adding indicators or searching the name you gave when adding the indicator.

albatros667's avatar
albatros667 · 1 week ago

Update code

using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true)]
    public class Break_Out_Channel : Indicator
    {
        [Output("Up", LineColor = "DarkCyan", PlotType = PlotType.Line, LineStyle = LineStyle.LinesDots, Thickness = 1)]
        public IndicatorDataSeries Up { get; set; }

        [Output("Down", LineColor = "DarkCyan", PlotType = PlotType.Line, LineStyle = LineStyle.LinesDots, Thickness = 1)]
        public IndicatorDataSeries Down { get; set; }

        [Output("Mid", LineColor = "DarkViolet", PlotType = PlotType.Line, LineStyle = LineStyle.LinesDots, Thickness = 1)]
        public IndicatorDataSeries Mid { get; set; }

        public override void Calculate(int index)
        {
            if (index < 5) return;

            if (Bars.ClosePrices[index] < Up[index - 1] && Bars.ClosePrices[index] > Down[index - 1])
            {
                Up[index] = Up[index - 1];
                Down[index] = Down[index - 1];
            }
            else
            {
                Up[index] = Bars.HighPrices[index];
                Down[index] = Bars.LowPrices[index];
            }

            Mid[index] = (Up[index] + Down[index]) / 2;
        }
    }
}
DA
DaniloBezerra · 5 years ago

Does not install on C-trader, likely file with problems, can solve?

DE
deansi · 10 years ago

It works ok for me

RK
rkokerti · 10 years ago

Hi,

I don't know why source code disappeared, but I uploaded again.

RA
raphaelcarlot · 10 years ago

Hi.

Can't download your indicator. I receive 404 error.  Did You removed it.

Can You help me to get Your indicator Price Action / Break Out

 

MA
MasterBo · 10 years ago

Hi.

Can't download your indicator. I receive 404 error.  Did You removed it.

Can You help me to get Your indicator Price Action / Break Out

AL
allo · 10 years ago

Hi, I don't know how to install it. It says it's a .cs file and can't open it when I try to install it once downloaded.

thanks, Sylvie