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

Bar Color

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

    Bar Color

    Does anyone know how to paint Prior bars after the something has happened on the current bar. I have an indicator that if true on the current bar, I place an order. However, I want to paint the prior bar blue. I tried:

    BarColor[1] = Color.Blue;

    but NT did not like that.

    Any Ideas?

    #2
    Velocity,

    You make me laugh!!!!


    I fixed the Grail bars indicators problem on the other forum a couple weeks ago by getting rid of the repainting of the prior bar.


    Check out T3average and ADXVMA Sharkys Bars or check out this captured code.


    The repainting code is in red.


    // { Rising.Set(main[0]); Rising.Set(1, main[1]); }
    { Rising.Set(main[0]); Rising.Set(1); }

    else if (main[0] < main[1])
    // { Falling.Set(main[0]); Falling.Set(1, main[1]); }
    { Falling.Set(main[0]); Falling.Set(1); }

    else
    // { Neutral.Set(main[0]); Neutral.Set(1, main[1]); }
    { Neutral.Set(main[0]); Neutral.Set(1); }

    or

    if (Rising(t3Ave))
    {
    // Connects the rising plot segment with the other plots
    T3AverageUp.Set(1, t3Ave[1]);

    // Adds the new rising plot line segment to the line
    T3AverageUp.Set(t3Ave[0]);
    }

    else if (Falling(t3Ave))
    {
    // Connects the new falling plot segment with the rest of the line
    T3AverageDown.Set(1, t3Ave[1]);

    // Adds the new falling plot line segment to the line
    T3AverageDown.Set(t3Ave[0]);
    }

    else
    {
    // Connects the neutral plot segment with the rest of the line
    T3AverageNeutral.Set(1, t3Ave[1]);

    Good Luck,


    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      Hi velocity, as you discovered, BarColor doesn't work in the past. rt6176 has a work-around to set historical plots in an indicator. That method wouldn't plot on the bars though.
      AustinNinjaTrader Customer Service

      Comment


        #4
        Thanks guys.

        I'll give it a try.

        Loved the comment Rjay and thanks for the code snippet.

        Comment


          #5
          Originally posted by NinjaTrader_Austin View Post
          Hi velocity, as you discovered, BarColor doesn't work in the past. rt6176 has a work-around to set historical plots in an indicator. That method wouldn't plot on the bars though.
          Are you kidding me!!! Yea, It does work on bars!!!
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by AveryFlynn, Today, 04:57 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by Max238, Today, 01:28 AM
          4 responses
          37 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by r68cervera, Today, 05:29 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by geddyisodin, Today, 05:20 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by timko, Today, 06:45 AM
          2 responses
          14 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Working...
          X