Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Parameters in UserDefinedMethods

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

    Parameters in UserDefinedMethods

    Hi there

    I added a bool method to Parameters in my UserDefinedMethods.cs file.

    private bool iShowOnly = false;

    [Description("")]
    [GridCategory("Parameters")]
    publicbool ShowOnly
    {
    get { return iShowOnly; }
    set { iShowOnly = value; }
    }

    Since UserDefinedMethods.cs is public it shows in Parameters for all indicators. I only want to use it with a couple of indicators not all of them. Is there a way to restrict to which ones?

    Btw - I can't put the code just in the indicators I need because the methods I use are coded and referenced in the UserDefinedMethods.cs file...

    Thx
    Irvin

    #2
    Are you wanting this bool to show up on the parameters grid of only some indicators not others?

    Or are you just wanting some indicators to have the ability to access this bool?
    MatthewNinjaTrader Product Management

    Comment


      #3
      The former ... Some indicators.

      Comment


        #4
        Unfortunately i'm not aware of away to only have these public defined parameters show up on only some indicators grid.

        The only thing you would be able to do is create a public bool which could be accessed by the other indicator code directly, however you wouldn't be able to change this parameter from the Grid parameters.

        public bool iShowOnly = false;


        We will leave this thread open in the case another community member has experience in this area.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Matthew View Post
          Unfortunately i'm not aware of away to only have these public defined parameters show up on only some indicators grid.

          The only thing you would be able to do is create a public bool which could be accessed by the other indicator code directly, however you wouldn't be able to change this parameter from the Grid parameters.

          public bool iShowOnly = false;


          We will leave this thread open in the case another community member has experience in this area.
          Hi Matthew

          I got it to work another way.

          I added a boolean input into my method that is referenced from the indicators that need it.

          In UserDefinedMethods.cs:
          public bool MyMethod(bool iShowOnly)
          if iShowOnly = false
          // do something from before
          else
          // do something less

          Calling the method in the indicator: if MyMethod(ShowOnly) == true

          Thx
          Irvin

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by UltraNIX, Yesterday, 07:10 AM
          7 responses
          19 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by WHICKED, Today, 11:42 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by srbdoc, Today, 11:39 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_Eleanore  
          Started by rustyspring, Today, 10:55 AM
          2 responses
          11 views
          0 likes
          Last Post rustyspring  
          Started by collic653, Today, 10:05 AM
          3 responses
          20 views
          0 likes
          Last Post collic653  
          Working...
          X