Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Keeping Text viewable on Chart

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

    Keeping Text viewable on Chart

    I have a code sequence that evaluates on each new bar. In the following line:

    Draw.Text(this, "test1", true, "Test1", -1, Ohi , 10, TextBrush, myFont, TextAlignment.Right, Brushes.DarkGreen, Brushes.Transparent, 25);

    The text position TextAlignment.Right is of course relative to the current bar position when the query is true.

    If I scroll the screen to look back historically the test will disappear as it is relative to the bar. Is there an overwrite way to keep this text visible when scrolling the chart backward in time or do I need to be using another text method to do so, for example SharpDX.DirectWrite?


    #2
    Hello johnMoss,

    Thank you for your post.

    You could use custom rendering via SharpDX, for an example see SampleCustomRender in the platform. Or, you could use Draw.TextFixed which will draw text in one of 5 available pre-defined fixed locations on panel 1 (price panel) of a chart.



    Please let us know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Thank you Gaby, I need text to stay at a price point so Sharp DX looks like the option. I've taken a cursory look at the SharpDX in the library. Do we have any other reference examples for code structure?

      Comment


        #4
        SampleCustomRender in the platform is a good reference. I am not aware of any other example that specifically demonstrates attaching text to a specific price point.

        Below is further documentation on custom rendering text.

        Gaby V.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by litamm89, 02-01-2025, 11:33 AM
        2 responses
        30 views
        0 likes
        Last Post litamm89  
        Started by Stanfillirenfro, Today, 06:50 AM
        12 responses
        45 views
        0 likes
        Last Post bltdavid  
        Started by carnitron, 02-01-2025, 10:25 PM
        7 responses
        62 views
        0 likes
        Last Post carnitron  
        Started by fjwltn, Yesterday, 09:51 PM
        2 responses
        12 views
        0 likes
        Last Post fjwltn
        by fjwltn
         
        Started by millsd117, Today, 06:09 PM
        0 responses
        8 views
        0 likes
        Last Post millsd117  
        Working...
        X