Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Erasing old plots AND getting a color from a Plot

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

    Erasing old plots AND getting a color from a Plot

    Is there a way one can erase old data plots. I created target lines and I want to erase the old target lines on my chart.

    Second is there a way to get a Color from a addPlot. I created Draw.Text and I want the text the same color as my AddPlot.

    #2
    Hello ballboy11,

    Did you manually draw these target lines or were they applied as part of your script?

    Regarding having the same color for Draw.Text as well as AddPlot, you could pass the same color to both the plot and the text, for example,

    Code:
    Add(new Plot(Color.Blue, PlotStyle.Line, ""))
    DrawText("tag1", "Text to draw", 10, 1000, Color.Blue);
    I look forward to your reply.
    Last edited by NinjaTrader_AlanP; 05-09-2017, 10:23 AM.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      passing colors to text

      I understand the statement, but what if in the parameters on changes from blue to red, will the text stay blue? I just want to inherit the plot color. I have 15 different plots to manage

      Comment


        #4
        Hello ballboy11,

        If you wanted to tie together your text and plot color you could declare a Color variable and set the plot color as well as text color to that variable.

        I have attached a strategy which demonstrates this.

        Please let us know if you need further assistance.
        Attached Files
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X