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

Indicator properties

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

    Indicator properties

    Hi,

    I would like to create an indicator that will get a structure type as a property .
    instead of separate parameters how can I do that?

    for example:

    struct indInfo
    {
    int x;int y ,int z, ........
    }

    calling the indicator:
    indInfo info = new indInfo;
    myIndicator(indInfo);

    instead of myIndicator(x,y,z,....)

    thanks, kobi

    #2
    Originally posted by levikNT View Post
    Hi,

    I would like to create an indicator that will get a structure type as a property .
    instead of separate parameters how can I do that?

    for example:

    struct indInfo
    {
    int x;int y ,int z, ........
    }

    calling the indicator:
    indInfo info = new indInfo;
    myIndicator(indInfo);

    instead of myIndicator(x,y,z,....)

    thanks, kobi
    No can do. Been there, tried that. NT seemingly acknowledges it as a limitation.

    ref: http://www.ninjatrader.com/support/f...ad.php?t=44274

    Comment


      #3
      Hello kobi,

      Thank you for your post.

      Unfortunately, I could not get a struct to pass more than one variable. I also could not find any means to pass more than one variable from a struct in one call. For example, I would have to use myIndicator(indinfo.x, indinfo.y, indinfo.z).

      If you are trying to bypass entering values each time you can create a variable of the indicator. For example:
      Code:
              #region Variables
      		private EMA myEma;
              #endregion		
      
              protected override void Initialize()
              {
      			myEma = EMA(20);
              }
      
              protected override void OnBarUpdate()
              {
      			Print(myEma[0]);
      		}

      Comment


        #4
        Originally posted by NinjaTrader_PatrickH View Post
        Hello kobi,

        Thank you for your post.

        Unfortunately, I could not get a struct to pass more than one variable. I also could not find any means to pass more than one variable from a struct in one call. For example, I would have to use myIndicator(indinfo.x, indinfo.y, indinfo.z).

        If you are trying to bypass entering values each time you can create a variable of the indicator. For example:
        Code:
                #region Variables
        		private EMA myEma;
                #endregion		
        
                protected override void Initialize()
                {
        			myEma = EMA(20);
                }
        
                protected override void OnBarUpdate()
                {
        			Print(myEma[0]);
        		}
        Hello PatrickH,

        1. It doesn't matter if there is a means to pass a struct to indicator as a parameter , I should able to do that.
        2. The reasons that I want to pass a struct as a parameter to Indicator are:
        2.1 if I want to add more parameters to indicator, then I will only update the struct and wouldn't update all the calls to that indicator .
        2.2 I want them as a group data in the Indicators window under the parameter section, and I would like to collapse or expands these parameters as I do from the plot section.
        2.3 conveniences issue

        thanks, kobi
        Last edited by levikNT; 08-17-2014, 12:23 PM.

        Comment


          #5
          Originally posted by levikNT View Post
          Hello PatrickH,

          1. It doesn't matter if there is a means to pass a struct to indicator as a parameter , I should able to do that.
          2. The reasons that I want to pass a struct as a parameter to Indicator are:
          2.1 if I want to add more parameters to indicator, then I will only update the struct and wouldn't update all the calls to that indicator .
          2.2 I want them as a group data in the Indicators window under the parameter section, and I would like to collapse or expands these parameters as I do from the plot section.
          2.3 conveniences issue

          thanks, kobi
          Which means that you have not read my response, where I explain that I have already been down this road, and NT accepts it, more or less, as a limitation in the current incantation?

          I made the same arguments, for the same reasons. They are all in the thread to which I referred you.

          Comment


            #6
            Originally posted by koganam View Post
            Which means that you have not read my response, where I explain that I have already been down this road, and NT accepts it, more or less, as a limitation in the current incantation?

            I made the same arguments, for the same reasons. They are all in the thread to which I referred you.
            Hello koganam,

            Sorry, I did read your response , but may be I did understand Patrick response.
            I hope that in NT 8 that we wait a lot for NT release, NT will fix this basic BUG, or limitation.
            Thanks ,Kobi

            Comment


              #7
              Thanks for the feedback here Kobi, I've noted it as well in our enhancement trackings list for consideration in NT8 (#1283).
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by wzgy0920, 04-20-2024, 06:09 PM
              2 responses
              26 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, 02-22-2024, 01:11 AM
              5 responses
              32 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, Yesterday, 09:53 PM
              2 responses
              49 views
              0 likes
              Last Post wzgy0920  
              Started by Kensonprib, 04-28-2021, 10:11 AM
              5 responses
              192 views
              0 likes
              Last Post Hasadafa  
              Started by GussJ, 03-04-2020, 03:11 PM
              11 responses
              3,234 views
              0 likes
              Last Post xiinteractive  
              Working...
              X