Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help adding up/down arrow plots to indicator... I almost got it .. but...

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

    Need help adding up/down arrow plots to indicator... I almost got it .. but...

    Hello,
    I am trying to automate https://ninjatraderecosystem.com/use...estionboxlite/ for some backtesting etc. I am using an automation tool that can hook on to
    plots. However, the congestion ranges that this indi displays is not a plot it's a rectangle and the automation tool doesn't recognize the congestion ranges. So I have tried for hours to get
    it to plot up/down arrows when the supply/demand boxes are plotted but I'm currently one or 2 bars early. So the indicator has the conditions breakup=true and breakdown=true.
    I have tried to add to the tag line in the up and down arrow code breakup for up arrows and breakdown for down arrows but its early. Probably using the wrong code. Hoping to use the condition
    true to get it to plot. Might be a better way??

    I have added lines:

    Draw.ArrowUp(this, "breakup", true, 0, Low[0] + TickSize, Brushes.DodgerBlue);

    and

    Draw.ArrowDown(this, "breakdown", true, 0, High[0] + TickSize, Brushes.Orange);

    hoping to get it to draw when those conditions are met, but it's early.

    snippit of the code logic where I added it:

    Code:
    if(Close[0] > Upperboundary)
    {
    Inthebox = false;
    breakupbarvalue = Close[0];
    lastbar = CurrentBar;
    totalbars = lastbar - firstbar;

    upperBoundarySeries[0] = Upperboundary;
    lowerBoundarySeries[0] = Lowerboundary;
    boxBarNumSeries[0] = CurrentBar;

    breakup = true;
    Draw.ArrowUp(this, "breakup", true, 0, Low[0] + TickSize, Brushes.DodgerBlue);
    }else
    if(Close[0] < Lowerboundary)
    {

    Inthebox = false;
    breakdownbarvalue = Close[0];
    lastbar = CurrentBar;
    totalbars = lastbar - firstbar;

    upperBoundarySeries[0] = Upperboundary;
    lowerBoundarySeries[0] = Lowerboundary;
    boxBarNumSeries[0] = CurrentBar;

    breakdown = true;
    Draw.ArrowDown(this, "breakdown", true, 0, High[0] + TickSize, Brushes.Orange);

    }
    else
    {
    upperBoundarySeries[0] = upperBoundarySeries[1];
    lowerBoundarySeries[0] = lowerBoundarySeries[1];
    boxBarNumSeries[0] = boxBarNumSeries[1];
    }

    }


    Any suggestions?
    Thanks!

    #2
    Hello TradeUP1,

    If the drawing object is being drawn, this means the condition evaluated as true.

    What makes you say it's early? What specific values compared in the condition leads you to believe it's early?

    Print the values used in the condition to understand why it is evaluating as true.
    Include the time of the bar and labels for all values compared and the comparison operators.

    Below is a link to support article on using prints to understand behavior.


    Save the output from the output window to a text file (right-click > Save as) and attach this to your next post.

    Provide a bar date and time to analyze and let me know why you feel the values are unexpected.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Chelsea,

      I say its early because its plotting the up and down arrows BEFORE the blue demand box and orange supply boxes are being printed. So yeah, your right if the criteria i'm using is met, it will plot the arrow. But what I'm saying, I don't think I'm using the same criteria or have my arrows set up correctly to plot at the same time the congestion boxes are printed. In plain English, what I'm trying to do is get it to plot the up arrow at the same time it plots the blue demand congestion box. And conversely plot down arrows at the same time when it plots the orange supply congestion box. I was hoping that using the tag breakup and breakdown in the code for the arrows that would work to plot at the same time since in the original code there is conditions to be met at true for that but its not working like that. Here is an image to show what I mean I have a down arrow but no orange congestion box yet.
      Down arrow early plot

      These are from custom renko bars so I'm not using any bar type provided by ninjatrader. So I'm not sure your going to be able to recreate the exact timing on your end.

      So using the original code from the link I provided above, what would the code be to plot arrows at the same time the congestion boxes are printed?
      Thanks Again!

      Comment


        #4
        Hello TradeUP1,

        What logic is rendering the blue rectangle in the screenshot?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Link to the original indicator: https://ninjatraderecosystem.com/use...estionboxlite/



          I think that the code that is drawing the boxes is:

          Code:
          if(Close[0] > Upperboundary)
          {
          Inthebox = false;
          breakupbarvalue = Close[0];
          lastbar = CurrentBar;
          totalbars = lastbar - firstbar;
          
          upperBoundarySeries[0] = Upperboundary;
          lowerBoundarySeries[0] = Lowerboundary;
          boxBarNumSeries[0] = CurrentBar;
          
          breakup = true;
          }else
          if(Close[0] < Lowerboundary)
          {
          
          Inthebox = false;
          breakdownbarvalue = Close[0];
          lastbar = CurrentBar;
          totalbars = lastbar - firstbar;
          
          upperBoundarySeries[0] = Upperboundary;
          lowerBoundarySeries[0] = Lowerboundary;
          boxBarNumSeries[0] = CurrentBar;
          
          breakdown = true;
          }
          else
          {
          upperBoundarySeries[0] = upperBoundarySeries[1];
          lowerBoundarySeries[0] = lowerBoundarySeries[1];
          boxBarNumSeries[0] = boxBarNumSeries[1];
          }
          
          }
          Thanks!

          Comment


            #6
            Hello TradeUP1,

            Thank you for the link to the original script.

            In the script I am seeing the rectangles being drawn on lines 262 and 280, with the condition logic on lines 257 and 275.

            My recommendation would be to use the same conditions the original script is using to draw rectangles in your script.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 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
            548 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X