Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can you change color of a candle on price change and finalize the color on BarClose?

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

    #16
    Let me know what you find. It only happens once in a while, the time we know it happened is range 6 on ES on Jan 13th 2021 at around 8:51am
    Attached Files

    Comment


      #17
      Hello WeyldFalcon,

      Thank you for your reply.

      I suspect the difference is because you're checking if the lastPrice variable you've saved matches Close[0] or not - should they match at the time you're checking, you could see a delay. Is there a reason you've changed it from IsFirstTickOfBar?

      Thanks in advance; I look forward to assisting you further.

      Comment


        #18
        When IsFirstTickOfBar did not work NinjaTrader_Jim suggested a different way in post #6 at 02-03-2021, 11:19 AM.

        Comment


          #19
          Hello WeyldFalcon,

          Thank you for your reply.

          Jim was referring to if you want some of it to only function on a price change, then you could use that. If there isn't a price change, there would be a delay in the updating. We'd want to look further into why you're not seeing IsFirstTickOfBar working. IsFirstTickOfBar should work on most bar types that do not redraw the open as long as the bar type does not redraw the open. For range bars, this would be expected to work if you are running the indicator OnEachTick. Are you using the built in Range bars?

          Thanks in advance; I look forward to assisting you further.

          Comment


            #20
            Just to clarify

            use
            IsFirstTickOfBar
            if
            Calculate = Calculate.OnEachTick;

            use
            lastPrice != Close[0]
            if
            Calculate = Calculate.OnPriceChange;
            ?

            Thank you for clarifying, tested both, and both worked. I think I will go with OnPriceChange since that is what my original plan was.

            Comment


              #21
              Hello WeyldFalcon,

              Thank you for your reply.

              You'd use the first one if you want to finalize the bar once, just on the first tick of the next bar if using either OnPriceChange or OnEachTick.

              You'd use the second one if you're running on each tick and you'd like to re-finalize the bar with each price change of the currently forming bar.

              Please let us know if we may be of further assistance to you.

              Comment

              Latest Posts

              Collapse

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