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 Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
          55 responses
          5,448 views
          0 likes
          Last Post BartMan
          by BartMan
           
          Started by DawnTreader, 05-08-2024, 05:58 PM
          16 responses
          52 views
          0 likes
          Last Post DawnTreader  
          Started by tradingnasdaqprueba, 05-07-2024, 03:42 AM
          15 responses
          60 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by kevinenergy, Yesterday, 12:01 PM
          8 responses
          28 views
          0 likes
          Last Post kevinenergy  
          Started by nightstalker, Today, 01:32 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X