• 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

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, 01: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, 08: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, 09: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 krofs, Today, 03:37 PM
                2 responses
                7 views
                0 likes
                Last Post krofs
                by krofs
                 
                Started by kalalex, Today, 03:51 PM
                0 responses
                2 views
                0 likes
                Last Post kalalex
                by kalalex
                 
                Started by bdelorm, Today, 12:26 PM
                5 responses
                26 views
                0 likes
                Last Post bdelorm
                by bdelorm
                 
                Started by kalalex, Today, 02:23 PM
                0 responses
                2 views
                0 likes
                Last Post kalalex
                by kalalex
                 
                Started by kevinenergy, Today, 01:43 PM
                4 responses
                18 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Working...
                X