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

Place text at a specific pixel location

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

    Place text at a specific pixel location

    Could you give me an example of a Draw.Text() statement that will print the text "Hello World" right above where Draw.TextFixed( .. Bottom.Right) would be placed on a chart.

    I don't want "Hello World" placed at a location relative to price values, bur rather at a specific pixel value above where "Bottom.Right" text would appear.

    #2
    Hello SilverSurfer1,

    Unfortunately, drawing tools must be drawn over a bar or at a fixed corner in the case of Draw.TextFixed().

    Instead of using a drawing tool, you will need to custom render the text in OnRender().

    Included with NinjaTrader is the SampleCustomRender() script that demonstrates.

    I am also including links to the help guide.
    https://ninjatrader.com/support/help...8/onrender.htm
    https://ninjatrader.com/support/help...t_drawtext.htm

    And a link to a User App Share script that renders text in OnRender().
    https://ninjatraderecosystem.com/use...bol-watermark/
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the response. That is way too much work for a simple text. Maybe in a future release, there could be a Draw.TextCustom.( xAxisPixel, yAxisPixel) which will allow placing text anywhere on the X/Y axis.
      Last edited by SilverSurfer1; 09-20-2023, 01:18 PM.

      Comment


        #4
        Hello SilverSurfer1,

        I will submit a feature request for the development team to consider this.

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

        Comment


          #5
          Hello SilverSurfer1,

          This request is being tracked with ID # SFT-647.

          Please note, we receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing, so we cannot offer an ETA or promise of fulfillment.

          When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number may be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

          Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            You should certainly be using OnRender for this. A specific pixel location is not a good idea because what if they resize the window? What if their resolution differs? What about their text size being 150% vs. 100%? It's really not so simple unless you're always printing in the upper left and even then the distance from the corner will vary if you do not take these things into account. That's why OnRender is just a better solution - you can program in what you need.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DJ888, Today, 10:57 PM
            0 responses
            6 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Today, 09:29 PM
            0 responses
            7 views
            0 likes
            Last Post Belfortbucks  
            Started by zstheorist, Today, 07:52 PM
            0 responses
            7 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            151 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Working...
            X