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

"File does not exist." using StreamReader

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

    "File does not exist." using StreamReader

    Can anyone help me with this one? When my Ninja is up and running with the Output window open, I get a constant stream of:

    File does not exist.
    File does not exist.
    File does not exist.
    File does not exist.
    File does not exist.

    I have no charts open. The Control Center, "Strategies" tab has no strategies listed. A new line "File does not exist." appears every few minutes. I am completely baffled.

    I am running my Ninja in simulation only for development. The last thing I did, was work on a strategy that reads a text file by the StreamReader.

    The input file DOES exist and so does the correct path. However, this should not matter in view of the above.

    I also removed the strategy (.cs) file from the strategy folder, and rebooted my computer with fresh Ninja running. The problem persists.

    Thank you for anyone who may be able to help.

    #2
    It sounds like there is a script that is attempting to read from a file from the Initialize() method.

    Initialize() is called not only when starting/adding a script but also when you open up the indicator or strategy window.

    You can look through your custom scripts by going to tools -> edit NinjaScript -> indicator/strategy -> any of them without the Lock symbol are not system indicators and might be the cause.

    Also if after removing the strategy you have not re-compiled please do this as you may have removed the right strategy but have not yet re-compiled. (open up any indicator or strategy and press F5)

    Let me know if I can further assist.
    LanceNinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_Lance, in my case, there is ONLY one custom .cs file. I have checked it and it does not have anything offending in the Initialize() section. To be sure, I have temporarily deleted it. The only files that are in my Strategy folder (C:~~\Documents\NinjaTrader 7\bin\Custom\Strategy) are as follows:

      @SampleAtmStrategy.cs
      @SampleMACrossOver.cs
      @SampleMultiInstrument.cs
      @SampleMultiTimeFrame.cs
      @Strategy.cs
      UserDefinedMethods.cs

      These all come with Ninja. I have recompiled the last one. The problem continues.

      Comment


        #4
        How about custom indicators?

        Does the message appear in the output window constantly or only when you open up an indicator/strategy window?
        LanceNinjaTrader Customer Service

        Comment


          #5
          Hi Lance, we have no custom indicators. The message appears in the Output window roughly every few minutes. My partner cannot figure it out either.

          Comment


            #6
            As a test, please take the following steps to force NinjaTrader to start without your saved workspace. You will have the option to reopen these after our tests.


            * Shut down NinjaTrader
            * Navigate to (My) Documents\NinjaTrader 7\workspaces
            * Delete the file named "_Workspaces.XML".
            * After deleting this file, restart NinjaTrader which should startup without any workspaces.
            * Once NinjaTrader has started on just the control center, please open a new chart and test for issue.
            * *Please note this will not delete your workspace however the new blank workspace will be named Untitled1. If you have a workspace already named Untitled1 however you will not want to save the workspace when exiting NinjaTrader, otherwise it will overwrite it.


            If there are no issues on this new workspace, please try opening the previous workspace by going to File--> Workspaces--> Open workspace.

            If this reintroduces issues, I would suggest rebuilding your workspace. Please keep track of what indicators you add back in so that we can narrow down what indicator is causing the issue if the issue returns. I also suggest making a backup of your workspace so we can restore a backup if the issue returns.

            Below I have provided a link to the Backup and Restore section of our help guide.
            LanceNinjaTrader Customer Service

            Comment


              #7
              Hi Lance, yes, by deleting the workspace as outlined in your recommendation, it does fix the issue with a new chart (no indicators added).

              Now I have to start adding on to see where it is broken.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by TradeForge, 04-19-2024, 02:09 AM
              2 responses
              28 views
              0 likes
              Last Post TradeForge  
              Started by aprilfool, 12-03-2022, 03:01 PM
              3 responses
              327 views
              0 likes
              Last Post NinjaTrader_Adrian  
              Started by giulyko00, Today, 12:03 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by f.saeidi, Today, 12:14 PM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by AnnBarnes, Today, 12:17 PM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_Zachary  
              Working...
              X