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

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 cre8able, Today, 01:16 PM
            2 responses
            9 views
            0 likes
            Last Post cre8able  
            Started by chbruno, 04-24-2024, 04:10 PM
            3 responses
            48 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by samish18, Today, 01:01 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by WHICKED, Today, 12:56 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by WHICKED, Today, 12:45 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X