Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Code not working on NT8

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

    Code not working on NT8

    Hello,

    This piece of code worked perfectly on NT7:

    string fileName2 = @"T:\LogsNT8\MyFile.txt" ;
    FileInfo f_info2 = new FileInfo( fileName2 );

    if (f_info2.Exists)
    f_info2.Delete();


    Why not in NT8?

    #2
    Hello guillembm,

    Thanks for your post.

    Without further information about what is not working, such as error messages, I will speculate that you would need to add "using System.IO; " to the region "Using Directives" at the top of the file. Normally indicators/strategies do not include this library.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      I already included it.

      #region Using declarations
      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.ComponentModel.DataAnnotations;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Gui;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Gui.SuperDom;
      using NinjaTrader.Data;
      using NinjaTrader.NinjaScript;
      using NinjaTrader.Core.FloatingPoint;
      using NinjaTrader.NinjaScript.Indicators;
      using NinjaTrader.NinjaScript.DrawingTools;
      using System.Security.Cryptography;
      using System.IO;
      using System.Diagnostics;
      using System.Windows.Forms;
      #endregion

      DId you try to reproduce it?

      Comment


        #4
        Hello guillembm,

        Thanks for your reply.

        Can you clarify if you are getting compilation errors or run time errors or further identify what is not working here?
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          It's not a compilation error. Actually no errors appear. I just doesn't find the specified file.

          Comment


            #6
            Hello guillembm,

            Thanks for your reply.

            The code works fine on my end, of course I had to change the file path for my system.

            Can you test to be sure the file is in the expected location?

            Print (new FileInfo(@"T:\LogsNT8\MyFile.txt").Exists ? "File is there" : "File does not exist");
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              OK Thanks.

              I was executing the 32 bit version. After switching to 64 bit it works

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by pibrew, Today, 06:37 AM
              0 responses
              1 view
              0 likes
              Last Post pibrew
              by pibrew
               
              Started by rbeckmann05, Yesterday, 06:48 PM
              1 response
              14 views
              0 likes
              Last Post bltdavid  
              Started by llanqui, Today, 03:53 AM
              0 responses
              6 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              11 views
              0 likes
              Last Post burtoninlondon  
              Started by AaronKoRn, Yesterday, 09:49 PM
              0 responses
              16 views
              0 likes
              Last Post AaronKoRn  
              Working...
              X