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

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 trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      22 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Started by guillembm, Yesterday, 11:25 AM
      2 responses
      9 views
      0 likes
      Last Post guillembm  
      Started by junkone, 04-21-2024, 07:17 AM
      9 responses
      68 views
      0 likes
      Last Post jeronymite  
      Started by mgco4you, Yesterday, 09:46 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X