Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars Colors and Strategy Entrance!

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

    Bars Colors and Strategy Entrance!

    Hi Again!

    I need to reforce my strategy entrance, with the colors of the bars, like a complement conditional.

    Blue for long, Red for short. Where i can get the color of the bar[0] from my chart? I need this color to take desitions, but with KPScoreCardColors I can´t do it. What can i do? Thx!

    #2
    Unfortunately this is not supported. 3rd party vendors need to make this information available through their indicators for strategy development. You will need to contact them to see if they are willing to support this.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ok, no problem, KPScoreCardColors and others third party indicators dont work but, i take the barcolor function from Ninja Trade to get the color in the current bar!

      ColorFlag = BarColor.ToString();


      And get "[color] red" or color of the current bar

      Comment


        #4
        I try to check the color of past bars, and dont get the way! BarColor only work with current bar. Any code to check historical bar color?

        Comment


          #5
          Try saving the current color into a DataSeries, and then you can check for historical color later.

          Before you can do this, you'll have to convert the color to a number (see code example).

          Maybe something like this would work...
          Code:
          DataSeries saved_colors;
          
          protected override void Initialize()
          {
             saved_colors = new DataSeries( this );
          }
          
          protected override void OnBarUpdate()
          {
             int color_num = (BarColor == Color.Green) ? 1 : 
                             (BarColor == Color.Red)   ? 2 : 3;
             saved_colors.Set( color_num );
          
             if (saved_colors[2] == 1)    // Was 2nd bar back green?
          }
          ...unfortunately I don't have time to play with this or test it, so that will be left as an exercise to the reader.

          Good luck.

          Comment


            #6
            nice, THX! KBJ ç. I will try the code and get back with comments soon!

            Comment


              #7
              I have written several enhanced version of KP indicators so that they can be used in a Strategy or the Market Analyzer.

              KPScoreCardColors is one of them: http://ntkwikpop.wikispaces.com/NTKPScoreCardColors

              Comment


                #8
                Incredible! NTKPScoreCardColors give +9 to -9 band to get the real colors of all bars! Thx ScJohn! This indicators are very usefulls and powerfulls! I will get in my code now!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                582 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                338 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                554 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                552 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X