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

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 Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        41 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        21 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X