Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data box stops working on Workspace Save and Change

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

    Data box stops working on Workspace Save and Change

    Hey fellas -

    I found a bug.

    The Data Box seems to get confused when you are saving and then changing Workspaces. It blanks out and becomes non-functional. When you remove it and try to add it back, the 'Show Data Box' button is constantly checked. You have to restart NJT 8 to get it working again.

    Steps to duplicate:
    1. In your current Workspace ('Workspace 1), add the Data Box if it's not already there. Always on top is not checked. Verify that it's working.
    2. In the Control Center, Workspaces | Save As on your current workspace and choose another name 'Workspace DataBox' and Save.
    3. Go back to your Chart and notice the DataBox is no longer working as its values are frozen.
    4. Close it and right click to click on 'Show Data Box'. It's working again.
    5. Now go back to your Control Center, Workspaces and change back to your original Workspace 1.
    6. The Data Box is blank. If you close it and right click on the chart, the 'Show Data Box' is checked and cannot be unchecked.
    Last edited by PN720; 12-01-2017, 07:05 PM.

    #2
    Hello,

    Thank you for the post.

    I have reproduced this on the current build. Thank you for the input.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      So, I'm still hitting the issue of the databox not working. In general, the databox seems to get into a mode where it no longer seems to read the cursor location on the screen, the databox values just become stuck to the last bar that happened to work.

      I usually get this when I'm developing custom indicators, however, that is what I spend the majority of my time doing in Ninja. I'd say I get into this state a few times a week.

      To fix it, I have to re-start Ninja.

      I've been hitting this issue for years now, just never bothered reporting, I've seen other posts report it, and up until now, I had nothing to add.

      Currently running 8.23.1, 64 bit.

      So I was hitting this issue today, after "waking up" my laptop. It went to "sleep" when I closed the lid, with Ninja running. After the laptop woke up, I did not restart Ninja.

      I happened to be developing an indicator when the databox issue popped up.

      The code has a try-catch block for the entire function.

      My function is triggered from a mouse click, I'll just post the whole thing, but I'm not going to re-ident:

      ```
      private void ChartControl_ContextMenuOpening(object sender, ContextMenuEventArgs e)
      {
      try
      {
      Print(e.CursorLeft);
      ChartControl chartControl = sender as ChartControl;
      if (chartControl == null)
      {
      Print("NUll");
      return;
      }
      if (!chartControl.ChartObjects.Any(o => o.IsSelected))
      {
      Print("No selection");
      return;
      }

      Type selected = chartControl.ChartObjects.First(t => t.IsSelected).GetType();

      int test44 = ChartingExtensions.ConvertToHorizontalPixels(e.Cur sorLeft, ChartControl.PresentationSource);
      //clickPoint.Y = ChartingExtensions.ConvertToVerticalPixels(e.GetPo sition(ChartControl as IInputElement).Y, ChartControl.PresentationSource);

      int clickbar = ChartBars.GetBarIdxByX(chartControl, test44);
      Print(Bars.GetTime(clickbar));
      Print(string.Format("Clicked Bar: {0}", clickbar));
      Print(string.Format("Session: {0}", barSessionCount.GetValueAt(clickbar)));
      Print(string.Format("Number of Sessions: {0}", sessionCloseValues.Count));

      clickSessionIdx = barSessionCount.GetValueAt(clickbar);
      clickSessionEnd = Bars.GetTime(clickbar);



      //int slotIdx = chartControl.GetSlotIndexByX(Convert.ToInt32(e.Cur sorLeft));

      //Print(Bars.GetTime(slotIdx));


      chartControl.Dispatcher.InvokeAsync(new Action(() =>
      {
      if (chartControl.ContextMenu != null) chartControl.ContextMenu.Items.Add(addGlobalLinesM enuItem);
      }));
      }
      catch (Exception ex)
      {
      Print("CM Excpt:");
      Print(ex.StackTrace);
      //throw;
      }
      }
      ```

      So, when I right-clicked on the chart to bring up the context menu, I would make it into the function above. I know because of my Prints I had in the function(now removed)

      However, I would get an exception before my function completed.

      My catch did not catch the exception, and the entire indicator would crash. F5 would revive it, but even after the crash, f5 revive, right clicking again would produce the same error.

      the Error log showed: "unhandled exception object reference not set to an instance of an object"

      I believe the source of the crash was this line:
      int test44 = ChartingExtensions.ConvertToHorizontalPixels(e.Cur sorLeft, ChartControl.PresentationSource);

      Perhaps that little clue helps if this issue is still being worked.



      Comment


        #4
        Hello michelm,

        Thank you very much for bringing this to our attention!

        We recently released a new NinjaTrader version (8.0.24.2).

        While this version includes several updates, I am only aware of one that could affect this behavior.

        I would still suggest updating the platform at your earliest convenience, to see if you can recreate this behavior in the newest version.

        On a different note; we generally advise against using Standby/Hibernation modes with NinjaTrader, as this could cause some data to not be saved correctly. Shutting NinjaTrader down prior to triggering Standby or Hibernation will ensure all data is saved and all connections disconnected.

        Does this issue generally occur after a Standby or Hibernation event, or has it also occurred without this, e.g. during regular development?

        I look forward to your reply!
        Manfred F.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          I'm not 100% sure if it happens with a running instance of NT that has not been in Standby/Hibernation at some point in its life.

          However, I can say that it regularly goes from Databox Working to Databox Not working with no intervening Standby/Hibernation between the working and not working state.

          I'll upgrade, and post here if it happens again.

          To, me it does seem like the databox not working and my call to ChartingExtensions.ConvertToHorizontalPixels(e.Cur sorLeft, ChartControl.PresentationSource); are related.

          I don't think I stated this explicitly, but after the NT shutdown restart, my indicator started working again with no code changes, along with the data box.

          Last edited by michelm; 04-03-2021, 07:33 AM.

          Comment


            #6
            Hello michelm,

            Thank you very much for your reply.

            As I was not able to recreate this yet, I suspect it might have to do something with either the Standby/Hibernation or a custom script I don't have installed.

            Should you be able to track down any specific steps that cause this error (or even just make it likely to occur), please let me know!
            Manfred F.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by alifarahani, Today, 09:40 AM
            4 responses
            19 views
            0 likes
            Last Post alifarahani  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            16 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by PhillT, Today, 02:16 PM
            2 responses
            7 views
            0 likes
            Last Post PhillT
            by PhillT
             
            Started by Kaledus, Today, 01:29 PM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by frankthearm, Yesterday, 09:08 AM
            14 responses
            47 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Working...
            X