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

Properties of Indicator

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

    Properties of Indicator

    Hello

    Q1
    Is there any provision to dynamically hide property from Indicator or Strategy?
    I scanned thru all available attributes and could not find anything
    Would appreciate a List of all Attributes that can be applied to a property...

    Q2
    IMHO, there needs to be at least one attribute with which I can set sequence on how I want properties to be lined up. Prefixing name with number is good work around but It'd be better if there was a defined attribute for the same

    Q3
    Another problem is one indicator which seems to plot correctly but always shows wrong values in Market Analyzer. It only has one Plot element and that is being set to values such as 1 and -1 (trend) but in Market Analyser, it shows values such as 93, 94, 95 etc ...

    Sometimes, these are closing prices. Sometimes, they are completely random ...
    Last edited by cdjindia; 01-27-2014, 08:32 AM.

    #2
    Originally posted by cdjindia View Post
    Hello

    Q1
    Is there any provision to dynamically hide property from Indicator or Strategy?
    I scanned thru all available attributes and could not find anything
    Would appreciate a List of all Attributes that can be applied to a property...
    I'm not aware of any but I'm also not sure I fully understand the purpose. Are you saying you have an input you don't want to make available to some scripts but work with others?

    Q2
    IMHO, there needs to be at least one attribute with which I can set sequence on how I want properties to be lined up. Prefixing name with number is good work around but It'd be better if there was a defined attribute for the same
    I will submit this as a feature request.

    Q3
    Another problem is one indicator which seems to plot correctly but always shows wrong values in Market Analyzer. It only has one Plot element and that is being set to values such as 1 and -1 (trend) but in Market Analyser, it shows values such as 93, 94, 95 etc ...

    Sometimes, these are closing prices. Sometimes, they are completely random ...
    Here are the most common reasons why you might see this
    • Wrong plot is selected in the MA properties
    • Calculate on bar close is set differently on each the MA and the chart
    • Different amounts of data, the MA by default uses 50 bars where as your chart may have more
    LanceNinjaTrader Customer Service

    Comment


      #3
      Originally posted by cdjindia View Post

      Q2
      IMHO, there needs to be at least one attribute with which I can set sequence on how I want properties to be lined up. Prefixing name with number is good work around but It'd be better if there was a defined attribute for the same
      I agree -- I have long wanted explicit control over the order of my indicator's settings.

      I do have a solution, but it is a total hack. What I do is to prefix the setting name with some number of tabs. The more tabs, the higher the attribute will be in the display. What is happening is that the tabs are forcing the attribute names to get sorted as I want them, and the tabs are not displayed.

      As I said, a total hack, but it does work.

      Example:
      [Gui.Design.DisplayName ("\t\t\t\t\t\t\t\t\tMain trend type")]

      --EV
      Last edited by ETFVoyageur; 01-27-2014, 11:53 AM.

      Comment


        #4
        ETFVoyageur

        I use the same hack but instead of tab, I use numbers or alphabets 1., 2. and so on ...

        Although it works correctly, it just feels stupid!

        It can easily and much more cleanly be managed with an attribute and hence I made the suggestion. Thanks for supporting that.

        Another place where Order of parameters is important in Indicators. I do the same in case of indicators, but there I can only prefix the property name with single alphabet such as a, b, c.

        This ensures that they also line up correctly in automatically generated code and in Indicator-Add window on a chart,

        For example, lets assume we have a custom indicator that allows users to choose between average computation styles. For choice, we could use an enumerate names of Moving Averages (EMA, SMA, WMA.... etc ...) and two integer numbers (for fast and slow period)

        I'd name public property for enum as aMAChoice, bMAFastPeriod, cMASlowPeriod

        Comment


          #5
          Originally posted by NinjaTrader_Lance View Post
          I'm not aware of any but I'm also not sure I fully understand the purpose. Are you saying you have an input you don't want to make available to some scripts but work with others?
          Its easier if we can consider an example. Lets say you have strategy that can accept 1, 2 or 3 fixed targets or no fixed targets at all. Ability to Choose can easily be provided by enum. In case user chooses the option to add only two targets, I want to hide the 3rd target from the parameter window.

          This can be done either with an attribute or thru a virtual function.

          Originally posted by NinjaTrader_Lance View Post
          Here are the most common reasons why you might see this
          • Wrong plot is selected in the MA properties
          • Calculate on bar close is set differently on each the MA and the chart
          • Different amounts of data, the MA by default uses 50 bars where as your chart may have more
          Indicator has only one plot. I had mentioned it.

          CalculateOnBarClose is always set to false on indicator. I just checked and MA was also false. MA does keep refreshing at every tick

          Last reason does not make any sense. Are you actually telling that Ninja MA corrupts data when it has to handle more? I sincerely hope that you meant something else.

          Comment


            #6
            Originally posted by cdjindia View Post
            Its easier if we can consider an example. Lets say you have strategy that can accept 1, 2 or 3 fixed targets or no fixed targets at all. Ability to Choose can easily be provided by enum. In case user chooses the option to add only two targets, I want to hide the 3rd target from the parameter window.

            This can be done either with an attribute or thru a virtual function.
            Unfortunately I don't have any information on this right now. I'll keep looking around and let you know if I find anything.


            Indicator has only one plot. I had mentioned it.

            CalculateOnBarClose is always set to false on indicator. I just checked and MA was also false. MA does keep refreshing at every tick

            Last reason does not make any sense. Are you actually telling that Ninja MA corrupts data when it has to handle more? I sincerely hope that you meant something else.
            The data doesn't get corrupted but some indicators will give different values whether they have 50 bars, or 200 bars loaded. You're also welcome to post the indicator here if you'd like me to test it out.
            LanceNinjaTrader Customer Service

            Comment


              #7
              Originally posted by cdjindia View Post
              ETFVoyageur

              I use the same hack but instead of tab, I use numbers or alphabets 1., 2. and so on ...

              Although it works correctly, it just feels stupid!
              What I like about using the tabs is that they are not visible to the user. Also much easier to adjust if I later add something new in the middle.

              --EV

              Comment


                #8
                Originally posted by ETFVoyageur View Post
                What I like about using the tabs is that they are not visible to the user. Also much easier to adjust if I later add something new in the middle.

                --EV
                Hmmm... will keep this advantage in mind next time. Thanks for highlight that

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by alifarahani, Today, 09:40 AM
                6 responses
                31 views
                0 likes
                Last Post alifarahani  
                Started by Waxavi, Today, 02:10 AM
                1 response
                17 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by Kaledus, Today, 01:29 PM
                5 responses
                14 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by Waxavi, Today, 02:00 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by gentlebenthebear, Today, 01:30 AM
                3 responses
                17 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X