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

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
    Kate W.NinjaTrader Customer Service

    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...​​
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Thank you!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rocketman7, Today, 02:12 AM
              5 responses
              21 views
              0 likes
              Last Post rocketman7  
              Started by trilliantrader, 04-18-2024, 08:16 AM
              7 responses
              27 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by samish18, 04-17-2024, 08:57 AM
              17 responses
              65 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by briansaul, Today, 05:31 AM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by PaulMohn, Today, 03:49 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X