Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja locking itself

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

    Ninja locking itself

    Hi Guys

    I have discovered that the "AddBars" in a script for certain instruments causes Ninja to lock itself (Ninja + IQFeed). This is with the newest release of Ninja7.

    Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.


    In the above video, you can see:

    1 - Top left - Process Explorer search that shows who is locking the file "201602191700.Last.ntd" - as you can see Ninja and only Ninja has a handle on that file. This means that no other process (such as AV/search indexer) is locking the file

    2 - I then add the indicator "TestFileLock" to YM 03-16

    3 - We see the message in the log : IQFeed.Adapter.MessageLoopBars msg='!ENDMSG!,': The process cannot access the file 'G:\Documents\NinjaTrader 7\db\tick\YM 03-16\201602191700.Last.ntd' because it is being used by another process.

    4 - I refresh Process Explorer and still only Ninja has a file lock on the file.

    5 - Ninja is now dead. I cannot close the indicator window (but can move it) and all other windows are unresponsive.

    Now - I do understand that when you see this issue, it is mostly because some 3rd party app is locking the file. That is not the case here, I can run this over and over again, checking that no app has a handle on the file before I add the indicator and then again after. In all cases, only Ninja has the lock.

    It is safe to conclude that Ninja has locked itself out.

    This happens with YM and I heard from customers it occurs on other instruments like TF.

    In my testing it does not occur in ES, ZB, ZC, Bund, Dax, ZN, ZF. CL

    As for the indicator I placed on the chart, it is "TestFileLock.cs". It is a copy of the EMA.cs

    The only difference between the EMA.cs and this version is the Initialize section:

    Code:
    		protected override void Initialize()
    		{
    			Add(new Plot(Color.Orange, "TestFileLock"));
    
    			Overlay				= true;
    			Print(Instrument.FullName + " Adding 1 tick bars");
    			try
    			{
    				Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Last);
    			}
    			catch (Exception e)
    			{
    				Print(e.ToString());
    			}
    			
    			Print(Instrument.FullName + " After Adding 1 tick bars");
    		}
    Attached Files
    Last edited by DionysusToast; 02-21-2016, 11:59 AM.

    #2
    Hello DionysusToast,

    How many days of historical data is loading on your chart?

    I've created an indicator that adds a secondary series without the try and ask.
    1. Please import this AddSecondarySeriesTest script into NinjaTrader
    2. Then Close NinjaTrader to delete and re-download the historical data
    3. Open (My) Documents/NinjaTrader 7\db\cache\
    4. Delete all files within this folder
    5. Go up one directory to the \db\ folder
    6. Repeat this procedure for the tick, minute, and day folders as well to delete your downloaded historical data
    7. Restart NinjaTrader
    8. Connect
    9. Then open the Output window. Tools -> Output Window...
    10. Last, add the indicator to a YM 03-16 chart with 1 day set in the Days to load field. (For the test it is important you reduce the days to load to 1 day)


    Last, please let me know if the indicator does not load. If the indicator does load the output for each bar will appear in the output window. Please send me the output from the output window.
    Attached Files
    Last edited by NinjaTrader_ChelseaB; 02-22-2016, 08:54 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea

      Thanks for the reply.

      I can confirm that both indicators (yours and mine) work if you set the lookback period on the chart to 1 day.

      In fact, once I'd followed your steps - I had no issues with my indicator.

      I'd deleted the files a number of times before but no luck - somehow looking back 1 day seemed to clear it.

      Still - I do have some customers encountering this issue, I'm not sure what to tell them.

      Any thoughts?

      Cheers

      Pete

      Comment


        #4
        Hi Pete,

        I did not receive an answer about how many days you were loading.

        The more tick data that has to load the longer it will take to load the chart / indicator.

        For example I would expect that 10 days of tick data downloading would cause a delay of about 30 seconds to 1 minute on a decent computer with decent internet connection to the data feed. 365 days of tick data could take quite a long time.

        IQFeed / Kinetick provide 8 days of data during the day 180 days of data after hours. But NinjaTrader will still load any historical tick data that was previously downloaded no matter how much this will be.

        As the data is loaded the chart will be locked and the historical data files will be locked.

        With 10 days of data are you still finding that the chart / indicator doesn't work? Does the version I provided work with 10 days of historical data?

        I ask because I want to know if you are loading a large amount of tick data which would take a while to load.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Chelsea

          I was downloading 3 days worth of data.

          Thing is, this wasn't slow, it was locked. It said "file used by another process".

          Cheers

          Pete

          Comment


            #6
            Hello Pete,

            This may indicate that a 3rd party program is scanning the historical data for changes and locking the files.

            Do you have any antivirus or backup software installed?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello Pete,

              This may indicate that a 3rd party program is scanning the historical data for changes and locking the files.

              Do you have any antivirus or backup software installed?
              If you look at my first post - I have included a video that shows that Ninja is locking itself.

              I am showing the file handles, only Ninja has a handle on the file.

              This is not a case where a 3rd party program is locking the file.

              Comment


                #8
                Hello Pete,

                We'll need to look into this further on your end. Please send an email to platformsupport [at] ninjatrader [dot] com. In the email include a link to this forum thread.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by WHICKED, Today, 02:02 PM
                2 responses
                5 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by selu72, Today, 02:01 PM
                0 responses
                3 views
                0 likes
                Last Post selu72
                by selu72
                 
                Started by f.saeidi, Today, 12:14 PM
                8 responses
                21 views
                0 likes
                Last Post f.saeidi  
                Started by Mikey_, 03-23-2024, 05:59 PM
                3 responses
                50 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by Russ Moreland, Today, 12:54 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Erick  
                Working...
                X