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 jaybedreamin, Today, 05:56 PM
            0 responses
            7 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            4 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            12 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            13 views
            0 likes
            Last Post bltdavid  
            Working...
            X