Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

override-n inputs are not seen

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

    override-n inputs are not seen

    if we use the standard way:
    Code:
    class Indi_A : Indicator
    
    [Display(Name = "name")]
    [NinjaScriptProperty]
    public string myName  {  get; set;  }
    then everything is ok, and we can call indi from other indis, like:

    myIndi( string Name)

    however, when i add`override`


    Code:
    class Indi_A : Indi_B 
    .......
    
    
    class Indi_B : Indicator
    
    [Display(Name = "name")]
    [NinjaScriptProperty]
    public string myName  {  get; set;  }

    when I add want to call `indi_A(....)` from other indicator, it doesnt have an overload with string myName, like `indi_A(string myName)`.

    In base class I have several MUST-HAVE inputs (that i use in all indicators), and wanted that my indicators inherited those inputs automatically, in addition that they could be programatically called (but this last one is problem).
    Last edited by ttodua; 04-06-2018, 08:13 AM.

    #2
    Hello TazoTodua,

    Thanks for the post.

    If you are trying to override the property from a different indicator, the indicator (Indicator B) can use the variable from the other indicator's property (Indicator A) because they share the same namespace. Indicator B does not inherit from Indicator A so it does not know what to override.

    I found this StackOverflow post on this subject. It should help with completing this:
    I have an abstract base class and I want to declare a field or a property that will have a different value in each class that inherits from this parent class. I want to define it in the baseclass...


    The polymorphic way of doing this would require your base class to be abstract, but we are unable to change the implementation of the class given to us when we generate a new NinjaScript Indicator or Strategy.

    Please let us know if we may be of any further assistance.

    Comment


      #3
      I have updated original question to be more clear.

      Comment


        #4
        Hello TazoTodua,

        Thanks for the reply.

        This could be possible but the NinjaScript compiler will not generate properties from the base class. The properties must be available in the same indicator class to display in the property grid. The supported way of doing this would be to save your properties to a document and copy/paste the properties if you need to use these properties in multiple scripts.

        Please let me know if I may be of any further assistance.

        Comment


          #5
          Originally posted by NinjaTrader_ChrisL View Post
          Hello...
          but what you say is indication that NT compiler has a bug and we had to make a burden of manual copy-paste to solve that..

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X