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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        129 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        74 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        116 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        111 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        89 views
        0 likes
        Last Post CarlTrading  
        Working...
        X