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 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
        BertrandNinjaTrader Customer Service

        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 Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          6 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Started by alifarahani, Today, 09:40 AM
          6 responses
          41 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          21 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Working...
          X