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

Properly exposing public properties as inputs

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

    Properly exposing public properties as inputs

    I have a public property:

    Code:
            private bool colorBars = true;
            [Category("Visual")]
    	[Description("Color price bars")]
            [Gui.Design.DisplayName("01. Color Bars")]
            public bool ColorBars
            {
                get { return colorBars; }
                set { colorBars = value; }
            }
    However, when I call the indicator from a Strategy, this property does not appear in the intellisense as an input?

    I've tried restarting Ninja. . .

    #2
    Hello drmartell,

    Using NT7 you would want to use GridCategory instead of Category.

    Let us know if we can be of further assistance.
    Last edited by NinjaTrader_JC; 11-02-2012, 08:07 AM.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks JC, I did overlook that.

      However once I changed it and compiled it, the property still doesn't appear when I call the indicator.

      Code:
      private bool colorBars = true;
      [GridCategory("Visual")]
      [Description("Color price bars")]
      [Gui.Design.DisplayName("01. Color Bars")]
      public bool ColorBars
      {
          get { return colorBars; }
          set { colorBars = value; }
      }
      Interestingly, I did a "save as" to create a copy of the indicator with a new name and the newly created one does have the expected intellisense entries while the original does not.

      This persists after re-starting Ninja. What would cause that?
      Last edited by drmartell; 11-02-2012, 08:29 AM.

      Comment


        #4
        Hello drmartell,

        Can you confirm that you compiled the indicator before trying to access the intellisense?

        Also, is there more than one Overload that may have the colorBars as a parameter? You can view the different overloads by using the up and down arrow key. See attached image.
        Attached Files
        JCNinjaTrader Customer Service

        Comment


          #5
          Yes, I had compiled it and no it wasn't (and still isn't) present in any of the overloads.

          Comment


            #6
            Hello drmartell,

            Can you send a toy* NinjaScript code replicating the behavior so that I may look into this. You can either Export it as a Source File using the step from our Help Guide at the link below or just send the ".cs" file that is going to be located in the (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Indicator folder.
            http://www.ninjatrader.com/support/h...tml?export.htm


            You can send the file to support [at] ninjatrader [dot] com. In the subject line put: ATTN: JC and in the body of the email reference this thread like: http://www.ninjatrader.com/support/f...ad.php?t=53617


            Happy to be of further assistance.

            *Toy - basically a stripped down version of code that isn't necessarily the whole logic; making it easier to identify lines of code.
            JCNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by GLFX005, Today, 03:23 AM
            0 responses
            1 view
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Started by XXtrader, Yesterday, 11:30 PM
            2 responses
            11 views
            0 likes
            Last Post XXtrader  
            Started by Waxavi, Today, 02:10 AM
            0 responses
            6 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by TradeForge, Today, 02:09 AM
            0 responses
            11 views
            0 likes
            Last Post TradeForge  
            Started by Waxavi, Today, 02:00 AM
            0 responses
            2 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Working...
            X