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 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
        21 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        5 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Yesterday, 10:49 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X