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

How Plot real time color for current bar only?

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

    How Plot real time color for current bar only?

    I'm trying to develop a volume indicator that can change the color of the current forming bar dynamically but as the bar closes, the historical bars will be the proper color based on the close of that bar.

    Currently in the code, when the current bar updates in real time, the whole series of bars changes color.

    What do I need to do to keep the none real time bars in the correct color state?

    help...

    taddypole...
    Attached Files

    #2
    you can do something like checking if the current bar is datetime.now() and then paint it
    i think?!?

    Comment


      #3
      Never mind, I found it.

      I was using this and it turns the whole series the specified color:
      Plots[0].Pen.Color = Color.Red;

      but then found this and it updates in real time and properly colors past bars:
      PlotColors[0][0] = Color.Red;

      The second bracketed term (index) was what I needed.

      Comment


        #4
        Originally posted by Taddypole View Post
        Never mind, I found it.

        I was using this and it turns the whole series the specified color:
        Plots[0].Pen.Color = Color.Red;

        but then found this and it updates in real time and properly colors past bars:
        PlotColors[0][0] = Color.Red;

        The second bracketed term (index) was what I needed.
        You may have reinvented the wheel. The shipping VolumeUpDown indicator does that already.

        Comment


          #5
          Thank you koganam,

          Exactly what I was looking for...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by mgco4you, Today, 09:46 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by wzgy0920, Today, 09:53 PM
          0 responses
          3 views
          0 likes
          Last Post wzgy0920  
          Started by Rapine Heihei, Today, 08:19 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Rapine Heihei, Today, 08:25 PM
          0 responses
          6 views
          0 likes
          Last Post Rapine Heihei  
          Started by f.saeidi, Today, 08:01 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X