Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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:


    ...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 bsbisme, Yesterday, 02:08 PM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by prdecast, Today, 06:07 AM
            0 responses
            3 views
            0 likes
            Last Post prdecast  
            Started by i019945nj, 12-14-2023, 06:41 AM
            3 responses
            60 views
            0 likes
            Last Post i019945nj  
            Started by TraderBCL, Today, 04:38 AM
            2 responses
            18 views
            0 likes
            Last Post TraderBCL  
            Started by martin70, 03-24-2023, 04:58 AM
            14 responses
            106 views
            0 likes
            Last Post martin70  
            Working...
            X