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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      57 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      78 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      39 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      101 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      61 views
      0 likes
      Last Post PaulMohn  
      Working...
      X