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 parameter sequence

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

    Indicator parameter sequence

    NT Forum,

    An indicator which includes the below code displays the parameters in an incorrect sequence (i.e. the LongPeriod is displayed first and the ShortPeriod is displayed second). Please advise how to change the below code to correct this issue.
    Also, please advise how the below code can be made more concise.

    Code:
    #region Properties
    [Range(1, int.MaxValue)]
    [NinjaScriptProperty]
    [Display(Name="ShortPeriod", Description="Period for short-term simple moving average", Order=0, GroupName="Parameters")]
    public int ShortPeriod
    { get; set; }
    
    [Range(1, int.MaxValue)]
    [NinjaScriptProperty]
    [Display(Name="LongPeriod", Description="Period for long-term simple moving average", Order=1, GroupName="Parameters")]
    public int LongPeriod
    { get; set; }
    
    [Browsable(false)]
    [XmlIgnore]
    public Series<double> ShortSma
    {
    	get { return Values[0]; }
    }
    
    [Browsable(false)]
    [XmlIgnore]
    public Series<double> LongSma
    {
    	get { return Values[1]; }
    }
    #endregion
    As always, thanks
    Shannon

    #2
    L comes before S. It's alphanumeric.

    Comment


      #3
      Hello Shansen,

      I am not able to reproduce this behavior specifically for indicators in the Indicator window from a chart.

      I've copied and pasted these inputs into a new indicator.

      Attached is a screenshot of how I am seeing the order of these parameters in the Indicator window from a chart, as well as the test indicator.

      What version of NinjaTrader are you using?
      You can find this by clicking Help -> About... (for example 8.0.X.X)

      Please import this example and provide a screenshot of the Indicators window with this indicator selected.
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Shansen,

        In NT7, Sledge is correct in that its alphanumeric. To organize the inputs in a numeric fashion, simply use a 01. 02. etc etc for your naming convention.

        In NT8 it is not alphanumeric. Using the Order setting you can order the inputs. I haven't started with 0 like you did in your example, however I think that's valid as well.
        mrlogik
        NinjaTrader Ecosystem Vendor - Purelogik Trading

        Comment


          #5
          Apologies, to clarify please find attach two screenshots.
          First, the Indicator window shows the parameter sequence as desired, ShortPeriod followed by LongPeriod.
          Second, the Chart window shows the parameter sequence not as desired / expected, LongPeriod precedes ShortPeriod.

          Any insight would be appreciated.

          Shannon
          Attached Files

          Comment


            #6
            Good morning Shannon,

            I see what you're saying.

            This is just a guess as I don't have the ability to check right now, but perhaps the order on the tab is not associated with the Order = section of the input code. Maybe that is alphanumeric.

            A simple test would be to number your inputs with with 01., and 02. respectively. Try making that change, compile, and start with a fresh chart to test. If you have the default inputs saved on the indicator, you may need to delete that .xml template and start again as .xml files typically save certain metadata that may interfere with the new naming / etc.

            Hope this helps.
            mrlogik
            NinjaTrader Ecosystem Vendor - Purelogik Trading

            Comment


              #7
              Hello Shannon,

              Thank you for your patience.

              The behavior you are seeing has been requested for change. The request for the UI and Chart to respect the order assigned in code has been assigned the ID SFT-582.

              Please let me know if you have any questions.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by funk10101, Today, 09:43 PM
              0 responses
              6 views
              0 likes
              Last Post funk10101  
              Started by pkefal, 04-11-2024, 07:39 AM
              11 responses
              37 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Yesterday, 08:51 AM
              8 responses
              44 views
              0 likes
              Last Post bill2023  
              Started by yertle, Today, 08:38 AM
              6 responses
              26 views
              0 likes
              Last Post ryjoga
              by ryjoga
               
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              24 views
              0 likes
              Last Post algospoke  
              Working...
              X