Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Settings

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

    Time Settings

    I have a strategy that I built in Strategy Builder that I used time settings in. I had to unlock it to add some code manually and it has been working fine, but I wanted to change the default start and end time so when I add the strategy to a chart, they are already set. So I made the changes in Strategy Editor, but when I add the strategy to a chart, the original times are still the default. I seached all the code to see if the default time settings were somewhere else, but didn't find the settings anywhere else in the code. What's going on here?

    Click image for larger version

Name:	image.png
Views:	304
Size:	6.4 KB
ID:	1268578

    Click image for larger version

Name:	image.png
Views:	330
Size:	60.0 KB
ID:	1268579
    Last edited by Trader146; 09-12-2023, 10:30 AM.

    #2
    Hello Trader146,

    The defaults for the user inputs are inside State.SetDefaults. You would need to make the change you wanted and then compile. After that you need to remove and re apply the strategy.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello Trader146,

      The defaults for the user inputs are inside State.SetDefaults. You would need to make the change you wanted and then compile. After that you need to remove and re apply the strategy.
      That's where I changed them. Please see the screenshots I provided.

      Comment


        #4
        Hello Trader146,

        Did you do the other items that I mentioned?

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello Trader146,

          Did you do the other items that I mentioned?
          Yes I did. The screenshot is after reapplying strat to chart and restarting NT.

          Comment


            #6
            Hello Trader146,

            Did you at any point save a default template for the strategy?

            Comment


              #7
              Originally posted by NinjaTrader_Jesse View Post
              Hello Trader146,

              Did you at any point save a default template for the strategy?
              No I did not. I'm not even sure what that is or why I would do it.

              Plus, I;ve also save the strategy under a new name from the orginal. Does that matter?

              Comment


                #8
                Hello Trader146,

                Its possible that you are not editing the correct script if you are not seeing changes when re applying the strategy. I would suggest to delete that copy of the strategy and compile, make sure it does not appear in the strategies list and then do a save as from the original. If your original is in the builder you can use the first screen of the builder where you have the drop down list of strategies to Save As to create a copy. That will ensure the naming of the new strategy is right. After doing that make the edits you did and compile and apply the new version of the strategy. If you are still having problems please attach the edited copy of the strategy to your post.

                Comment


                  #9
                  Originally posted by NinjaTrader_Jesse View Post
                  Hello Trader146,

                  Its possible that you are not editing the correct script if you are not seeing changes when re applying the strategy. I would suggest to delete that copy of the strategy and compile, make sure it does not appear in the strategies list and then do a save as from the original. If your original is in the builder you can use the first screen of the builder where you have the drop down list of strategies to Save As to create a copy. That will ensure the naming of the new strategy is right. After doing that make the edits you did and compile and apply the new version of the strategy. If you are still having problems please attach the edited copy of the strategy to your post.
                  I've actually already done everything you suggested before posting here. But I'll start over and post the fix if I find one. Thanks!

                  Comment


                    #10
                    Originally posted by NinjaTrader_Jesse View Post
                    Hello Trader146,

                    Its possible that you are not editing the correct script if you are not seeing changes when re applying the strategy. I would suggest to delete that copy of the strategy and compile, make sure it does not appear in the strategies list and then do a save as from the original. If your original is in the builder you can use the first screen of the builder where you have the drop down list of strategies to Save As to create a copy. That will ensure the naming of the new strategy is right. After doing that make the edits you did and compile and apply the new version of the strategy. If you are still having problems please attach the edited copy of the strategy to your post.
                    Ok, looks like the strat hadn't compiled. I saved it to a new name again but couldn't find it in the list. Then I went back and compiled it, and it showed up in the list with the new settings. So then I compiled the original file and the new settings showed up. So it looks like the problem was it didn't compile when I originally made the changes because the strat was still loaded and active in the chart. I remember getting a popup about being unable to save or something like that but I didn't read it carefully. Anyway, all is well now. Thanks!

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Today, 05:17 AM
                    0 responses
                    52 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    130 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    70 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    43 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    47 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X