Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Save as default indicator properties problem

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

    Save as default indicator properties problem

    Hi,

    i am developing an indicator that print horizontal lines, one of the input properties is a Stroke to define color and width for the horizontal line, something like
    [NinjaScriptProperty]
    [XmlIgnore]
    [Display(Name="style", Description="xxx", Order=10, GroupName="Parameters")]
    public Stroke LineStyle
    { get; set; }

    And in State == State.SetDefaults i set a default value like
    LineStyle = new Stroke(Brushes.White, DashStyleHelper.Solid, 1);

    I draw the Horizontal line with this code:

    HorizontalLine openSecondHorizontalLine = Draw.HorizontalLine(this, "hl_openSecondVolume", openHorizontalLine.StartAnchor.Price, true, "");
    openSecondHorizontalLine.Stroke = LineStyle;

    So it works for add the indicator to a chart, but if i change on the indicator parameter input (when its added to a chart) and set the width of the Stroke to 2 or other number and save as default template, t works while NT8 is working, but when i close NT8 application and open again, it sets again the 1 value of the width and does not load the default saved template. same happens with the color of the line.


    #2
    Hello arbeydario,

    Using the XmlIgnore attribute means the property will not be saved in xml files such as workspaces or templates.

    Below is a link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      332 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X