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

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 Stanfillirenfro, Today, 07:23 AM
        9 responses
        23 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by George21, Today, 10:07 AM
        0 responses
        6 views
        0 likes
        Last Post George21  
        Started by DayTradingDEMON, Today, 09:28 AM
        2 responses
        16 views
        0 likes
        Last Post DayTradingDEMON  
        Started by navyguy06, Today, 09:28 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        8 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X