Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RemoveLastBar() vs UpdateBar()

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

  • fx.practic
    replied
    Please, don't.
    I've just asked to be familiar with general logic.
    I'd wish to save development resource for something really useful.

    Thanks again, Chris.

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi fx.practic, thanks for your patience.

    UpdateBar() is intended to change values of a bar that change over time and the open price obviously doesn't do this normally. The Renko and LineBreak bars are the only defaults that would need to change their open price. I can submit a feature request to request the ability to change the open price of a bar through UpdateBar.

    Please let me know if I can assist any further.

    Leave a comment:


  • fx.practic
    replied
    Thank you, Chris.
    Once more question: why RemoveLastBar(), why not UpdateBar() with ability updating Open price?
    Is there any reason for current design?

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi fx.practic, thanks for your reply.

    If one calls RemoveLastBar they are mostly always going to call AddBar right after to update the bar with new values. One would need to make a test script and see exactly what events trigger.

    Please let me know if I can assist any further.

    Leave a comment:


  • fx.practic
    replied
    And what if to RemoveLastBar() without adding new one - does it triggers any events?

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi fx.practic, thanks for the follow-up.

    1. Yes, AddBar will trigger the OnBarUpdate method for all scripts running on the bar series.
    2. Yes, AddBar will increment CurrentBar.
    3. AddBar will set IsFirstTickOfBar to true in a Calculate.OnEachTick or Calculate.OnPriceChange script only.

    Kind regards,

    ChrisL

    Leave a comment:


  • fx.practic
    replied
    Thanks a lot, Chris!
    One of the most clear answers ever!

    I
    Am I clearly understand, that AddBar() impact all all scripts, using this bars series:
    1. Triggers OnBarUpdate() for scripts Calculated.OrBarClose.
    2. Increment CurrentBar index.
    3. Set IsFirstTickOfBar to true.
    4. Something else....

    ?

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi fx.practic, thanks for your note.

    RemoveLastBar is used to repaint the open of a bar. UpdateBar is unable to modify the open price.

    Please let me know if I can assist any further.

    Leave a comment:


  • fx.practic
    started a topic RemoveLastBar() vs UpdateBar()

    RemoveLastBar() vs UpdateBar()

    Hello.

    I searched across the manuals and forum, but do not catch: why to remove bar, if we can update all it's prices and volume instead?

Latest Posts

Collapse

Topics Statistics Last Post
Started by darylxarkley, Today, 12:54 PM
0 responses
1 view
0 likes
Last Post darylxarkley  
Started by Taddypole, Today, 12:44 PM
0 responses
4 views
0 likes
Last Post Taddypole  
Started by RebeccazDougal, Today, 12:03 PM
0 responses
5 views
0 likes
Last Post RebeccazDougal  
Started by wehewwehd, Today, 11:10 AM
0 responses
4 views
0 likes
Last Post wehewwehd  
Started by my-trade, Today, 10:45 AM
0 responses
8 views
0 likes
Last Post my-trade  
Working...
X