• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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):

    https://pastebin.com/raw/zuFYhCdx

    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 kitwit, Yesterday, 11:59 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by otislauwaert, Today, 02:02 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by rafleischman, 10-18-2018, 12:11 PM
          2 responses
          22 views
          0 likes
          Last Post Alfred
          by Alfred
           
          Started by dadarara, Yesterday, 02:42 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Dan_D_Trader, Today, 04:46 PM
          0 responses
          2 views
          0 likes
          Last Post Dan_D_Trader  
          Working...
          X