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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      156 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      90 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      140 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X