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

Bug while public/private modification of property

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

    Bug while public/private modification of property

    you can reproduce the error too.
    just use this code (indicator):



    however, when I attach that to chart,i get this error:


    but if i change the property "EnabledRegions" from public to private, then it starts working...
    what is the problem? maybe it's but in NT.

    #2
    Hello TazoTodua,

    Thanks for opening the thread.

    I could not hit the error with the example provided, but I can explain the error you are inquiring on.

    Public properties will be serialized so they can be retrieved at a later point. For example, from a workspace or chart template. Brushes need to be serialized because the Brush itself can't be directly written to XML. This same concept applies to types that cannot be serialized.

    These public properties could be made private, or they could be include a serializable type like a string that the the property can be converted too. Alternately, the XmlIgnoreAttribute could be used to prevent the public property from serializing all together.

    XmlIgnoreAttribute - https://ninjatrader.com/support/help...eattribute.htm

    Serializing Brushes - https://ninjatrader.com/support/foru...43&postcount=2

    Serialization - https://docs.microsoft.com/en-us/dot...lization/index

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      thanks as always for excellent answer.

      but one thing we wish....
      i dont know, it is easy for NT developers, to detect if "public" type (or anything variable) that is going to be cached/serialized (like brushes or etc), why the compiler (or NT) does the serialization job itself?
      it would have been useful for us (developers) to code things easily, without taking care which types need serialization and which not...

      we could just set:

      public xyz the_name ....


      and NT should take care whether "xyz" is an object or not...
      It would be good if you send this request to Devs.

      Comment


        #4
        Hello,

        Thank you for the reply.

        I will put in a feature request.

        The ID is SFT-3026

        Please let us know if we may be of further assistance.
        Last edited by NinjaTrader_Jesse; 02-13-2018, 11:30 AM.
        JesseNinjaTrader Customer Service

        Comment


          #5
          ok, please post the request id here. thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          9 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,235 views
          0 likes
          Last Post sidlercom80  
          Started by thread, Yesterday, 11:58 PM
          0 responses
          3 views
          0 likes
          Last Post thread
          by thread
           
          Started by jclose, Yesterday, 09:37 PM
          0 responses
          8 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,415 views
          0 likes
          Last Post Traderontheroad  
          Working...
          X