Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting Draw.ArrowUp() w/ Historical Data

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

    Plotting Draw.ArrowUp() w/ Historical Data

    I am trying to create an indicator that plots an up arrow below the bar if Low[0] < Low[1] && Close[0] > Low[1]. I have the indicator working, however it is only plotting the last instance where the above conditions are met. I would like it to plot all instances in the past where such conditions are met. Appreciate any help from those who know what I need to do to accomplish my goal. Thanks!!

    Below is what I have so far
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "MyCustomIndicator1";
    Calculate = Calculate.OnBarClose;
    IsOverlay = true;
    DisplayInDataBox = true;
    DrawOnPricePanel = true;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    }
    else if (State == State.Configure)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    //Add your custom indicator logic here.
    if (CurrentBar > 0)
    {
    if (Low[0] < Low[1] && Close[0] > Low[1])
    {
    Draw.ArrowUp(this,"", true, 0, Low[0] - TickSize,Brushes.Green);
    }
    }
    }

    #2
    I found the answer searching through other posts about plotting indicators. For those who find similar problems with custom script only plotting latest occurrence, you must add "+ CurrentBar" to the string tag argument.

    example : Draw.Dot(this, "dotTag" + CurrentBar, true, ...)

    hope somebody finds this helpful!

    Comment


      #3
      Thank you for the update, robertmaierle!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      581 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      337 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 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
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X