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 cre8able, Today, 01:16 PM
      2 responses
      9 views
      0 likes
      Last Post cre8able  
      Started by chbruno, 04-24-2024, 04:10 PM
      3 responses
      48 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by samish18, Today, 01:01 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by WHICKED, Today, 12:56 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by WHICKED, Today, 12:45 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X