• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rendering each ChartPanel independently

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

    Rendering each ChartPanel independently

    I have a main indicator that collects data. Then I have several instances of another secondary indicator that renders a very complex and heavy drawing from the main indicator data. In total in the chartcontrol there is a main indicator and seven or eight instances of the secondary indicator (each with its own rendering according to its parameters).
    Some instances of the secondary indicator respond to the MouseMove event of the main indicator and must update their rendering. But other instances are fixed and should not be updated with the movement of the mouse on the main panel, thus saving me its rendering. My question is: is it possible to isolate the rendering of the ChartPanel from each of the secondary indicators ?
    The ForceRefresh () method does not work for me because it affects the entire chartcontrol and not just the Panel of the indicator that calls the method.
    I would greatly appreciate any hints or help.
    Last edited by cls71; 11-17-2019, 12:33 PM.

    #2
    Hello cls71,

    From my understanding, the ChartControl is one RenderTarget and the panels are clipped to their parameters.

    Add multiple panels and use this test indicator to get the price and time on the other panel to see what I mean.
    https://ninjatrader.com/support/foru...624#post792624

    Each indicator really only references one panel and not multiple panels. For multiple panels it would be recommended to have multiple instances of the indicator added to each panel.

    If there are mouse events, have one indicator instance per panel. On click, ensure its within the bounds of the indicator panel. Have fewer event handlers and fewer objects created per instance if possible.

    https://ninjatrader.com/support/foru...606#post789606
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks ChelseaB,

      but my problem is with isolating the renderings of each ChartPanel. ChartControl.InvalidateVisual() or ForceRefresh() render all ChartPanels.
      I am searching something like ChartPanel.InvalidateVisual and only render (code inside the OnRender) for that particular ChartPanel.
      But ChartPanel.InvalidateVisual() does not work for that purpose.

      Perhaps, one solution could be to add a Canvas (overwriting its OnRender() method with custom code) to the UserControlCollection of the indicator and call the Canvas.InvalidateVisual() when you need to render the ChartPanel of a specific instance of the indicator. (I tried calling the indicator's OnRender() method directly, but it doesn't work.). I will investigate it.

      I'm sorry not to explain myself better

      Comment


        #4
        Hello cls71,

        Unfortunately, the chart does not work this way. It is not possible to invalidate only some parts of a render target. Either the whole render target is invalidated or it is not.

        I think you are requesting for charts to have multiple rendering targets for each panel. This would use more resources and require more complex rendering code in NinjaScripts but would allow only one of the rendering targets to be invalidated.

        Is this what you are asking?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello ChelseaB,

          yes, that is.

          The only thing I think can achieve something similar is to add a Canvas in the UserControlCollection of the indicator, and call the Canvas.InvalidateVisual for only the indicator that requires it.

          Thanks

          Comment


            #6
            Hello cls71,

            This request is being tracked with ID# SFT-4388..

            As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

            Release Notes — https://ninjatrader.com/support/help...ease_notes.htm
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by deltaZ, Today, 03:10 PM
            0 responses
            2 views
            0 likes
            Last Post deltaZ
            by deltaZ
             
            Started by escobar63, Today, 02:47 PM
            2 responses
            3 views
            0 likes
            Last Post escobar63  
            Started by faisamtrader, Today, 10:31 AM
            1 response
            16 views
            0 likes
            Last Post NinjaTrader_Tyler  
            Started by ChazJ, Today, 09:48 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by maxie, Today, 10:01 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Melissa  
            Working...
            X