Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to show closing price with color bars

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

    How to show closing price with color bars

    I've created an indicator that uses BarColor and CandleOutlineColor. These are very useful but now I can't tell where the bar closed. I would like to draw a black horizontal line on top of the colored bar to indicate the "close". Can you please tell me how this can be done. I've tried this but it doesn't work.
    DrawLine("CloseLine" + CurrentBar, 1, Close[1], 0, Close[0], Color.Black);
    Thanks

    #2
    Hello,

    Thanks for your forum post.

    Unfortunately this would not be possible in NinjaScript to do this since the only anchor point for the line is the center of the bar. You would need to make modifications to the actual chart styles themselfs which gets into unsupported territory unfortunately.

    You might consider drawing a triangle or dot at the top of the bar or bottom of the bar to indicate the close is on the top or bottom or some other solution to this.

    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      I tried adding a dot but it put the dots on my panel 2 indicator instead of on the close of the current bar.
      DrawDot("My dot" + CurrentBar, false, 0, Close[0], Color.Black);
      What do I need to do to fix this?
      thanks

      Comment


        #4
        Hello,

        Add,

        DrawOnPricePanel = True;
        DrawDot();
        DrawOnPricePanel = False;

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          I put this code in my indicators' action. Bar color and candle color work fine, but dot does not show up. What am I doing wrong?

          BarColor = Color.Green;
          CandleOutlineColor = Color.Green;
          DrawOnPricePanel =
          true;
          DrawDot(
          "My dot" + CurrentBar, false, 0, Close[0], Color.Black);
          DrawOnPricePanel =
          false;

          Comment


            #6
            Hello,

            Looks like this used to work in 6.5 but no longer in 7.

            Please see the below post I found on this:



            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            42 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            25 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            162 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            98 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            157 views
            2 likes
            Last Post CaptainJack  
            Working...
            X