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

Add object to DrawObjects

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

    Add object to DrawObjects

    Is it possible to either 1) Create a drawing tool object and add it to the DrawObjects collection (or a more primitive class it inherits from) or 2) remove the owner from an Drawing object created by an indicator. I've created a simple toolbar to add drawing tools with specific properties but do not want them attached to an indicator. The indicator is just the means to and end... I'm also trying to avoid all the complications with RenderTarget.

    #2
    Hello richt3,

    Thank you for your post.

    Have you reviewed the "Drawing Tool Tile" indicator that comes with the platform by default? It draws objects that are AttachedTo.AttachedToType.Bars which I suspect is what you are looking for rather than having the drawing tools attached to an indicator. As for the properties used, it will draw objects with the default template applied. The source code for this indicator is available to view in the NinjaScript Editor and should be useful with the creation of your toolbar.

    Otherwise, you could consider having an object that is manually drawn then use your indicator to loop through the DrawObjects collection and find the specific object you'd like to change the properties for. Then, it could modify the properties such as colors, anchors, etc. There is an example of looping through the DrawObjects collection to find specific draw objects on this page:All drawing tool objects share the properties on this page, which could also be some helpful information in creating and debugging your indicator:Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      After hours of digging, before and after starting this post, this is the easiest solution out there:

      Hello folks, I have been hard at work trying to come up with a workaround that attaches indicator drawn objects to the chart. The solution is not 100% and there are two major flaws. 1. If an object is not moved around before the indicator is removed, moving the object once the indicator is removed makes the object jumped to

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by StockTrader88, 03-06-2021, 08:58 AM
      45 responses
      3,992 views
      3 likes
      Last Post johntraderuser2  
      Started by TAJTrades, Today, 09:46 AM
      0 responses
      7 views
      0 likes
      Last Post TAJTrades  
      Started by rhyminkevin, Yesterday, 04:58 PM
      5 responses
      62 views
      0 likes
      Last Post dp8282
      by dp8282
       
      Started by realblubb, Today, 09:28 AM
      0 responses
      8 views
      0 likes
      Last Post realblubb  
      Started by AaronKoRn, Yesterday, 09:49 PM
      1 response
      19 views
      0 likes
      Last Post Rikazkhan007  
      Working...
      X