Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible compiler bug

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

    Possible compiler bug

    I've noticed that if I create a new indicator NinjaScript file (Tools > New NinjaScript > Indicator) and comment out everything that has to do with the integer "MyInput0", there will be errors at compile time. The errors are that "MyInput0" does not exist, etc, and the locations or the errors are within the NinjaTrader generated code at the end of the file. Of note is that if you DELETE all references to MyInput0, it will compile just fine, but if you only comment out all references to MyInput0, you get the errors. Deleting the NT generated code and re-compiling doesn't seem to change anything.

    It's possible that this only happens to me, but I thought I'd ask.

    PHP Code:
    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Gui.Chart;
    #endregion

    namespace NinjaTrader.Indicator
    {
        [
    Description("Enter the description of your new custom indicator here")]
        public class 
    bug Indicator
        
    {
            
    #region Variables
                //private int myInput0 = 1; // Default setting for MyInput0
            #endregion

            
    protected override void Initialize()
            {
                
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line"Plot0"));
                
    Overlay                false;
            }

            protected 
    override void OnBarUpdate()
            {
                
    Plot0.Set(Close[0]);
            }

            
    #region Properties
            
    [Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
            
    [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
            
    public DataSeries Plot0
            
    {
                
    get { return Values[0]; }
            }

            
    /*[Description("")]
            [GridCategory("Parameters")]
            public int MyInput0
            {
                get { return myInput0; }
                set { myInput0 = Math.Max(1, value); }
            }*/
            #endregion
        
    }


    #2
    Happens to me too. Looks like some input has to be setup.

    But the odd thing is - looked under "Developing Indicators" in the help manual,
    the sample "Beginner - Using price variables", uses no parameters .


    Defining Input Parameters
    Below you will define your indicator's input parameters. These are any parameters that can be changed by the user and used in the calculation of the indicators value(s). If your indicator does not require any parameters leave the "Name" fields blank.

    Comment


      #3
      Originally posted by sledge View Post
      Happens to me too. Looks like some input has to be setup.

      But the odd thing is - looked under "Developing Indicators" in the help manual,
      the sample "Beginner - Using price variables", uses no parameters .


      Defining Input Parameters
      Below you will define your indicator's input parameters. These are any parameters that can be changed by the user and used in the calculation of the indicators value(s). If your indicator does not require any parameters leave the "Name" fields blank.
      Yeah, the thing is, I've noticed that if you take MyInput0 out completely (i.e. delete it), the indicator will compile as usual. The errors only get thrown when MyInput0 is commented out, but not deleted. Thanks for testing, it's good to know that it's not just me.

      Comment


        #4
        Originally posted by Radical View Post
        Yeah, the thing is, I've noticed that if you take MyInput0 out completely (i.e. delete it), the indicator will compile as usual. The errors only get thrown when MyInput0 is commented out, but not deleted. Thanks for testing, it's good to know that it's not just me.
        oops - on my part.

        I was trying to compile bug4 where I did like the example, and it was complaining about the original bug.cs.

        So the bug4 now compiles fine.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by junkone, Today, 11:37 AM
        2 responses
        12 views
        0 likes
        Last Post junkone
        by junkone
         
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        43 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by proptrade13, Today, 11:06 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        35 views
        0 likes
        Last Post love2code2trade  
        Working...
        X