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

Troubles with Custom Project Environment

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

    Troubles with Custom Project Environment


    Hi,

    I'm having constant issues with the entire Custom project. I work mostly with creating my own Indicators and Strategies and have also created a custom performance metric. But most of my work is with Strategies, and do most of my development work (creating / editing) and debugging with Visual Studio 2017.

    The problem I face is with NT's management of the project files vis-a-vis Visual Studio. Here is what I am seeing on a regular basis:

    1. When I exclude a file from compilation in NT, it is not reflected in VS. Currently, I have excluded ALL my Strategy source files from NT. The only active ones are the NT system strategies. I restart NT, and everything shows correctly. Then I open VS from the NT Editor icon. In VS, all these files are all still shown active as part of the project. This includes both the "current" file and the "excluded" file prefixed with '@@'.

    2. If I 'Remove' one of the excluded files in NT and then go to VS, I see that NT has removed the excluded '@@' file, but the original is still in the project.

    3. I frequently get compilation errors on source files that have been excluded. When I right-click on the error message and select 'Exclude From Compilation', nothing happens, presumably because it is already excluded. When I select 'Open' from the right-click menu on the error message, NT opens the '@@' version of the file. If I open the grayed-out version from the editor explorer by right-clicking on it and selecting 'Open', it opens the one without the '@@'.

    4. Since the 'Remove' function is not removing the files, I decided to delete all the files I no longer need from the Windows file system using File Explorer. When I restart NT, the files come back!! Where is NT getting them from? Same thing happens with files that I just move to some other folder not in the My Documents/NingaTrader 8 set of folders.

    5. I exclude some source files for old Strategies I no longer want. I compile. If I open a Chart or Strategy Analyzer, those excluded Strategies will still appear the list of Strategies to choose from.

    There are other anomalies and quirks I experience, but I think the above covers the biggest ones

    In a previous posting I was advised not to compile or manage the project with VS and I am not doing that any more. Is it possible VS has corrupted something?

    Any suggestions?

    Thanks,

    Chaz

    #2
    Hi ChazJ,

    I've found that the best way to exclude files (if you want them excluded from both NT and VS) is to move them so they are not under the "Custom" folder.

    See my post Pro Tip: Get rid of VS Warnings! about creating your own Solution/Project so you have less interference from NT.

    Using your own project, you can also then add a props file that automatically excludes files that begin with "@@". This way, you wouldn't even have to move the files!

    HTH,
    Wil

    Comment


      #3
      If you use the new csproj format just place the following in the file:

      Code:
        <ItemGroup>
          <Compile Remove="**\@@*.*" />
        </ItemGroup>

      Comment


        #4
        Hello Chaz,

        Thanks for your question.

        wbennettjr's advice for removing files may be worth trying with Visual Studio. This should help with items 1 and 2.

        As for number 3, it sounds like there are both indicators that are excluded and indicators that are not excluded. I.E. there is a "@@IndicatorName.cs" and "IndicatorName.cs" file on the system. The NinjaScript Explorer is showing a gray menu item because of the excluded NinjaScript, but an indicator without the "@@" is also present. This would have the same symptoms when trying to exclude an indicator with errors in the Error grid.

        As you mention with number 4, this sounds like something is placing those files back. I would first look into syncing software on your system like OneDrive which may be trying to sync these files back into your bin/Custom folder. We recommend adding an exception to your Documents\NinjaTrader 8 folder for all syncing software so NinjaTrader to avoid these issues and issues with file access violations.

        Number 5 sounds like an issue similar to number 3. If there are script files that both have "@@" (excluded) and a script that has the same file name that is not preceded with "@@," the script will show in the NinjaScript Editor as excluded, but the file that is not preceded with "@@" will be compiled and available in the Strategies/Indicators dialog.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          Wil,

          Thanks for the info. I implemented the Pro Tip and it is working fine. I can now edit the source files without affecting the project files that NT uses.

          However, I am still seeing the above mentioned behaviors from NT. I just re-started NT and now it is still showing me compilation errors for source files that have been marked exclude from compilation. I tried deleting all old source files again, and they keep coming back!

          Somehow, NT is getting old files and overwriting what is in the Strategies folder.

          And still, strategies that are included in compilation seem to compile OK, but do not appear in the list of Strategies in a Chart.

          Comment


            #6
            Hi Jim,

            I will take a look at the syncing possibility, but it only seems to happen when I re-start NT. Knowing now that any source file should either have @@ or not, but not two files, I will also keep an eye out for that possibility and see how that comes to happen. Maybe syncing issue, too.

            I'll let you know what I find.

            Comment


              #7
              Jim,

              I have not seen removed Strategies return in a while. I think the confusion was being caused by having both an active (no @@) and inactive (with @@) versions of the same file in the Strategies folder.

              If I see anything beyond this I will advise.

              Thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by traderqz, Today, 12:06 AM
              3 responses
              6 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by RideMe, 04-07-2024, 04:54 PM
              5 responses
              28 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by f.saeidi, Today, 08:13 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by DavidHP, Today, 07:56 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by kujista, Today, 06:23 AM
              3 responses
              11 views
              0 likes
              Last Post kujista
              by kujista
               
              Working...
              X