Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not printing

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

    Strategy not printing

    Why Strategy wont print bar color and background color?
    Thanks

    #2
    Hello quant007,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    What code are you using to print the bar color and background? Can you supply the lines of code using Print() for BarColor and BackColor?

    I look forward to your response.

    Comment


      #3
      <summary>
      /// This method is used to configure the strategy and is called once before any strategy method is called.
      /// </summary>
      protected override void Initialize()
      {

      CalculateOnBarClose = true;
      }

      /// <summary>
      /// Called on each bar update event (incoming tick)
      /// </summary>
      protected override void OnBarUpdate()
      {
      // Condition set 1
      if (Rising(RSI(14, 3).Avg) == true
      && Falling(RSI(14, 3).Avg) == true)
      {
      BarColor = Color.GreenYellow;
      BarColor = Color.Red;

      Comment


        #4
        Hello quant007,

        Thank you for your response.

        Are you looking for a Red or GreenYellow bar? Your code would try to set it to GreenYellow and then to Red.

        What color are you looking for when the condition returns true?

        I look forward to your response.

        Comment


          #5
          Also that condition would never be true.

          It needs split it and separated.

          Comment


            #6
            Originally posted by sledge View Post
            Also that condition would never be true.

            It needs split it and separated.
            What the heck do you mean? Of course anything can be both rising and falling at the same time. Oh, OK, maybe not price or its derivatives. Never mind.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            51 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            142 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            275 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X