Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change chart panel back color and bar color for a previous bar.

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

    Change chart panel back color and bar color for a previous bar.

    I can't find a way to change the chart panel color for a previous bar on a custom indicator I developed. I know the Backcolor = Color.Salmon; command changes the color of the current bar to Salmon but is there a way to do this for a previous bar?

    Similarly is there a way to change the colour of a previous bar on the chart panel. I know the Barcolor =Color.Salmon can only change the color of the current bar.

    Appreciate any help.

    #2
    Hello,

    Please go here:
    http://www.ninjatrader-support.com/H...BackColor.html

    ...and copy and paste in the example section.
    DenNinjaTrader Customer Service

    Comment


      #3
      I looked at the link posted. I guess that means that it's not possible to change for a previous bar then, only possible for the current bar? Actually what I want to do is to make known visibly in a chart, the previous bar selected by the NinjaTrader Swing().SwingHigh() function. Is there a way to do this?

      Comment


        #4
        Hello,

        The swing indicator won't work for this very well. Its values change retroactively. It takes a bit more programming to make that work.
        DenNinjaTrader Customer Service

        Comment


          #5
          How to backcolor of the previous bar in a strategy

          Hi!
          I want to backcolor the previous bar in a strategy.

          Code:
          if (true)
            {
                 set the backcolor of the previous bar to lime green
            }
          How can I do this?

          Since there isn't any bars_ago option in the Backcolor property, I'v tried to use the DrawRegion() method, But it don't woks the way I hoped.
          Code:
          _zero.Set(0);
          
          if (true)
             {
                  DrawRegion("Mytag" + CurrentBar, CurrentBar-1, CurrentBar, _zero, 100000, Color.Empty, Color.Lime, 1);
             }
          (This doesn't paint at all and there is no error message.)

          Do you have any suggestion how I can backcolor the previous bar?
          Last edited by poseidon_sthlm; 03-09-2010, 08:03 AM.

          Comment


            #6
            Have you tried something like this snippet below?

            Code:
             
            if (CurrentBar < 1) return;
             
            DrawRegion("Region1", 1, 0, Low, High[1], Color.Black, Color.Blue, 5);
            Correct is the BackColor call is for the current bar only, so this might provide a workaround.

            For an unsupported method you could check into the CandleStickPattern indicator and how it visualizes the found patterns.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by twitch251, Today, 05:14 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Started by robforee2, Today, 05:07 PM
            0 responses
            1 view
            0 likes
            Last Post robforee2  
            Started by blar58, Today, 03:16 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Melissa  
            Started by alcorr247, Today, 02:52 PM
            2 responses
            7 views
            0 likes
            Last Post robforee2  
            Started by Radano, Today, 02:30 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X