Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Removed Indicators Remain on Chart

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

    Removed Indicators Remain on Chart

    Dear Support,

    I have removed a custom indicators from the indicator folders. It is no longer listed in bin/custom/indicators folder or the on the editor list. However, the removed indicator continue to remain on the chart and in drop down list of available indicators on the chart.

    Using Verion 8.0.16.3, re-installed NT, deleted _Workspaces file, and restarted NT, nothing seems to work. Checked trace and log folders, no errors or anything unusual.

    Any idea what is going on?

    Thanks.

    #2
    Hello aligator,

    Have you at this point Compiled from the NinjaScript editor? If you are doing manual changes, most often the platform will be unaware of those changes which will require you to compile an indicator to update the platform.

    If the custom item is something you have created yourself, you can also run into situations where you may have misnamed a file leading to the file still existing because it was not actually deleted. Is this something you have created? If so, another approach would be to search the file contents in windows explorer for the name of the indicator to see if that code exists in any other files or is duplicated.



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello aligator,

      Have you at this point Compiled from the NinjaScript editor? If you are doing manual changes, most often the platform will be unaware of those changes which will require you to compile an indicator to update the platform.

      If the custom item is something you have created yourself, you can also run into situations where you may have misnamed a file leading to the file still existing because it was not actually deleted. Is this something you have created? If so, another approach would be to search the file contents in windows explorer for the name of the indicator to see if that code exists in any other files or is duplicated.



      I look forward to being of further assistance.
      Thanks Jesse,

      I have removed the indicator from all ninja trader folders, including from the Templates folder. Compiling took care of indicator appearing on the chart available indicator list.

      Now, if I re-install the indicator and attach it to a chart, it attaches fine. But If I delete the indicator in the chart Configured list, the indicator remains on the chart.

      This is a custom indicator that I have used for a long time, and nothing has changed. The indicator installs as a toolbar in the chart main toolbar menu. The toolbar indicator remains in the main toolbar after it has been deleted from Configured list.

      This is the same as mahToolBar4 in Users Apps that is working fine.

      I suspect that my NT8 files may have been corrupted and perhaps need a fresh re-install of NT8.

      Thanks
      Click image for larger version

Name:	ToolBars Remains after Indicator Deleted.png
Views:	300
Size:	56.1 KB
ID:	1039118
      Last edited by aligator; 11-08-2018, 12:16 PM.

      Comment


        #4
        Hello aligator,

        Thank you for the reply.

        Regarding the indicator not removing from the chart, this is very likely due to the latest update. Most third-party toolbars which used unsupported means to add too the chart are now broken. The ChartTrader is now resizable which changed the overall design of the chart. Toolbars which do not account for that can cause quite a few problems related to resizing or can completely break the chart. The item not removing sounds like the termination logic in the script is not working correctly.

        Are you seeing any errors in the log upon removing the item? For this, you will very likely need to check if there is an update or contact the developer of the indicator for further assistance. If this is something you create we can review that together as well.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello aligator,

          Thank you for the reply.

          Regarding the indicator not removing from the chart, this is very likely due to the latest update. Most third-party toolbars which used unsupported means to add too the chart are now broken. The ChartTrader is now resizable which changed the overall design of the chart. Toolbars which do not account for that can cause quite a few problems related to resizing or can completely break the chart. The item not removing sounds like the termination logic in the script is not working correctly.

          Are you seeing any errors in the log upon removing the item? For this, you will very likely need to check if there is an update or contact the developer of the indicator for further assistance. If this is something you create we can review that together as well.

          I look forward to being of further assistance.
          Thanks so much Jesse.

          As I noted this is the Indicator mahToolBar4 posted in User Apps under "A Mahtoobar". You are correct and the indicator was working fine util I updated from 8.0.16.2 to 8.0.16.3.

          This is an indicator that I have developed myself with some help from yourself and other folks. The termination logic was working fine before until now, if that is the reason.

          I would appreciate if you could perhaps let me know what fixes are needed.

          Many thanks.

          Last edited by aligator; 11-08-2018, 04:51 PM.

          Comment


            #6
            Hello aligator,

            Thank you for the reply.

            I will need to research this further, I can see right away the problem is that the chartWindow object is null by using a print. I will need to see if there is a way to work around this now. Once I have more details on this I will reply back here.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Hello aligator,

              After further review, it appears you have created an error in your logic. I see that you are setting the chartWindow variable to null when it should not be reset to null at the end of your logic:

              Code:
                                  
              if (btnBarsWide != null)
              {
                       ChartControl.Dispatcher.InvokeAsync ((Action)(() =>
                       {
                               chartWindow.MainMenu.Remove(btnBarsWide);                        
                               btnBarsWide.Click -= btnBarsWide_Click;
                               btnBarsWide = null;
                        }));
              }
              
              chartWindow.MainTabControl.SelectionChanged -= MySelectionChangedHandler;
              
              
              [B]chartWindow = null; [/B]
              After removing this, the script seems to work for me and removes the tools.

              I am not certain why this would have allowed the Termination logic to work before the update as the chartWindow object would be null so the buttons would be unable to be removed. The chartWindow object needs to remain a valid object until Termination is called for the menu to be removed.


              Please let me know if I may be of additional assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Jesse View Post
                Hello aligator,

                After further review, it appears you have created an error in your logic. I see that you are setting the chartWindow variable to null when it should not be reset to null at the end of your logic:

                Code:
                if (btnBarsWide != null)
                {
                ChartControl.Dispatcher.InvokeAsync ((Action)(() =>
                {
                chartWindow.MainMenu.Remove(btnBarsWide);
                btnBarsWide.Click -= btnBarsWide_Click;
                btnBarsWide = null;
                }));
                }
                
                chartWindow.MainTabControl.SelectionChanged -= MySelectionChangedHandler;
                
                
                [B]chartWindow = null; [/B]
                After removing this, the script seems to work for me and removes the tools.

                I am not certain why this would have allowed the Termination logic to work before the update as the chartWindow object would be null so the buttons would be unable to be removed. The chartWindow object needs to remain a valid object until Termination is called for the menu to be removed.


                Please let me know if I may be of additional assistance.

                Thank you Jesse,

                Two question please:

                1. Were you able to remove the indicator from the chart before making this fix?

                2. Did you remove both of these code lines

                Code:
                chartWindow.MainTabControl.SelectionChanged -= MySelectionChangedHandler;
                
                  [B]chartWindow = null; [/B]
                or just this one line?

                Code:
                [B]chartWindow = null; [/B]
                I have no idea why several versions of the indicator were working fine with the CharwWindow = null;.

                For mahToolBar4, version 4 of the indicator, I only changed Dispatcher.Invoke() to ChartControl.Dispatcher.InvokeAsync() throughout the code as recommended for best practices. But the current issue started after I updated to 8.0.16.3.

                I will edit the code to confirm my NT installation has no issue.

                Many thanks.

                Comment


                  #9
                  Hello aligator,

                  Yes, I had seen it was removed after making that change. I only removed the one line where you are setting the object to null.

                  The problem is the structure of your code in Terminated. You are using many InvokeAsync statements and then set an object they all use to null before they run. When using InvokeAsync, that is not happening now but will happen when it can in the future so setting the chartWindow to null prevents the individual async events from working.

                  I would suggest that you remove the individual invokes you have used and group all of those commands into one event like the following:

                  Code:
                  else if (State == State.Terminated)
                  {
                      if (chartWindow != null)
                      {
                          ChartControl.Dispatcher.InvokeAsync((Action)(() =>
                          {
                              if (exampleButton != null)
                              {
                                  chartWindow.MainMenu.Remove(exampleButton);
                                  exampleButton = null;
                              }
                  
                              //below for toolbar button
                              if (btnRuler != null)
                              {
                                  chartWindow.MainMenu.Remove(btnRuler);
                                  btnRuler = null;
                              }
                  
                  
                  ......
                  
                              chartWindow.MainTabControl.SelectionChanged -= MySelectionChangedHandler;
                              chartWindow = null;
                          }));
                      }
                  }
                  This also allows you to set the object to null if you wanted because that is now inside of the overall single invoke statement.


                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by SantoshXX, Today, 03:09 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post SantoshXX  
                  Started by DanielTynera, Today, 01:14 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post DanielTynera  
                  Started by yertle, 04-18-2024, 08:38 AM
                  9 responses
                  41 views
                  0 likes
                  Last Post yertle
                  by yertle
                   
                  Started by techgetgame, Yesterday, 11:42 PM
                  0 responses
                  12 views
                  0 likes
                  Last Post techgetgame  
                  Started by sephichapdson, Yesterday, 11:36 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post sephichapdson  
                  Working...
                  X