Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Removing old plot values

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

    Removing old plot values

    All I want to do is hide the old target lines
    An image attached is below.

    AddPlot(new Stroke(Brushes.Gold, 2), PlotStyle.Hash, "Target1"); //5
    AddPlot(new Stroke(Brushes.Red, 2), PlotStyle.Hash, "Target2"); //6
    AddPlot(new Stroke(Brushes.ForestGreen, 2), PlotStyle.Hash, "Target3"); //7
    AddPlot(new Stroke(Brushes.DeepSkyBlue, 2), PlotStyle.Hash, "Target4"); //8
    AddPlot(new Stroke(Brushes.Navy, 2), PlotStyle.Hash, "Target5"); //9
    AddPlot(new Stroke(Brushes.Honeydew, 2), PlotStyle.Hash, "Target6"); //10

    These plots can be modified by the user in the parameter section

    I have been trying different things but I can not solve it.
    Attached Files

    #2
    Hello ballboy11,

    Thanks for the additional question.

    In the future, please keep similar inquires in the same thread. We would like to provide clarification in in any thread that you have recently opened so we can avoid duplicate threads. Thanks for understanding.

    I have created an indicator that plots a line at the close of a bar, and can either remove the plots by changing the PlotBrushes value to a transparent value, or it can remove plots by resetting the Plot's Data Series.

    Code:
    if(CurrentBar > 10)
    		for(int i = CurrentBar; i >= 9; i--)
    			PlotBrushes[0][i] = Brushes.Transparent;
    Code:
    if(CurrentBar > 10)
    		Line.Reset(10);
    For the thread's reference, the previous thread can be found here: http://ninjatrader.com/support/forum...d.php?t=100137

    Please let me know if I may be of further help.
    Attached Files

    Comment


      #3
      Got it working thanks


      for (int i = 0; i < CurrentBar -1; i++)
      {
      PlotBrushes[5][i] = Brushes.Transparent;
      PlotBrushes[5][i] = Brushes.Transparent;
      PlotBrushes[6][i] = Brushes.Transparent;
      PlotBrushes[7][i] = Brushes.Transparent;
      PlotBrushes[8][i] = Brushes.Transparent;
      PlotBrushes[9][i] = Brushes.Transparent;
      PlotBrushes[10][i] = Brushes.Transparent;


      }

      I set my index to 60 to see what happens and my plots disappear thank you now the last hurdle is to find the bar index
      Last edited by ballboy11; 05-09-2017, 03:50 PM.

      Comment


        #4
        Hello ballboy11,

        I am glad you have been able to resolve your indexing issue.

        If you have any additional questions, please don't hesitate to ask.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        73 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        152 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        100 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        288 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X