Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RemoveLastBar() vs UpdateBar()

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

    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?
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    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.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      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....

      ?
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        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
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          And what if to RemoveLastBar() without adding new one - does it triggers any events?
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            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.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Thank you, Chris.
              Once more question: why RemoveLastBar(), why not UpdateBar() with ability updating Open price?
              Is there any reason for current design?
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #8
                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.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  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.

                  fx.practic
                  NinjaTrader Ecosystem Vendor - fx.practic

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Newtrader101, Today, 06:36 AM
                  1 response
                  14 views
                  0 likes
                  Last Post NinjaTrader_Spencer  
                  Started by Rainmakersg, Today, 12:34 AM
                  3 responses
                  20 views
                  0 likes
                  Last Post NinjaTrader_Jim  
                  Started by guidoisot, Today, 03:09 AM
                  2 responses
                  21 views
                  0 likes
                  Last Post guidoisot  
                  Started by ntbone, Yesterday, 10:31 PM
                  3 responses
                  23 views
                  0 likes
                  Last Post NinjaTrader_Jason  
                  Started by 7robert, Yesterday, 11:38 PM
                  3 responses
                  31 views
                  0 likes
                  Last Post 7robert
                  by 7robert
                   
                  Working...
                  X