Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can an Indicator in a different Panel draw with SharpDX on the Security Panel?

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

    Can an Indicator in a different Panel draw with SharpDX on the Security Panel?

    Description

    I have an indicator that is giving me puzzling results - I hope someone out there can tell me why.

    My indicator starts up "in the security panel", as an Overlay indicator.
    It does a few things, including:
    1) changes bar coloring,
    2) uses Draw.AAA methods to draw simple shapes near bars
    3) uses SharpDX methods to draw complex shapes near bars

    (2 and 3 happen during OnRender()).

    The indicator has an optional additional behavior that the user can control through a checkbox (implemented via a "Browseable" public boolean property in my indicator). When the user checks off that box (and clicks Apply), my application effectively shifts out of the "security panel" and into its own panel. (I explain how, here: https://forum.ninjatrader.com/forum/...22#post1247622 ).

    This works fine EXCEPT: when the indicator moves to a separate (new) panel, created by the NT8 framework, then the following happens:

    1) changed bar coloring, stays as I changed it
    2) simple shapes drawn using Draw.AAA methods, stay drawn
    3) complex shapes drawn using SharpDX methods - these disappear.

    It's weirder. OnBarUpdate() and OnRender() are called for my indicator and, when it is in the separate panel, It takes the actions to implement (1), (2) and (3), and, in essence, the SharpDX actions are ignored - I make the calls and nothing appears.

    So really, I'm discovering that when my Indicator is outside the security panel, I can change the Security coloring, and I can draw with Draw.AAA but I fail to draw with SharpDX.

    When the user brings up configuration and unchecks the feature, and my Indicator goes back into the "security panel", low and behold the shapes drawn using SharpDX are permitted to appear.

    Questions:

    Q1. Is there some rule that says a non-overlay indicator (one "living" in a panel other than the security) may not draw SharpDX objects in the security panel?

    Q2. Is there some parameter I need to specify to stipulate that "this shape SHOULD BE IN THE SECURITY PANEL" like in some of the Draw.AAA calls?



    #2
    There is a clipping context, and you would have to change the clipping context to be the larger context of the whole chart window, do your drawing, and then put it back. This would be unsupported, but is possible.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      You might want to look at this https://ninjatraderecosystem.com/use...-drawing-tool/ which pops out of the clipping rectangle context and then gets back in. It's unsupported, and unsupportable, but on your own, you can try it.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #4
        Hello dween,

        It is only supported for an indicator to render in the panel the indicator is added to. Rendering outside of the panel is not supported.

        This means if you need to render in multiple panels, you will need to add an instance of the indicator for each panel.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by QuantKey_Bruce View Post
          You might want to look at this ...
          QuantKey_Bruce Thank you for this idea. Unsupported/unsupportable - when I'm looking for a tech to solve a problem, I want people to offer what they've got, wild, unsupported or whatever. I might return to it.

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello dween,

            It is only supported for an indicator to render in the panel the indicator is added to. Rendering outside of the panel is not supported.

            This means if you need to render in multiple panels, you will need to add an instance of the indicator for each panel.
            NinjaTrader_ChelseaB I'm so glad you noticed my post. I've read your posts in the past and I've found them useful. I hope I'm lobbing you an easy one here...

            I want to have an Indicator in an independent panel, which can draw text and either a Polygon or Path, or else at least an Image, tied to a Bar, on the Price panel (1).

            I know that
            Code:
            Draw.Dot()
            has a
            Code:
            bool drawOnPricePanel
            parameter - I use it to do exactly this, now.

            I see that
            Code:
            Draw.Square()
            has it too - but
            Code:
            Draw.Text()
            doesn't - neither does
            Code:
            Draw.Polygon()
            I see there 5 different ways to call Draw.Text() and 8 different ways to call Draw.Polygon() - Is there by any chance another
            Code:
            Draw.Text()
            call that is supported, that includes this parameter, that just accidentally got left out of the documentation?

            Or is there another way I can use Common.Drawing to draw Text on the Price panel, from another panel?

            Comment


              #7
              Hm. Could I use a Brush based on an Image to draw a Rectangle - and effectively draw an Image - on the price panel?

              Comment


                #8
                See also: https://forum.ninjatrader.com/forum/...ter#post760598
                Bruce DeVault
                QuantKey Trading Vendor Services
                NinjaTrader Ecosystem Vendor - QuantKey

                Comment


                  #9
                  Hello dween,

                  The Draw.Text() method does not have an overload for DrawOnPricePanel.

                  There is a DrawOnPricePanel property for the indicator, which will control if all drawing objects, including text, is drawn on the price panel.


                  I am also happy to request an overload be added to Draw.Text() for DrawOnPricePanel.

                  An image would require custom rendering in OnRender(), which can only be on the indicator panel.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_ChelseaB View Post
                    I am also happy to request an overload be added to Draw.Text() for DrawOnPricePanel.
                    NinjaTrader_ChelseaB It was requested, during the NT8 beta period, in 2016 - SFT-962. And I have asked about it since then myself as well. Do these requests go straight into the shredder?

                    It looks like I last followed up about this in 2021, and then I gave up because I never got any answer. I've been seeing a need for this for seven years now and have made several inquiries in addition to the forum thread from the beta period.
                    Last edited by QuantKey_Bruce; 04-24-2023, 01:55 PM.
                    Bruce DeVault
                    QuantKey Trading Vendor Services
                    NinjaTrader Ecosystem Vendor - QuantKey

                    Comment


                      #11
                      Hello Bruce,

                      There is a massive massive amount of feature requests. Not all will be implemented, but the ones with the highest request counts tend to be more often reviewed.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        It sounds like there isn't much hope - we have no way of knowing the request counts or even what's been requested.
                        Bruce DeVault
                        QuantKey Trading Vendor Services
                        NinjaTrader Ecosystem Vendor - QuantKey

                        Comment


                          #13
                          Hello Bruce,

                          It does come down the amount of demand and decision of the product development team.

                          Unfortunately, we cannot provide the count or list of feature requests, which is also a decision of the product management team, but this has also been requested and is be tracked. (Not that that is helpful information)
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Okay, please add my vote to the invisible SFT-962.
                            Bruce DeVault
                            QuantKey Trading Vendor Services
                            NinjaTrader Ecosystem Vendor - QuantKey

                            Comment


                              #15
                              Hello Bruce,

                              Vote added. I've added one for dween as well.
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              649 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              370 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              109 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              574 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              576 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X