Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with shading regions.

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

    #16
    Ok, just noticing now, one difference between the two lots of properties is the "get; set;" part. Could this be the issue? If so, could you please explain why?

    Comment


      #17
      Hello KennyK,

      Thanks for the reply.

      Please try adding the [NinjaScriptProperty] decorator to the top of your properties. This will ensure they are added to the property grid properly.

      e.g:

      [NinjaScriptProperty]
      [Display(Name = "1. Color Zone?", Description = "Color Zone?", GroupName = "Colors - Long Trend Up", Order = 1)]
      public bool ColorzoneLU
      {
      get { return colorzoneLU; }
      set { colorzoneLU = value; }
      }

      I look forward to hearing of your results.

      Comment


        #18
        Ok, done that. Seems to save everything now, but all the properties are being written in the top of the chart. How do I get rid of that?
        I left the [XMLIgnore] in, but I see in the sample you wrote, you have omitted it. Is that intentional, should I omit the [XMLIgnore] from all the properties?
        Thanks for you patience.
        Attached Files

        Comment


          #19
          Hello KennyK,

          Thank you for your reply.

          You do not need to put [XMLIgnore] on every property, only the ones that require serialization should have that decorator. Using [XMLIgnore] will guarantee that the property is not saved to the XML file.

          To remove the label from the top of your chart, just override the DisplayName property in your script. Customize the display name and the long parameter list will be replaced with whatever you override the display name as.

          Please let me know if I can assist further.

          Comment


            #20
            Hi Chris, Tried that, got a heap of errors. Probably did something wrong? I just did what I thought it said to do in the link you provided.
            You will see in the attached pic, name1, that the default name is what it should be, and does not include all the properties that actually print on the chart.
            But I have circled in red, the code that I added as per the perceived instruction.
            Please advise.
            Thanks, Ken.

            Actually there are 3 of the inputs I would like to have display along with the name, just not all the rest of them. The 3 are the EMA periods.
            So should look like: TrendMA35. 5, 8, 13.
            Attached Files
            Last edited by KennyK; 02-27-2019, 04:40 PM. Reason: Added comment

            Comment


              #21
              In addition to the previous message, I have looked at the code of another indicator to find an override example. I have applied it the same way to my indicator. It seems to work.
              Can you confirm this is the right way to do it? If so, how then do I get the EMA inputs to show there as well?
              Attached Files

              Comment


                #22
                Hello Ken,

                Thanks for the reply.

                Your last image is the correct way of setting up the DisplayName.

                To include the EMA parameters, concatenate the values of EMA1Period to the string.

                e.g.

                public override string DisplayName
                {

                get { return ("TrendMA35, EMA1 Period: " + EMAPeriod1 );}

                }

                Please let me know if I can assist further.

                Comment


                  #23
                  Hi Chris,
                  Thanks for your reply.
                  I now have this:
                  public override string DisplayName
                  {
                  get { return ("TrendMA35-" + EMA1Period + EMA2Period + EMA3Period);}
                  }
                  Which prints this: TrendMA35-82134
                  Is there as simple way to have commas inserted between each of the EMA settings?
                  To print like this: TrendMA35-8,21,34
                  Cheers,
                  Ken.

                  Comment


                    #24
                    Hello KennyK,

                    Thank you for the reply.

                    This can be done with some additional string concatenation.

                    e.g.

                    Code:
                    public override string DisplayName
                    {
                            get { return ("TrendMA35 - " + EMA1Period + ", " + EMA2Period + ", " + EMA3Period);}
                    }
                    Please let me know if I can assist further.

                    Comment


                      #25
                      Cool, thanks heaps Chris!

                      Comment


                        #26
                        Here is your updated code DrawOnPricePanel = false;

                        ABC123TRADER
                        Attached Files

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        648 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        369 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        108 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        572 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        573 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X