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

Error generating xml document

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

    Error generating xml document

    hello , please can anybody help me to resolve the issiue of this indicator to generate the XLM file to be able to save a defaulte template , i find this indicator in the shared user files and it want be saved in chart template , everytime i have to add it again to the chart ,
    appreciate so much in advance and thanks a lot​
    Attached Files

    #2
    Hello deviltrader,

    The error you are getting is because the indicator can't be serialized in the workspace which means saved. Public properties need to be able to be saved as a string so items like Brushes cant be saved. I see that you have a brush serializer property but you didn't add [XmlIgnore] to your brush property, that would be one reason why that error happens.

    ZigZagColor needs [XmlIgnore]

    You also have some public variables which could be made private, these don't need saved with the workspace because they are not a User Input.

    public int dir; // direction of current zigzag trend, 1=up, -1=down
    public int lasthibar; // bar number of last swing high (bars ago = CurrentBar-lasthibar)
    public int lastlobar; // bar number of last swing low
    public double lasthi; // value of last swing high
    public double lastlo; // value of last swing low​

    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello deviltrader,

      The error you are getting is because the indicator can't be serialized in the workspace which means saved. Public properties need to be able to be saved as a string so items like Brushes cant be saved. I see that you have a brush serializer property but you didn't add [XmlIgnore] to your brush property, that would be one reason why that error happens.

      ZigZagColor needs [XmlIgnore]

      You also have some public variables which could be made private, these don't need saved with the workspace because they are not a User Input.

      public int dir; // direction of current zigzag trend, 1=up, -1=down
      public int lasthibar; // bar number of last swing high (bars ago = CurrentBar-lasthibar)
      public int lastlobar; // bar number of last swing low
      public double lasthi; // value of last swing high
      public double lastlo; // value of last swing low​

      thank you for the explanation , the issiue was resolved by bltdavid​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rhyminkevin, Today, 04:58 PM
      1 response
      41 views
      0 likes
      Last Post Anfedport  
      Started by iceman2018, Today, 05:07 PM
      0 responses
      5 views
      0 likes
      Last Post iceman2018  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      7 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      14 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      49 views
      0 likes
      Last Post futtrader  
      Working...
      X