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 hide a strategy from the list of strategies (Strategies>Available ListBox)

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

    How to hide a strategy from the list of strategies (Strategies>Available ListBox)

    I created a base partial class from which my strategies derive from. This base class then derives from Strategy Class as expected (public partial class MyStrategyBase : Strategy).
    I would like to hide this class from the Strategies>Available Listbox just like NT8 hides the class Strategy.cs. How can I accomplish this?
    Thank you!

    #2
    Hello,

    Thank you for the question.

    I am unsure of a specific way to hide the base you have made from the menus as it is a strategy as well. You could potentially use a blank name but the platform would still register it as a strategy because it is. In general, subclassing the bases like this is not directly supported as it can lead to strange occurrences in the platform.

    To make a copy of the existing partial strategy class, it would need to be identical to the existing one but with a unique name. That would mean it needs to inherit StrategyRenderBase rather than Strategy. This would allow it to compile but I really couldn't provide any guidance on what else may be required in this approach.

    If any community members currently use this type of approach and have run into this situation, please feel free to provide your notes or any details on resolutions you had.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi, hope you're doing well,
      Is there a solution to this? I have a similar situation, where I want to create a strategy base class containing some common features multiple other strategies will then use. These features include such, which are not well suited or possible to provide as simple functions to be used, so the best solution is to use a base class. But I'd like this class to be hidden from the strategy selection, as it by itself will not contain any entry logic, and might cause confusion for my customers.

      Comment


        #4
        Originally posted by Human#102 View Post
        create a strategy base class .... hidden
        Make your base class abstract.

        Good reading here and here.
        Last edited by bltdavid; 02-24-2024, 03:43 PM.

        Comment


          #5
          Thank you very much. ^^

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by aussugardefender, Today, 01:07 AM
          0 responses
          3 views
          0 likes
          Last Post aussugardefender  
          Started by pvincent, 06-23-2022, 12:53 PM
          14 responses
          238 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          9 responses
          384 views
          1 like
          Last Post Gavini
          by Gavini
           
          Started by oviejo, Today, 12:28 AM
          0 responses
          4 views
          0 likes
          Last Post oviejo
          by oviejo
           
          Started by pechtri, 06-22-2023, 02:31 AM
          10 responses
          125 views
          0 likes
          Last Post Leeroy_Jenkins  
          Working...
          X