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 can You Subcategorize Plots In Indicator Properties Window?

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

    How can You Subcategorize Plots In Indicator Properties Window?

    I have a custom indicator with six different plots. Three plots are lines and three plots are dots. Rather than have all six plots appear consecutively under the plots subheading of the Indicator Properties window, is there a way to group some of the plots under a custom subheading? Could I create custom subheadings for instance “Line Plots” and “Dot Plots”? I realize this could easily be done by changing the name of the plots to begin with “Line” or “Dot”, and then use
    Code:
    get { return Values[x]; }
    to control the ordering, but I really would like to do it with a custom subheading if possible


    It is easy to do this with other indicator parameters. For instance, you can change the GroupName from the default “Parameters” to a custom name of your choosing. You can also set the display order of the particular property using Order= (see below).


    Code:
    [NinjaScriptProperty]
     [Display(Name="LineAColor", Order=1, GroupName="Custom Subcategory Name Here")]
     public string LineAColor
     { get; set; }
    Is there a similar method to group plots into a custom subcategory? It appears that Woodies CCI does this to some degree, but I’m not sure how as the indicator is not editable.

    #2
    Hello h1000,

    Thanks for the post.

    Plots are already their own sub-heading, and the "plots" from the woodies indicator appear to be some kind of modification that is unknown to me. The actual plots are CCI and Turbo. What you could do is make your own properties to use and order those in the way you wish.

    Please let me know if you have any questions.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      What you could do is make your own properties to use and order those in the way you wish.

      I'm not exactly sure what you mean... Are you suggesting that one could use a custom property that when changed by the user would (indirectly) change the plot settings of a plot? That would be an interesting way of doing it, if it could be done.
      Last edited by h1000; 08-29-2018, 12:17 PM.

      Comment


        #4
        Hello h1000,

        Thank you for the reply.

        You can do this by making a Brush property and then calling AddPlot in State.Configure with that Brush. There is an example of this here:



        For an example on how to set up a stand-alone Brush property, see this link:



        Please let me know if I can assist further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Chris, I can see how using a brush would work, and in circumstances where the plot style would not need to be changed, using a configurable brush would be adequate. But in cases where flexibility were needed to change the plot from a PlotStyle.Line to PlotStyle.Square, the brush approach wouldn't suffice (at least I don't think it would).

          Anyway, thanks for the info, and perhaps I can figure out a work-around using a brush.

          If anyone by chance does know how to create a custom subcategory within the plot section, it would be great if you could post! Thanks!
          Last edited by h1000; 08-29-2018, 12:49 PM.

          Comment


            #6
            Originally posted by h1000 View Post
            Chris, I can see how using a brush would work, and in circumstances where the plot style would not need to be changed, using a configurable brush would be adequate. But in cases where flexibility were needed to change the plot from a PlotStyle.Line to PlotStyle.Square, the brush approach wouldn't suffice (at least I don't think it would).

            Anyway, thanks for the info, and perhaps I can figure out a work-around using a brush.

            If anyone by chance does know how to create a custom subcategory within the plot section, it would be great if you could post! Thanks!
            Not exactly simple, but doable. You would have to:
            1. Set ArePlotsConfigurable = false; to remove the Plots section from the PropertyGrid.
            2. Use explicit properties for the Plots, as objects.
            3. Use XmlIgnore on the property definition.
            4. Write your own serialization code, ŕ la how we do it for all other non-primitive classes/structs.

            Comment


              #7
              Koganam, thanks very much for your input. As you said it's not exactly simple, but I will look into it. At least now I have a starting point.
              Last edited by h1000; 08-31-2018, 08:57 AM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by TheMarlin801, 10-13-2020, 01:40 AM
              21 responses
              3,915 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by timmbbo, 07-05-2023, 10:21 PM
              3 responses
              151 views
              0 likes
              Last Post grayfrog  
              Started by Lumbeezl, 01-11-2022, 06:50 PM
              30 responses
              808 views
              1 like
              Last Post grayfrog  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by Johnny Santiago, 10-11-2019, 09:21 AM
              95 responses
              6,194 views
              0 likes
              Last Post xiinteractive  
              Working...
              X