Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator disappears after Remove All Draw Objects

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

    Indicator disappears after Remove All Draw Objects

    I've developed a tick based indicator that draws DrawText objects on the main price panel (1) and Lines andPlots in a panel (2). I also have another indicator - BuySellVolume in panel (3).

    When I select Remove All Draw Objects from the chart drawing tools combo, it deletes the entire indicator from panel 2 (including the name) and deletes the Drawtext objects from the main price panel 1. However, BuysellVolume in panel 3 is unaffected.

    Pressing F5 restores the deleted indicator.

    I suspect that I have left out a key command from my code that prevents some objects from being deleted.

    Any help would be much appreciated.

    Thanks.




    #2
    imported post

    Please check the logs. There likely are funny error message related to your indicator. This then would mean, that your indicator is disabled since it caused some problem.

    If that is the case I suggest commenting out suspicious code step by step and thus isolation the cause of trouble.
    DierkNinjaTrader Customer Service

    Comment


      #3
      imported post

      Yes, there is an error in the log and it is down to the DrawText method. Below is a test script that prints "ABC" at the close of the 10th latest bar and provides the error.

      The indicator works fine until clicking Remove All Draw Objects produces "Error on calling the 'OnBarUpdate' method for indicator 'TestDrawText' on bar nnnn. Cannot remove the specified item because it was not found in the specified collection."

      Any ideas? Have I missed anything?

      Code:
      protected override void Initialize()
      {
      AutoScale = true;
      CalculateOnBarClose = true;
      Overlay = true; 
      }
      
      protected override void OnBarUpdate()
      {
      if (Historical)
       return;
      
      DrawText("ABC", "ABC", 10, Close[10] , Color.Blue);
      }


      Comment


        #4
        imported post

        This is a bug which will be fixed with next update.

        Thanks for reporting that one.
        DierkNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by darylxarkley, Today, 12:54 PM
        0 responses
        1 view
        0 likes
        Last Post darylxarkley  
        Started by Taddypole, Today, 12:44 PM
        0 responses
        6 views
        0 likes
        Last Post Taddypole  
        Started by RebeccazDougal, Today, 12:03 PM
        0 responses
        5 views
        0 likes
        Last Post RebeccazDougal  
        Started by wehewwehd, Today, 11:10 AM
        0 responses
        4 views
        0 likes
        Last Post wehewwehd  
        Started by my-trade, Today, 10:45 AM
        0 responses
        9 views
        0 likes
        Last Post my-trade  
        Working...
        X