Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Darvas boxBottom

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

    Darvas boxBottom

    Hello everybody, i have some problems with the Darvas indicator.
    i want to draw an arrow when my price close under the darvas bottom but i'm not able to code the boxBottom.
    I attached an illustrations of what i'm trying to code. i'd like to get an arrow where i draw the cirlcles.

    Thanks, Dimitri.
    Attached Files

    #2
    Hello Dimitri,

    Thank you for your post.

    You would want to use the Lower and Upper bands for the Darvas indicator.
    Code:
    if(Close[0] < Darvas().Lower[0])
    {
         //do something
    }
    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your answer Cal,
      I tried this but it doesn't show any signal

      Comment


        #4
        What signal are you looking for exactly?

        Can you share the code and what you are wanting to it to do?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          // Condition set 1
          if (Close[0] < Darvas().Lower[0])
          {
          DrawArrowDown("Doji", 0,High[0]+TickSize, Color.Blue);
          }

          Here is my code, There is no arrow when the price is under the boxbottom.
          I tried the strategy on on the chart attached but it doesn't show any results, it should draw an arrow at every bars closing under the boxbottom.
          Attached Files

          Comment


            #6
            Dimitri,

            Your code will draw an arrow at the most recent occurrence of the condition but will only draw 1 arrow.
            If you want to have your code draw an arrow at each occurrence you will need to use this for your script -

            DrawArrowDown('Doji' + CurrentBar, 0,High[0]+TickSize, Color.Blue);
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Thanks for your quick respond Cal,
              i changed my line of code but there is no occurence at any moment on the chart, i think the problem comes frome this line : // Condition set 1
              if (Close[0] < Darvas().Lower[0])
              Thanks in advance, Dimitri.

              Comment


                #8
                Do have a CurrentBar check in place, at the beginning of your OnBarUpdate()?

                if(CurrentBar < 1)
                return;
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  I added it but it doesn't change anything, my code looks like this right now :
                  /// <summary>
                  /// This method is used to configure the strategy and is called once before any strategy method is called.
                  /// </summary>
                  protected override void Initialize()
                  {


                  CalculateOnBarClose = true;
                  }

                  /// <summary>
                  /// Called on each bar update event (incoming tick)
                  /// </summary>
                  protected override void OnBarUpdate()

                  {
                  if(CurrentBar < 1)
                  return;
                  // Condition set 1

                  if (Close[0] < Darvas().Lower[0])
                  {
                  DrawArrowDown("My down arrow" + CurrentBar, false, 0, 0, Color.Red);
                  }
                  }

                  Thanks in advance, Dimitri.

                  Comment


                    #10
                    That is because you are setting the Y value to a hard 0. Which means the arrow will plot it at the 0 line.
                    DrawArrowDown("My down arrow" + CurrentBar, false, 0, 0, Color.Red);

                    You will want to use a price point to plot the arrow like below -
                    DrawArrowDown("My down arrow" + CurrentBar, false, 0, High[0] + 1 * TickSize, Color.Red);
                    Cal H.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    647 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    573 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X