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

Ho to prevent default drag event for chart for my Indicator?

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

    Ho to prevent default drag event for chart for my Indicator?

    I add my mouse click and mouse move events and I want to prevent default chart move, i.e. I want to stop move the chart and move only my rendered objects, like it is in Drawing Tools Is it possible?
    Last edited by handlar; 12-03-2018, 02:46 PM.
    Handlar
    NinjaTrader Ecosystem Vendor - Handlar

    #2
    Hello Handlar,

    This would be outside of what is supported by NinjaTrader support for an indicator.

    Could the indicator instead call Draw methods for custom drawing objects so those objects can be selectable and draggable?

    By default, objects that can be rendered when IsInHitTest is true cannot be clicked through and prevent the chart from being clicked on or scrolled. But this would not cause the object to be draggable.
    https://ninjatrader.com/support/help...sinhittest.htm

    If the rendered object is only rendered when IsInHitTest is false, that object can be clicked through and the chart can scroll.

    As an example, in the linked ReuseDxBrushesExample try commenting out line 124, compile, and then load the script on a chart.
    Last edited by NinjaTrader_ChelseaB; 12-02-2018, 09:45 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Draw methods have performance issues...

      from NinjaScripts best practices:

      Using DrawObjects vs custom graphics in OnRender()


      When using Draw methods, a new instance of the Draw object is created including its custom rendering and calculation logic. These methods are convenient in many situations, but can quickly introduce performance issues if used too liberally. In some situations, you may see better performance for rendering via SharpDX in OnRender().


      "But this would not cause the object to be draggable" draggable logic is ready for my Volume Profile and the only problem is chart stil move with my Volume Profile. Thanks for IsInHitTest. I'll try It
      Last edited by handlar; 12-02-2018, 10:57 PM.
      Handlar
      NinjaTrader Ecosystem Vendor - Handlar

      Comment


        #4
        Is there a way to programmatically move the chart?
        For example, to set the needed value to the first drawn bar?
        I know that the ChartControl.FirstTimePainted property is read only, unfortunatelly ((
        Handlar
        NinjaTrader Ecosystem Vendor - Handlar

        Comment


          #5
          Hello handlar,

          There are no supported ways to adjust the time or price axis through NinjaScript.

          I will forward a feature request on your behalf for the development team to consider allowing the price and time axis to be adjusted programmatically.

          Once I have a tracking ID for this request I will post in this thread for future reference.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            ChelseaB, thank you so much
            Handlar
            NinjaTrader Ecosystem Vendor - Handlar

            Comment


              #7
              Hello handlar,

              I've received tracking ID #SFT-2331 for this request to scroll the chart programmatically.

              Please note it is up to the NinjaTrader Development to decide if or when any request will be implemented.

              We appreciate your feedback.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Ok. Thank you.
                Handlar
                NinjaTrader Ecosystem Vendor - Handlar

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by yertle, Today, 08:38 AM
                2 responses
                7 views
                0 likes
                Last Post yertle
                by yertle
                 
                Started by dappa, Today, 09:18 AM
                0 responses
                1 view
                0 likes
                Last Post dappa
                by dappa
                 
                Started by bill2023, Yesterday, 08:51 AM
                4 responses
                22 views
                0 likes
                Last Post bltdavid  
                Started by trilliantrader, Today, 08:16 AM
                3 responses
                9 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by NinjaTrader_ChelseaB, 01-08-2017, 06:59 PM
                79 responses
                19,662 views
                5 likes
                Last Post zrobfrank  
                Working...
                X