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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X