Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate() on Range Bar chart

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

    OnBarUpdate() on Range Bar chart

    Hello guys,

    could anybody please explain.

    I have the following code and my expected behavior would be to see black line on all price changes (because I use range to 1 tick) and it works in most cases except when data is coming very fast.

    I have this code inside OnBarUpdate:
    Code:
    protected override void OnBarUpdate()
    {
         Draw.VerticalLine(this, "vline" + CurrentBar, Time[0], Brushes.Black);
    }
    By first impression looks like NT doing rendering queue based on time and not based on price changes. Could you please explain?

    Thanks
    Attached Files

    #2
    It looks like you have made it time based.

    Change to barsago and use 0. That should work.





    Originally posted by dejavu View Post

    I have this code inside OnBarUpdate:
    Code:
    protected override void OnBarUpdate()
    {
         Draw.VerticalLine(this, "vline" + CurrentBar, Time[0], Brushes.Black);
    }
    By first impression looks like NT doing rendering queue based on time and not based on price changes. Could you please explain?

    Thanks

    Comment


      #3
      Hello dejavu,

      I agree with sledge here. By using time there will be one object for that timestamp. Time stamps in NT7 are granular to the second, time stamps in NT8 are granular to the millisecond.

      This means there will only be one drawing object for bars that share that same time stamp.

      By using bars ago 0, you are specifying each bar instead of a specific bar by time.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by inanazsocial, Today, 01:15 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      5 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      1 view
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      22 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Working...
      X