Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

visual studio, strategy as 1 project

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

    visual studio, strategy as 1 project

    I like working with Visual Studio.

    But what bothers me a lot is that when I rename something, Visual Studio doesn't just rename the values ​​in the current strategy. It also renames things in other strategies or indicators.

    Of course, that shouldn't be the case.

    If I want to rename something, I can only do so in the respective strategy.


    How can I configure Visual Studio so that I can work on one strategy without changing the code in other strategies?​

    #2
    Hello 1001111,

    It sounds like you are doing a rename all instead of just rename. There is no "setup" for that you just have to use the right option when renaming. The default keyboard command is control + H and you need to select current document in the rename dialog.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello 1001111,

      It sounds like you are doing a rename all instead of just rename. There is no "setup" for that you just have to use the right option when renaming. The default keyboard command is control + H and you need to select current document in the rename dialog.
      Exactly, I forgot to write that.

      I want to rename something in the entire strategy.
      But then other strategies or indicators are also being renamed. Which shouldn't happen.

      How can I edit a strategy in Visual Studio so that I only edit one strategy?

      Comment


        #4
        Hello 1001111,

        it would be the same instructions, you need to do a rename and select current document.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello 1001111,

          it would be the same instructions, you need to do a rename and select current document.
          I'm asking because I want to rename not just the current document, but the entire strategy.
          (This consists of multiple documents)

          If I only rename the current document, the items in the entire strategy won't be renamed.

          However, I would like to rename elements in the entire strategy (multiple documents, same namespace) without changing other strategies.

          But I don't want to change other strategies or indicators.

          How can I edit a strategy (from multiple documents) in Visual Studio so that I only edit one strategy?​

          Comment


            #6
            Hello 1001111,

            That would be due to your own design in that case, strategies in general are only a single file. If you used more advanced C# structure and placed it in multiple files you likely need to manually make changes to each file. In response to your original posts question about avoiding renaming other files, if you do a rename in the solution that will rename things in other files, to rename only in the current file you have to select current document.

            JesseNinjaTrader Customer Service

            Comment


              #7
              In larger projects, a file can quickly become very long and confusing.
              Changes in one place can have unintended effects elsewhere.
              Individual sections of code are harder to reuse.

              In general, I recommend splitting code into multiple files.
              Multiple files provide better organization. This improves clarity and maintainability.
              Individual files can be more easily reused in other projects.

              In complex projects (e.g., 100 files), it's not possible to edit each file individually, as the effort would be extreme and could lead to errors.

              Thanks anyway for your effort.​

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by defa0009, Today, 12:27 PM
              0 responses
              1 view
              0 likes
              Last Post defa0009  
              Started by manteored, 02-16-2023, 10:24 AM
              6 responses
              1,639 views
              0 likes
              Last Post charlesthomas  
              Started by mbrandau, 07-28-2021, 01:58 PM
              11 responses
              569 views
              0 likes
              Last Post bluesoul40  
              Started by _Zero_, 04-10-2020, 03:21 PM
              149 responses
              8,929 views
              6 likes
              Last Post ChrisR
              by ChrisR
               
              Started by benghabili, Today, 10:18 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Working...
              X