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

processing mouse events

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

    #16
    Hello, thanks for confirming on some of the above. Have removed all references to directly set ZOrder with ZOrder = value etc ....

    To clarify what i was referring to in post #12 principally in relation to the drawing tool i want to be able to do this outside of OnStateChange() and do this at the top of the OnRender for the drawing tool and to them manage which ZOrderType setting to apply. This is what i am trying to do can you confirm i can do this here - it does compile and run but changing the ZOrderType from the First to Last setting on certain conditions doesnt appear to have any effect. I removed the setting of ZOrder using ZOrder = value etc ....
    I wanted the ability to move to the foreground or background of some drawingn objects - however not sure if this is possible or supported in onRender in this way?

    Also what ninjatrader namespace do i need in order to reference SetZOrder in my custom drawing tool?

    thanks
    Last edited by soulfx; 12-06-2017, 08:27 AM.

    Comment


      #17
      Hello soulfx,

      I've tried making modifications to a sample DrawingTool of mine that adds context menu items to a stripped down version of the Line DrawingTool. I was able to set the ZOrderType from a context menu item, but I needed to force reload NinjaScripts to refresh the ZOrderType within the DrawingTool, and I needed to force an OnRender() call to get the ZOrder to refresh on the chart. This would not be a supported approach.

      SetZOrder() is inherited from the Strategy and Indicator base classes. It would have to be added to the DrawingTool base class to support what you are trying to do. I've submitted a feature request to add this method to the DrawingTool base class. I'll update this post with the ticket ID when I receive it.

      If you have any questions in the meantime, please don't hesitate to write back.
      JimNinjaTrader Customer Service

      Comment


        #18
        Hello thanks for testing, so to recap the custom drawing tool would need to inherit from both DrawingTool and Indicator or strategy in order to use SetZorder. Did you try this in your test?

        Also the force reload ninjascripts was this something you did with F5 or invoking programmatically?
        That also would not be an option in this case for me to do so in the way this is currently structured.

        So really what you had to do and suggesting - i would be better off setting and indicator parameter to change the ZOrderType for the code to know ; if you are saying it must force a reload of ninjascripts and force onRender as well i presume you did InvalidateVisual() or something like that.

        As part of your feature request will you be asking or checking if there is a way to have the ZOrderType change picked up without the unsupported way you have mentioned and have OnRender pick up the change?

        thanks

        Comment


          #19
          Hello soulfx,

          We can't inherit from both base classes at the same time, and I don't know a valid workaround to take.

          I was doing the following in my test script:
          Code:
          private void MyMenuItem1_Click(object sender, RoutedEventArgs e)
          {
          	ZOrderType = DrawingToolZOrder.AlwaysDrawnFirst;
          	ChartCommands.ReloadNinjaScript.Execute(null);
          	if(myChartControl != null)
          		myChartControl.InvalidateVisual();
          }
          This approach wouldn't be advised since forcing a reload of NinjaScripts can have ill effect on other NinjaScripts added to a chart.

          The feature request was to add SetZOrder() to the DrawingTool base class. I'll make sure your interest in modifying the ZOrderType outside of State.SetDefaults is included as well.

          As for modifying ZOrders, I would then recommend to do so from an indicator that adds the drawing objects so you can change the ZOrder index for that indicator.
          Last edited by NinjaTrader_Jim; 12-06-2017, 12:46 PM.
          JimNinjaTrader Customer Service

          Comment


            #20
            Hello, thanks yes i didnt think was possible to do the multiple inheritance and see that this will not be possible until this feature request is implemented.

            So i appreciate your time and effort to test this and address my questions on this.

            But alas since i originally wrote to you on this - it seems i am no further forward with a way to implement what i would like and in trying to layer my application - unless i am missing something this just isnt possible other than specific SetZOrder in OnStateChange of the indicator and to figure out the levels with min max as suggested and print out values - so is really a cumbersome way to figure out layering - so i would also suggest in feature request an approach for a more user friendly better framework design to be able to layer indicators and drawing objects in general.

            not sure if this has already been requested but perhaps this would be a bigger project to retrofit this in the codebase?

            my suggestion of having an input parameter to define the ZOrderType is probably the best that can be done at this time

            thanks

            Comment


              #21
              Hello soulfx,

              I have received word on the feature request.

              Your feedback and the request to add SetZOrder() to the DrawingTools base class are being tracked under the ticket ID SFT-2442. This is a general feature request that aims to improve ZOrder functionality.

              As with other feature requests, you can reference this ticket number in the Release Notes of the version of NinjaTrader 8 that includes this feature.

              Release Notes can be publicly found here: https://ninjatrader.com/support/help...ease_notes.htm

              Please let us know if we can be of further assistance.
              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Jon17, Today, 04:33 PM
              0 responses
              1 view
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              6 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Started by alifarahani, Today, 09:40 AM
              6 responses
              41 views
              0 likes
              Last Post alifarahani  
              Started by Waxavi, Today, 02:10 AM
              1 response
              21 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Working...
              X