Category Trend  Published on 21/02/2021

.AN. ATR Channel Mod

Description

Same as Stochastic RSI - this is not my own invention, but modification of existing indicator.

 

Why I am interested in it :  

 

1) Main line - it is Better than Moving Average and so on trend indicators. Most average based indicators are failing when price is reaching some level and settles there - all average based indicators are then mixing with the price and loosing sense - because they are "forgetting" bears or bulls where dominating before. Meanwhile, this indicator can freeze while price is flirting inside ATR range - it's main line will stay straight horizontally - and will be shifted only if some real move that is bigger than ATR will occur. Pretty easy logic with heavy doze of sense.

 

2) Channel - Bollinger Bands is well known and possibly main among Volatility / Channels indicators. But I hate it same as Moving Averages - because Bollinger Bands middle line is just simple Moving Average... But it is nice to have a with high probability of price range - that is why here is also channel - but more adequate I think - because this channel is calculating not from nonsense point of moving average, but from more stable point - built by ATR.  

 

3) I like to have multi time frame view - that is why I modified this indicator to have ... lets say channel based on daily volatility - on some faster H1 or H4 chart. Or to add indicator several times at one chart, with different time frame parameters.    

 

Source code is not public. You can download the indicator only from my website

 

There is no other way to save copyrights.


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

namespace cAlgo
{
    [Indicator(IsOverlay = true, AutoRescale = false, AccessRights = AccessRights.FullAccess)]

    public class coderias : Indicator
    {

        [Parameter("AN Trading Tools", DefaultValue = "Coderias.com")]
        public string Parameter { get; set; }
        private ControlBase panel;

        protected override void Initialize()
        {
            Interface();
        }

        private ControlBase CreatePanel()
        {
            var panel = new StackPanel 
            {
                Orientation = Orientation.Horizontal,
                BackgroundColor = "#1c2124"
            };
            var panelBorder = new Border 
            {
                Opacity = 0.8,
                Margin = 5
            };
            panel.AddChild(MiddleBody());

            var Xbutton = new Button 
            {
                Text = "X",
                Style = Styles.Closebs(),
                ForegroundColor = "#aab8bf",
                VerticalAlignment = VerticalAlignment.Top,
                HorizontalAlignment = HorizontalAlignment.Left
            };
            Xbutton.Click += e => Chart.RemoveControl(panel);
            panel.AddChild(Xbutton);
            return panel;
        }

        private StackPanel MiddleBody()
        {
            var contentPanel = new StackPanel 
            {
                Orientation = Orientation.Vertical,
                BackgroundColor = "#26363e",
                Margin = "30 0 5 0"
            };
            var grid = new Grid(10, 10);

            var titleBox = new StackPanel 
            {
                BackgroundColor = "#2b3136",
                Margin = "5 0 5 15",
                Height = 20
            };
            var titleLable = new TextBlock 
            {
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Text = "CODERIAS.COM",
                ForegroundColor = "#aab8bf",
                Margin = "35 5 35 5"
            };
            titleBox.AddChild(titleLable);
            grid.AddChild(titleBox, 0, 0);

            var text = new TextBlock 
            {
                VerticalAlignment = VerticalAlignment.Bottom,
                HorizontalAlignment = HorizontalAlignment.Center,
                Text = "This algo available from my site only",
                ForegroundColor = "#aab8bf",
                Margin = "15 5 15 5"
            };
            grid.AddChild(text, 2, 0);

            var text1 = new TextBlock 
            {
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Text = "you will see list at the right side panel",
                ForegroundColor = "#aab8bf",
                Margin = "15 5 15 5"
            };
            grid.AddChild(text1, 3, 0);

            var page1 = new Button 
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                ForegroundColor = "#aab8bf",
                Style = Styles.GetButtonStyle(),
                Text = "Visit site homepage with Download List",
                Margin = "15 4 4 4",
                Width = 220
            };
            page1.Click += e => System.Diagnostics.Process.Start("https://www.coderias.com");
            grid.AddChild(page1, 5, 0);

            var text2 = new TextBlock 
            {
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Text = "or use direct links at favorite tools :",
                ForegroundColor = "#aab8bf",
                Margin = "15 55 15 5"
            };
            grid.AddChild(text2, 1, 4);

            var page22 = new Button 
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                ForegroundColor = "#aab8bf",
                Style = Styles.GetButtonStyle(),
                Text = "Economic Calendar Reminder",
                Margin = "4 4 4 4",
                Width = 220
            };
            page22.Click += e => System.Diagnostics.Process.Start("https://www.coderias.com/p/economic-calendar-alerts.html");
            grid.AddChild(page22, 3, 4);

            var page2 = new Button 
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                ForegroundColor = "#aab8bf",
                Style = Styles.GetButtonStyle(),
                Text = "cTrader Telegram Communic",
                Margin = "4 4 4 4",
                Width = 220
            };
            page2.Click += e => System.Diagnostics.Process.Start("https://www.coderias.com/p/ctrader-telegram-push.html");
            grid.AddChild(page2, 4, 4);

            var page3 = new Button 
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                ForegroundColor = "#aab8bf",
                Style = Styles.GetButtonStyle(),
                Text = "Direction Correction Target Indicator",
                Margin = "4 4 4 4",
                Width = 220
            };
            page3.Click += e => System.Diagnostics.Process.Start("https://www.coderias.com/p/direction-correction-target.html");
            grid.AddChild(page3, 5, 4);

            var page4 = new Button 
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                ForegroundColor = "#aab8bf",
                Style = Styles.GetButtonStyle(),
                Text = "StochRSI Waves Resonance",
                Margin = "4 4 4 24",
                Width = 220
            };
            page4.Click += e => System.Diagnostics.Process.Start("https://www.coderias.com/p/stoch-rsi-waves-resonance.html");
            grid.AddChild(page4, 6, 4);

            var contact = new TextBlock 
            {
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Text = "by Alex Neil ",
                ForegroundColor = "#aab8bf",
                Margin = "15 25 15 5"
            };
            grid.AddChild(contact, 8, 0);

            var tme = new Button 
            {
                HorizontalAlignment = HorizontalAlignment.Right,
                ForegroundColor = "#aab8bf",
                Style = Styles.GetButtonStyle(),
                Text = "Telegram Contact : t.me/coderias",
                Margin = "15 25 15 5",
                Width = 220
            };
            tme.Click += e => System.Diagnostics.Process.Start("https://t.me/coderias");
            grid.AddChild(tme, 8, 4);

                        /*var image = new Image 
            {
                Source = Resource1.intro,
                Stretch = Stretch.UniformToFill,
                Width = 380,
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Right,
                Margin = "0 0 15 0"
            };
            grid.AddChild(image, 1, 4, 7, 2);
*/

contentPanel.AddChild(grid);
            return contentPanel;
        }
        private void Interface()
        {
            panel = new Border 
            {
                VerticalAlignment = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Margin = "20 30 20 20",
                Child = CreatePanel()
            };
            Chart.AddControl(panel);
        }

        public static class Styles
        {
            public static Style GetButtonStyle()
            {
                return CreateButtonStyle(Color.FromHex("#232e3a"), Color.FromHex("#25394d"));
            }
            public static Style Closebs()
            {
                return CreateButtonStyle(Color.FromHex("#26363e"), Color.FromHex("#232e3a"));
            }
            private static Style CreateButtonStyle(Color color, Color hoverColor)
            {
                var style = new Style(DefaultStyles.ButtonStyle);
                style.Set(ControlProperty.BackgroundColor, color, ControlState.DarkTheme);
                style.Set(ControlProperty.BackgroundColor, color, ControlState.LightTheme);
                style.Set(ControlProperty.BackgroundColor, hoverColor, ControlState.DarkTheme | ControlState.Hover);
                style.Set(ControlProperty.BackgroundColor, hoverColor, ControlState.LightTheme | ControlState.Hover);
                style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.DarkTheme);
                style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.LightTheme);
                return style;
            }
        }

        public override void Calculate(int index)
        {
            //--
        }

    }
}


CoderiasCom's avatar
CoderiasCom

Joined on 04.10.2016

  • Distribution: Paid
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: .AN.. Coderias.algo
  • Rating: 0
  • Installs: 987
Comments
Log in to add a comment.
No comments found.