Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Restoring Indicator.IsViisble in State.Terminated looses PanelIndex setting [Bug?]

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

    Restoring Indicator.IsViisble in State.Terminated looses PanelIndex setting [Bug?]

    Hello

    Developing an indicator which adds buttons to the tool bar which toggles all Indicator visibility.
    In my Dispose() method I loop through all indicators.IsVisible = true; to restore all indicators visibility upon my own being removed from the chart.

    1)
    Toggling visibility works as expected. Until removing my indicator while indicators remain hidden on the chart. It LOOKs like the PanelIndex position gets ignored as the Indicator is next rendered on the price panel? The ControlPanel PanelIndex was showing a count of 2 during State.Terminated though?

    Click image for larger version  Name:	PanelIndexVisibilityLostGIFF.gif Views:	26 Size:	351.4 KB ID:	1121579

    2)
    When the volume indicator visibility is set to false. My understanding from posts the forum is the chart is intended to treat the Indicator as if "removed" and the expected behaviour is the Price Panel expand to fill the whole window? Which it does not?

    I have attached my indicator. You can see in the method restoreIndicatorsVisabiility() I am only setting IsVisible to true.

    Is this a bug? Or am I doing this in the wrong place?

    Thanks
    Last edited by SmartArtsStudio; 10-13-2020, 07:35 AM.

    #2
    Hello SmartArtsStudio,

    Thanks for your post.

    Ill behavior when programmatically setting IsVisible on indicators which add panels has been reported previously and the conclusion was that this is not something we can currently support. Panel addition/removal is determined when an indicator is added/removed from a chart and is not dependent on the IsVisible property. We can see the panel spacing still exists when setting IsVisble to false on an indicator that owns a panel, and when we remove an indicator after programmatically modifying the visibility of an indicator, the indicator comes back in an unexpected panel.

    We have a change request tracking interest behind allowing panels to be removed when programmatically setting the indicator's IsVisible to false. The ticket ID is SFT-4011 and I have added a vote on your behalf. This is an internal number, but for anyone else wishing to have their interest tracked, please let our support staff know that you would like a vote added for this request.

    I have also submitted a change request for the Help Guide to add a note regarding this behavior.

    Feature/Change Request Disclaimer

    We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

    When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.


    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim

      So that covers the Panel management based on the IsVisible property which was Question 2

      Question 1
      Is separate issue as to why toggling visibility works just fine hiding and showing Indicators exactly where their PanelIndex dictates in State.Historical and State.Realtime. But produces unexpected behaviour in specifically in State.Terminated. The Indicator's PanelIndex gets ignored and it gets rendered to the Price Panel (PanelIndex == 1) when it had its own panel (PanelIndex == 2) prior to entering State.Terminated.

      This seems to me to be a bug?

      Or is there another reliable 'disposal/cleanup' method I am suppose to be using where My Indicator can predictably make all indicators visible in their assigned position just as it does when in State.Historical or State.Realtime. Before it removes itself without leaving a corrupting the chart?

      Thanks


      Comment


        #4
        Hello SmartArtsStudio,

        We should not try to set IsVisible programmatically for indicators which reside in additional panels (panels other a price panel.) This falls under the same limitation that panel management is done when indicators are added/removed as opposed to when IsVisible is modified. Why it works or why it doesn't won't mean much, NinjaTrader was simply not designed to handle that case.

        We would not see issues for an indicator added to a price panel, but attempting to hide an indicator that is added to another panel by changing the IsVisible property will lead to unexpected behavior. When I test, I do not have issue with indicators that are assigned to a price panel. I only see issue with indicators added to additional panels.

        If NinjaTrader would check how panels should be set up after the IsVisible property is changed on an indicator (that resides in a new a panel or not) then we would not hit these issues.

        If there is a way to reproduce an issue like this without programmatically setting the indicator's IsVisible property, we could look into it as a bug, but we should rule out programmatically setting IsVisible.

        Let us know if there is anything else we can do to help.
        Last edited by NinjaTrader_Jim; 10-07-2020, 12:56 PM.
        JimNinjaTrader Customer Service

        Comment


          #5
          AH, got it!

          Still odd why State.Terminated behaves any different to the others since 'Dispose' methods usually get executed before anything actually starts getting state changed or disposed of for this reason.

          Thanks for the clarification, its appreciated.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by esmall, Today, 07:14 PM
          0 responses
          2 views
          0 likes
          Last Post esmall
          by esmall
           
          Started by Option Whisperer, 05-09-2024, 07:58 PM
          6 responses
          26 views
          0 likes
          Last Post Option Whisperer  
          Started by rayyyu12, Today, 05:38 PM
          0 responses
          12 views
          0 likes
          Last Post rayyyu12  
          Started by xepher101, Yesterday, 12:19 PM
          2 responses
          30 views
          0 likes
          Last Post xepher101  
          Started by thumper57, Today, 04:30 PM
          0 responses
          8 views
          0 likes
          Last Post thumper57  
          Working...
          X