Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug with TimeSpan datatype indicator properties

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

    Bug with TimeSpan datatype indicator properties

    Hi guys,

    I've found a bug relating to custom indicators with TimeSpan datatypes in NT v7.0.1.

    Please follow the steps below to reproduce:

    1. Download the attached indicator and add to a new chart.

    The indicator will be loaded with the TimeSpan variable set to the default value of 10:10:10.

    2. Shutdown NT and when prompted, save the chart.
    3. Restart NT

    The indicator will be loaded with the timespan variable set to 00:00:00 instead of the default value.

    It looks like the mechanism NT7 uses to persist indicator property values between sessions isn't correctly saving and then restoring TimeSpan datatypes.

    Give me a shout if you have any questions.

    Thanks

    Stu
    Attached Files

    #2
    timespan cannot be serialized. this is by default in .Net

    search the forum on how to serialize timespan, and you will find workarounds.

    Comment


      #3
      Originally posted by bukkan View Post
      timespan cannot be serialized. this is by default in .Net

      search the forum on how to serialize timespan, and you will find workarounds.
      Oh yes, I'd forgotten that the XmlSerializer doesn't handle TimeSpans. My bad.

      Comment


        #4
        Thanks bukkan, the attached works for me.
        Attached Files

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Thanks bukkan, the attached works for me.
          Thanks guys.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sjsj2732, Yesterday, 04:31 AM
          0 responses
          32 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          286 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          283 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          133 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          91 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X