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

how to create my base indicator without showing in indicators list

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

    #31
    Originally posted by NinjaTrader_Emily View Post
    In response to your post # 19 when we say "not supported" that is because inheritance is not documented and we are aware of certain limitations specifically for indicators and strategies. The code that NinjaTrader uses as wrappers for caching, cloning, and generating overload parameters as well as how NinjaTrader generates instances of strategies for optimizations are not able to properly handle inheritance. I suspect that using inheritance with your own custom add-on window or items in the add-on class would work as expected, although these items are still undocumented in the NinjaTrader help guide - NinjaTrader-specific support is limited when it comes to inheritance as this is a broader C# concept and we do not offer hands-on C# education services. We do know that we are not able to offer support regarding inheritance specifically with indicators and strategies due to the reasons I mentioned. We know there would be an issue when attempting to do this, which is why it is officially not supported. Our development team does have it under consideration and our team is tracking demand.
    Ok, my bad, this was a decent attempt at explaining the specific case
    related to abstract base classes.

    Let's poke some holes in it.

    Originally posted by NinjaTrader_Emily View Post
    because inheritance is not documented
    This is just obfuscation.

    We're not talking about inheritance, nor do we really need to.

    Why?
    Because you don't give much thought to discussing inheritance when
    supporting partial classes -- I know, you're right, not much is needed.

    Ok, but my point is, let's be consistent.

    I suggest:
    NT should not give much background on inheritance when discussing
    abstract base classes. Understandably, abstract base classes are a
    much better example of inheritance. But my point is, so what if they're
    'not documented' -- just give a couple of links to 3rd-party educational
    websites and be done with it. Support folks do this often enough
    already -- so be consistent -- just follow the same policy for abstract
    base classes. If someone has a question about inheritance, point
    them towards other educational resources on the web.

    I mean, come on ...
    This 'inheritance is not documented' is not much of a blocker, and kind of
    a dumb reason. That is, the entire C# language is 'not documented' by
    NinjaTrader, but that doesn't stop NinjaTrader from using Dispatchers,
    or virtual methods, or delegates, or LINQ, or a whole host of other
    relatively advanced features which are a fundamental part of the C#
    language -- and therefore should not require 'documentation' from the
    Support staff, or anybody else.

    Originally posted by NinjaTrader_Emily View Post
    ... we are aware of certain limitations specifically for indicators and strategies. The code that NinjaTrader uses as wrappers for caching, cloning, and generating overload parameters ...


    This generated wrapper code is for indicators only, and has nothing to
    do with Strategies, or AddOns. Ok, we can agree on that.

    Nevertheless, this issue is moot.

    Support folks have already made the suggestion to move any partial
    classes to the AddOns folder -- precisely to avoid issues related to
    the generated code which is only ever added for Indicators.

    So, this same workaround can be promoted by Support when
    someone asks about abstract base classes.

    Problem solved.

    Originally posted by NinjaTrader_Emily View Post
    ... we are aware of certain limitations specifically for indicators and strategies. ... [such as] how NinjaTrader generates instances of strategies for optimizations are not able to properly handle inheritance


    How do you know this?
    Do you have an example?

    I kinda doubt this is even possible.

    Using an abstract base class does not change how objects
    are instantiated. C# itself would be broken if Strategy objects
    were not properly able to handle inheritance.

    Just because my Strategy inherits from one or more abstract
    base classes, as long as the lowest abstract base class is
    inheriting from Strategy, what is the issue? The inheritance
    hierarchy is always properly maintained, otherwise the C#
    language itself is broken
    .

    NT's reasoning on this is pure crap, er, I mean, just another
    attempt at obfuscation. A red herring.

    Please provide an example of the inheritance problems you
    encountered during strategy optimizations.

    Originally posted by NinjaTrader_Emily View Post
    NinjaTrader-specific support is limited when it comes to inheritance as this is a broader C# concept and we do not offer hands-on C# education services.
    ​​

    Understood, but partial classes are also a broader C# concept,
    and the partial class concept is 'supported'. Barely.

    I know Support folks are not there for C# education -- but plenty
    of times Support will gently sidestep the issue of education by
    providing links to 3rd party C# language education resources.

    Ok, so, do that for inheritance. Do that for abstract base classes.
    Support is not lazy, you guys graciously help others learn C# by
    providing such links already.

    My point is: You've already established precedent for providing
    educational links, so you can't now reply upon the lack of an
    in-house educational resource and call it a barrier for support
    of the C# language feature called abstract base classes.

    So, what's the problem?
    Find some good 3rd-party links, have them at the ready, just
    like you do for other aspects of the C# language.

    My point is: there is no problem.
    This is a another red herring.

    Originally posted by NinjaTrader_Emily View Post
    We know there would be an issue when attempting to do this, which is why it is officially not supported.
    ​​

    Without example code, I think this is baloney.
    Until proven otherwise, it is baloney.

    I'll say it again:
    The C# language supports abstract bases classes just fine.
    The NinjaScript framework supports abstract bases classes just fine.

    An abstract base class 'extends' the inheritance hierarchy, which is
    always maintained correctly, even during Strategy optimizations --
    otherwise, the C# language itself is broken. And I do not believe
    Support's wild accusations that inheritance in C# is broken.

    My final summary is this:
    In the world of providing support examples and advice, there is
    absolutely no reason why abstract base classes should not enjoy
    equal footing with partial classes.

    -=o=-

    Just my 2˘.

    Last edited by bltdavid; 03-26-2023, 10:38 PM.

    Comment


      #32
      Originally posted by jeronymite View Post
      bltdavid on target! QuantKey_Bruce in the right direction.

      The "NinjaScript Editor" is really just the Actipro Syntax Editor. This post has more to say on the matter, as well as links to even more to say on the matter!

      Summary: it's old, it's bug-ridden, it has needed to be brought up to the latest version for years.

      And while we're at it, so do C# and .NET (yes, that old chestnut, again!). Also, recognise that SharpDX is no longer supported, as of almost exactly 4 years ago, to be precise; but there are alternatives.

      The Desktop platform wisely incorporates some very useful third-party products that reduce the need for NinjaTrader to "re-invent the wheel". Sadly though, NinjaTrader has not kept those products up-to-date, and seems unwilling to do that, despite a cacophony of requests from its often highly-knowledgeable user community. This means, as I have spoken of in detail elsewhere (see C#/.NET post linked above), that the platform is using many third-party products that have been obsolete for years, even though up-to-date versions (or good, compatible alternatives) exist for them.

      Waaaaaay past time to rectify the situation!

      Thanks.
      jeronymite Great reminders.

      Actipro syntax editor looks like it is at least four major versions behind comparing what's installed in 8.1 and what's on their website. This really should be brought current if it's to be the desktop editor.

      It could be a heavy lift to swap out SharpDX and might have to be the sort of thing that's done in "NinjaTrader 9" whatever it may be called if it breaks a good amount of existing NinjaScript.

      C#.NET could probably be brought up without as much drama because it's backward compatible.
      Last edited by QuantKey_Bruce; 03-27-2023, 05:10 AM.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #33
        Hello bltdavid,

        there is
        absolutely no reason why abstract base classes should not enjoy
        equal footing with partial classes.
        As there are known issues, our team does not support this at this time. We are happy to submit a feature request for support for abstract classes to be supported in future versions.​

        See this forum thread where this has already been discussed.
        Hello, I am trying to build out a framework to create a variety of anchored VWAP based indicators. To do this I have created an anchored VWAP class (VWAP8) where the anchor bar, anchor price, and number of bars the VWAP calculates for (duration) are accessible to other indicators/classes. The next part of this framework is a
        Chelsea B.NinjaTrader Customer Service

        Comment


          #34
          I have successfully
          • Hidden indicators from the list
          • Created base classes for indicators to derive from.
          ​See this post here https://forum.ninjatrader.com/forum/...27#post1243127

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Jimmyk, 01-26-2018, 05:19 AM
          6 responses
          835 views
          0 likes
          Last Post emuns
          by emuns
           
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,291 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          10 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          11 responses
          62 views
          0 likes
          Last Post halgo_boulder  
          Started by Option Whisperer, Today, 09:55 AM
          0 responses
          9 views
          0 likes
          Last Post Option Whisperer  
          Working...
          X