Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Disable indicator selection by clicking on custom rendered objects.

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

    Disable indicator selection by clicking on custom rendered objects.

    Hello.
    I am creating an indicator with the wide areas filled by colors (sessions) via method only.
    And I found that clicking on the filled area



    initiates indicator selection (and prevents scrolling, for example).
    While clicks inside non-filled area don't select indicator (please, see the video: ​​​​​​ ​https://www.screencast.com/t/1UD3sexJG)

    The question: How to disable indicator selection by clicking on custom rendered objects?
    Is there another way, then uncheck "Allow the selection of drag/drop of chart series
    "
    Last edited by NinjaTrader_Jim; 06-19-2019, 06:29 AM. Reason: Fix Screencast link
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Thank you for your post.

    If you would like to prevent plots from being selectable, you could force the indicator rendering to only happen without hit testing passes.

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
        if(!IsInHitTest)                                                    // Use IsInHitTest to avoid rendering for hit test passes
            base.OnRender(chartControl, chartScale);                        // Call base OnRender() method to paint defined Plots.
    }
    Here are links to our help guide that go into more detail regarding OnRender() and IsInHitTest:

    OnRender() - https://ninjatrader.com/support/help...s/onrender.htm

    IsInHitTest - https://ninjatrader.com/support/help...sinhittest.htm

    Please let me know if I can be of further assistance.
    Last edited by NinjaTrader_Kate; 06-19-2019, 10:16 AM. Reason: code formatting

    Comment


      #3
      Many thanks, Kate
      It works perfect!
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hi!
        Both of the links from NinjaTrader_Kate​ are now broken.
        Are there new links to this now?
        thankx

        Comment


          #5
          MisterTee, just sear​ch in the official NT8 manual: https://ninjatrader.com/support/help...l?log_tab2.htm

          OnRender() - https://ninjatrader.com/support/help...htsub=OnRender

          IsInHitTest - https://ninjatrader.com/support/help...ub=IsInHitTest
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Hello MisterTee,

            Thanks for your notes.

            You could search the NinjaTrader 8 help guide for those words as fx.practic mentioned.

            I have also added links to those help guide pages below.

            OnRender(): https://ninjatrader.com/support/help...l?onrender.htm
            IsInHitTest: https://ninjatrader.com/support/help...​​
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment


              #7
              Thank you!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              601 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              347 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              559 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              558 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X