Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NO longer see AddOns namespace in NT8?

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

    NO longer see AddOns namespace in NT8?

    after updating to lastest 8 14th update,

    `using NinjaTrader.NinjaScript.AddOns;`

    throws error: https://i.imgur.com/O3Vhgyc.png

    #2
    Hello TazoTodua,

    Thanks for your post.

    I don't see this issue when I test on my end. I may suggest running a repair install from the latest installer, and if that doesn't help, to test again in a clean environment.

    I'll include instructions for a clean environment test below.

    Clean environment test

    Creating a clean environment can be done by following the steps below:
    1. Close NinjaTrader 8, and rename the "NinjaTrader 8" folder in My Documents to something like: "NinjaTrader 8 OLD"
    2. Uninstall NinjaTrader from the Windows Control Panel and reinstall using the installer from http://ninjatrader.com/PlatformDirect
    3. Create a new NinjaScript with that using statement and test for the same issue.


    If you ever need to switch back to your original platform, you may do so by closing NinjaTrader and swapping the platform folder names.

    For example, Close NinjaTrader and rename the new "NinjaTrader 8" folder to "NinjaTrader 8 NEW" and the "NinjaTrader 8 OLD" folder to "NinjaTrader 8." Then restart the platform. Simply put: NinjaTrader 8 will always load the "NinjaTrader 8" folder in My Documents.

    If these steps do not help resolve your inquiry, please send me a message at platformsupport[at]ninjatrader[dot]com with the text "Attention Jim" and the thread URL. I would then like to arrange a time to get connected so we can take a closer look.

    I'm happy to be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello,

      I just installed NT8 and I am also getting the same error while compiling a script code shared by somenone.

      Thanks,

      -Vijay

      Comment


        #4
        mumbai59 It does not appear to be broken to me. Here's an example that compiles perfectly on 8.1.3.0. Note also that the original post was in 2018 so it's unclear if you're referring here to the latest version, which is 8.1.3.0.

        Code:
        #region Using declarations
        using System;
        using System.Collections.Generic;
        using System.ComponentModel;
        using System.ComponentModel.DataAnnotations;
        using System.Linq;
        using System.Text;
        using System.Threading.Tasks;
        using System.Windows;
        using System.Windows.Input;
        using System.Windows.Media;
        using System.Xml.Serialization;
        using NinjaTrader.Cbi;
        using NinjaTrader.Gui;
        using NinjaTrader.Gui.Chart;
        using NinjaTrader.Gui.SuperDom;
        using NinjaTrader.Gui.Tools;
        using NinjaTrader.Data;
        using NinjaTrader.NinjaScript;
        using NinjaTrader.Core.FloatingPoint;
        using NinjaTrader.Gui.Tools;
        #endregion
        
        //This namespace holds Add ons in this folder and is required. Do not change it.
        namespace NinjaTrader.NinjaScript.AddOns
        {
            public class TestAddOn : NinjaTrader.NinjaScript.AddOnBase
            {
                public static int Number = 1;
                
                protected override void OnStateChange()
                {
                    if (State == State.SetDefaults)
                    {
                        Description                                    = @"Enter the description for your new custom Add on here.";
                        Name                                        = "TestAddOn";
                    }
                    else if (State == State.Configure)
                    {
                    }
                }
            }
        }
        ​
        Code:
        #region Using declarations
        using System;
        using System.Collections.Generic;
        using System.ComponentModel;
        using System.ComponentModel.DataAnnotations;
        using System.Linq;
        using System.Text;
        using System.Threading.Tasks;
        using System.Windows;
        using System.Windows.Input;
        using System.Windows.Media;
        using System.Xml.Serialization;
        using NinjaTrader.Cbi;
        using NinjaTrader.Gui;
        using NinjaTrader.Gui.Chart;
        using NinjaTrader.Gui.SuperDom;
        using NinjaTrader.Gui.Tools;
        using NinjaTrader.Data;
        using NinjaTrader.NinjaScript;
        using NinjaTrader.Core.FloatingPoint;
        using NinjaTrader.NinjaScript.DrawingTools;
        using NinjaTrader.NinjaScript.AddOns;
        #endregion
        
        //This namespace holds Indicators in this folder and is required. Do not change it.
        namespace NinjaTrader.NinjaScript.Indicators
        {
            public class TestAddOnIndicator : Indicator
            {
                protected override void OnStateChange()
                {
                    if (State == State.SetDefaults)
                    {
                        Description                                    = @"Enter the description for your new custom Indicator here.";
                        Name                                        = "TestAddOnIndicator";
                        Calculate                                    = Calculate.OnBarClose;
                        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;
                    }
                    else if (State == State.Configure)
                    {
                        int X = TestAddOn.Number;
                    }
                }
        
                protected override void OnBarUpdate()
                {
                    //Add your custom indicator logic here.
                }
            }
        }
        
        #region NinjaScript generated code. Neither change nor remove.
        
        namespace NinjaTrader.NinjaScript.Indicators
        {
            public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
            {
                private TestAddOnIndicator[] cacheTestAddOnIndicator;
                public TestAddOnIndicator TestAddOnIndicator()
                {
                    return TestAddOnIndicator(Input);
                }
        
                public TestAddOnIndicator TestAddOnIndicator(ISeries<double> input)
                {
                    if (cacheTestAddOnIndicator != null)
                        for (int idx = 0; idx < cacheTestAddOnIndicator.Length; idx++)
                            if (cacheTestAddOnIndicator[idx] != null &&  cacheTestAddOnIndicator[idx].EqualsInput(input))
                                return cacheTestAddOnIndicator[idx];
                    return CacheIndicator<TestAddOnIndicator>(new TestAddOnIndicator(), input, ref cacheTestAddOnIndicator);
                }
            }
        }
        
        namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
        {
            public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
            {
                public Indicators.TestAddOnIndicator TestAddOnIndicator()
                {
                    return indicator.TestAddOnIndicator(Input);
                }
        
                public Indicators.TestAddOnIndicator TestAddOnIndicator(ISeries<double> input )
                {
                    return indicator.TestAddOnIndicator(input);
                }
            }
        }
        
        namespace NinjaTrader.NinjaScript.Strategies
        {
            public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
            {
                public Indicators.TestAddOnIndicator TestAddOnIndicator()
                {
                    return indicator.TestAddOnIndicator(Input);
                }
        
                public Indicators.TestAddOnIndicator TestAddOnIndicator(ISeries<double> input )
                {
                    return indicator.TestAddOnIndicator(input);
                }
            }
        }
        
        #endregion
        ​
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          I am using the latest version I downloaded a week ago. Am I supposed to download or add something else after installing NT8?

          Comment


            #6
            Hello Vijay,

            Thanks for your notes.

            I don't see this issue when I test on my end the same as QuantKey_Bruce noted.

            If you see this behavior occurring with testing a third-party script, I suggest reaching out the the developer of the third-party script directly to inform them of the behavior.

            You could remove the custom script you got from the third-party developer and test the code QuantKey_Bruce shared to see if the behavior persists.

            Since this is an old forum thread, I suggest creating a new forum thread with a brief explanation of the behavior you are encountering along with the NinjaTrader version you are using and a reduced test script demonstrating the behavior.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bmartz, 03-12-2024, 06:12 AM
            5 responses
            32 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Started by Aviram Y, Today, 05:29 AM
            4 responses
            13 views
            0 likes
            Last Post Aviram Y  
            Started by algospoke, 04-17-2024, 06:40 PM
            3 responses
            28 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by cls71, Today, 04:45 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X