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

Strange Bug with Indicator Parameter Section Fields and Enum's

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

    Strange Bug with Indicator Parameter Section Fields and Enum's

    I have just spent the past hours pulling my hair out trying to understand why the following two snippets from some indicators would compile or not.

    Before I show them, I have a set custom public Enum's in the UserDefinedMethods Class (I have changed the enum name in the samples below).

    The first snippet compiles perfectly:

    Code:
    [Description("Custom Enum Type"), Category("Parameters")]
    [NinjaTrader.Gui.Design.DisplayName("PressureCalculation Type")]
    public CustomTypes CustomType
    {
                get { return this.customType; }
                set { this.customType = value; }
    }
    Note the order/layout of the "[Description("") ...] tag.

    The second snipped will not compile at all and I get errors at not being able to find the Enum (are you missing the assembly error).

    Code:
    [Description("Custom Enum Type")]
    [Category("Parameters")]
    [NinjaTrader.Gui.Design.DisplayName("PressureCalculation Type")]
    public CustomTypes CustomType
    {
                get { return this.customType; }
                set { this.customType = value; }
    }
    Simply splitting the Description and Category fields causing the compile to fail. Why would you care you may ask??

    Well functionally who cares, but when trying to use Intellisence to allow to me easily add indicators in other indicators and strategies, it works fine with the second snippet, but will not correctly show the methods with the first.

    Maybe it is something I am doing wrong here, but I can reproduce this easily now - including after restarting NT several times.

    #2
    dnuff, thanks for posting - I'm not sure if this is a supported use of enums, will need to check with development on this and will update this thread.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by inanazsocial, Today, 01:15 AM
    0 responses
    1 view
    0 likes
    Last Post inanazsocial  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    22 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Started by guillembm, Yesterday, 11:25 AM
    2 responses
    9 views
    0 likes
    Last Post guillembm  
    Started by junkone, 04-21-2024, 07:17 AM
    9 responses
    70 views
    0 likes
    Last Post jeronymite  
    Working...
    X