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 Austiner87, Today, 05:02 PM
          0 responses
          3 views
          0 likes
          Last Post Austiner87  
          Started by tonynt, 05-21-2019, 06:27 AM
          10 responses
          530 views
          1 like
          Last Post fiendtrades  
          Started by awwenzovs, Today, 08:03 AM
          2 responses
          14 views
          0 likes
          Last Post NinjaTrader_Eduardo  
          Started by Ashkam, 04-29-2024, 09:28 AM
          4 responses
          44 views
          0 likes
          Last Post Ashkam
          by Ashkam
           
          Started by nightstalker, Yesterday, 02:05 PM
          1 response
          30 views
          0 likes
          Last Post NinjaTrader_Eduardo  
          Working...
          X