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

Draw.TextFixed - different colours on different lines

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

    Draw.TextFixed - different colours on different lines

    Hello,

    I have some code which prints 4 lines of values to my chart and each line may be a different colour depending on the values. I currently use Draw.Text to achieve this, but I would like the text to remain in a fixed position. Is there a way to use Draw.TextFixed to achieve this?

    Thank you.

    #2
    Originally posted by GeorgeW View Post
    Hello,

    I have some code which prints 4 lines of values to my chart and each line may be a different colour depending on the values. I currently use Draw.Text to achieve this, but I would like the text to remain in a fixed position. Is there a way to use Draw.TextFixed to achieve this?

    Thank you.
    No. If you wan to do that, you will have to write your on information panel using the window properties for locations. Look in the code for SampleCustomRender for ideas.

    Comment


      #3
      Thanks for your response, Koganam.

      I have been able to resolve the matter by starting a new Draw.TextFixed piece of code for each of the lines that I want on the chart, and then doubling the line spacing to the next line at the start of the text field for each subsequent line apart from the first. So the 2nd line text field starts with "\n" + "\n" +, the 3rd with "\n" + "\n" + "\n" + "\n" + and so on. Anything to avoid trying to get my head around the OnRender method this morning.

      Comment


        #4
        Originally posted by GeorgeW View Post
        Thanks for your response, Koganam.

        I have been able to resolve the matter by starting a new Draw.TextFixed piece of code for each of the lines that I want on the chart, and then doubling the line spacing to the next line at the start of the text field for each subsequent line apart from the first. So the 2nd line text field starts with "\n" + "\n" +, the 3rd with "\n" + "\n" + "\n" + "\n" + and so on. Anything to avoid trying to get my head around the OnRender method this morning.
        Well, yes, one can do that if the text background is transparent or empty. I kind of thought that you were coloring the background. I should have asked before writing. I apologize.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        3 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        8 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X