Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting closing price

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

    Plotting closing price

    I have a set of conditions which when triggered right now plot arrows, what I would like it to do is plot the closing price of the bar as well how can i modify this line to do that...

    if (Open[0]<=Close[0])
    DrawArrowDown("tag_"+CurrentBar.ToString(), true, 0, High[0]+2*TickSize, Color.Red);
    else
    DrawArrowUp("tag_"+CurrentBar.ToString(), true, 0, Low[0]-2*TickSize, Color.Blue);

    Thank you

    #2
    Hello,

    I do not fully understand what your after if you want to just plot the arrow (either up or down) at the close price then you would simply change this parameter from:

    DrawArrowDown("tag_"+CurrentBar.ToString(), true, 0, High[0]+2*TickSize, Color.Red);

    to:

    DrawArrowDown("tag_"+CurrentBar.ToString(), true, 0, Close[0], Color.Red);
    BrettNinjaTrader Product Management

    Comment


      #3
      Hi Brett, I want to plot the arrow + the closing price of the bar

      Comment


        #4
        So a text that shows the closing price of the bar or just simply the arrow AT the close price of the bar.

        If its the later then the code sample I sent should get the job done.
        BrettNinjaTrader Product Management

        Comment


          #5
          No Its the first I would like the closing price as a txt as well

          Comment


            #6
            Understood, in that case you would do this:



            DrawText("ClosePrice" + CurrentBar, Close[0].ToString(), 0, Low[0]-4*TickSize, Color.Black);

            This places the text below the low of the bar 4 ticks.
            BrettNinjaTrader Product Management

            Comment


              #7
              Perfect, thank you... one last thing if I wanted to change the font to make it bigger ... the arrow and the txt how would i do that?

              Comment


                #8
                In that case you would need to specify a font which gets a little more complicated.

                Put this in your variables section.

                Font font = new Font("Times New Roman", 12.0f);

                Then user this.

                DrawText("CloseBarText" + CurrentBar, true, Close[0].ToString(), 0, Low[0]-4*TickSize, 0, Color.Black, font, StringAlignment.Center, Color.Black, Color.Transparent, 0)

                The arrows are a set size however so no way to increase these.
                BrettNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                648 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