Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TimSpan type not saved with workspace

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

    TimSpan type not saved with workspace

    hi - I have an indicator I am working on where one of it's inputs is a TimeSpan type (see code below). For some reason which I can't figure out, when I save the workspace, the values I set to this parameter are not saved. When I reopen the workspace, the value returns to the initial/default value (00:00:00).

    Other indicator params retain value just fine.

    Any ideas?


    Code:
            private TimeSpan noTradeStart1;
    and the property is defined as this:

    Code:
            [Description("")]
            [GridCategory("Parameters")]
            public TimeSpan NoTradeStartTime1
            {
                get { return noTradeStart1; }
                set { noTradeStart1 = value; }
            }

    #2
    In the indicator window ('ctrl + i' in a chart), when you're configuring or adding the indicator, set the timespan you want to save, right-click on the right-hand side of the window and choose "Set default for 'x'."

    Comment


      #3
      thanks. That saves the defaults for the study and it does work. The problem with that is that it means that I have one set of settings for the study and can't store different settings which is what I expect to have with workspaces. Really need the ability to save these values per workspace.

      Comment


        #4
        Originally posted by onnb1 View Post
        thanks. That saves the defaults for the study and it does work. The problem with that is that it means that I have one set of settings for the study and can't store different settings which is what I expect to have with workspaces. Really need the ability to save these values per workspace.
        You have to serialize the TimeSpan variables correctly. There are many ways to do so. Search the fora for serialize timespan and you should see quite a few examples to choose from.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        161 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        308 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        245 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        349 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X