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

Drawing a Text Object

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

    Drawing a Text Object

    Hi, so I'm making an indicator that has some buttons. Now, these buttons have text on them and I would like to create a new editable text object with a predetermined text inside them. Now the buttons and events handlers itself are all figured out, no worries there. Im wondering if its possible to toggle the text drawing tool with a text data already assigned. Now, this may not be possible, so my second idea is to just place the text at a default location but its still a editable text object.

    Thanks

    Edit: On NT7
    Last edited by Unsuitable; 08-27-2019, 02:37 PM.
    Unsuitable
    NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

    #2
    Hello Unsuitable,

    There isn't anything documented or supported by NinjaTrader Support for this.

    There is a sample of adding buttons.
    https://ninjatraderecosystem.com/use...olbar-buttons/

    And there is a drawing toolbar script that uses a lot of unsupported code.
    https://ninjatraderecosystem.com/use...lbar-shortcut/

    It may be possible using a DrawText() or DrawFixedText() with one of these routes..


    With the location, if its based on a draw method it would be confined to a location accepted as a parameter for these.
    For an arbitrary location I'm not sure how that would work.

    But this thread will remain open for any community members that would like to assist.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.


    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok, like I alluded to before, there is a way of just sending it to a default location and being able to move it around. Create an IText object with a set position then set the IText object's Locked property to false. Then you'll be able to move it around. My only problem now it treating as its own object separate from the indicator. At the moment, when I want to delete the text, it wants to delete the entire indicator. Is there any way of preventing this?

      Edit: A quick AllowRemovalOfDrawObjects = true in the Initialize() method will do the trick. Hopes this helps some one else.
      Last edited by Unsuitable; 08-27-2019, 04:41 PM.
      Unsuitable
      NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by yertle, Yesterday, 08:38 AM
      7 responses
      28 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by bmartz, 03-12-2024, 06:12 AM
      2 responses
      20 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by funk10101, Today, 12:02 AM
      0 responses
      4 views
      0 likes
      Last Post funk10101  
      Started by gravdigaz6, Yesterday, 11:40 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Yesterday, 10:49 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X