Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Keltner Channel Indicator support

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Keltner Channel Indicator support

    Hello,

    I can't seem to get the Keltner indicator working. What exactly should I be tweaking to get this to work?

    Also, how can i generate a strategy that alerts me when the kagi line changes direction?

    Thanks!
    Attached Files

    #2
    Hello Ph0enixa27,

    Thank you for your note.

    There is no exposed value that you could call to find out if the color changed. So you would develop code that detects what the Kagi Chart Style detects.

    Below is an example of printing whether the Line is Green or Red (based on just the default values):

    Code:
    public class KagiLineColor : Indicator
        {
            private string KagiColor;
            private double PriorPrice;
    
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Indicator here.";
                    Name                                        = "KagiLineColor";
                    Calculate                                    = Calculate.OnPriceChange;
                    IsOverlay                                    = false;
                    DisplayInDataBox                            = true;
                    DrawOnPricePanel                            = true;
                    DrawHorizontalGridLines                        = true;
                    DrawVerticalGridLines                        = true;
                    PaintPriceMarkers                            = true;
                    ScaleJustification                            = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
                    //See Help Guide for additional information.
                    IsSuspendedWhileInactive                    = true;
                    KagiColor = "";
                    PriorPrice = 0;
                }
                else if (State == State.Configure)
                {
                }
            }
    
            protected override void OnBarUpdate()
            {
                if (CurrentBar < 1) return;
    
                if (IsFirstTickOfBar)
                {
                    Print("");
                    Print(Time[0]);
                }
    
                if (Close[0] == PriorPrice) return;
                PriorPrice = Close[0];
    
                if (Close[0] > Open[0])
                {
                    if (Close[0] > Math.Max(Close[1], Open[1]))
                    {
                        KagiColor = "Green";
                    }
                }
                else if (Close[0] < Math.Min(Open[1], Close[1]))
                {
                    KagiColor = "Red";
                }
                Print(KagiColor);
            }
        }
    You could figure the code by opening the ChartStyle for the KagiLine and following it's logic for changing the lines of the chart.

    In NinjaTrader 8 you can go to the NinjaTrader Control Center > New > NinjaScript > Editor > ChartStyles > KagiStyle.

    As far as the Keltner Channel goes, I'm not running into any issues applying it to a Kagi line chart - what version of NinjaTrader are you running? You can find this under Help > About. If it's anything other than 8.0.20.1, you'll want to update before we troubleshoot further.

    To update NinjaTrader, please follow the steps below:
    • First, copy your license key from NinjaTrader under Help> License Key then exit NinjaTrader
    • Click on the link: http://ninjatrader.com/PlatformDirect
    • Enter your license key and press Submit
    • Select 'NinjaTrader 8'
    • Select 'Download'
    • Critical: Before running the installer, ensure NinjaTrader is closed.
    Once you've ensured you're up to date, open the platform and create a new workspace, then test adding the Keltner Channel to a chart.

    If you're already on the current version, please let me know.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi Kate,

      I'm using the current version.

      I opened a new worksheet and tried using it again.

      The indicator doesn't load all the way back.
      Attached Files

      Comment


        #4
        Hello Ph0enixa27,

        Thank you for your reply.

        I can't tell from your chart how much data you have loaded for the weekly chart. However, the Keltner Channel will only plot if at least 20 bars are on the chart. Try increasing your Days to Load in the Data Series for the Weekly series - that will allow you to plot the Keltner Channel over a longer period of time.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Yes, i changed the setting to bars, and it works now. thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by alifarahani, Today, 09:40 AM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by RookieTrader, Today, 09:37 AM
          4 responses
          18 views
          0 likes
          Last Post RookieTrader  
          Started by PaulMohn, Today, 12:36 PM
          0 responses
          5 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          40 views
          0 likes
          Last Post love2code2trade  
          Started by junkone, Today, 11:37 AM
          3 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X