Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RemoveLastBar() explanation

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

    RemoveLastBar() explanation

    Could you explain please,
    how RemoveLastBar() + IsRemoveLastBarSupported concept is designed to work?

    I see, they are used in the most simple indicators like SMA, so it seems to be widely used concept/feature. From documentation it is not clear enough, how that works and where would developer need to use it. It looks like it is something new, added in NT8.

    I've read the documentation, but that states more/less general explanation, so it is hard to really imagine what it is about. Could you provide some simple example or provide explanation on the existing SMA indicator?

    #2
    The SMA indicator (among other system indicators) were optimized in NinjaTrader 8 to take advantage of caching.

    However bar types, such as LineBreakBarsType or RenkoBarsType, which use "RemoveLastBar()" cannot take advantage of these caching techniques.

    Therefore these optimized system indicators have a check added to test to see if the configured bars type uses RemoveLastBar via the "IsRemoveLastBarSupported" check, and under that condition, it uses the NinjaTrader 7 logic; otherwise indicators will use the new optimized NinjaTrader 8 logic.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you for clear explanation.,
      It helped me to understand why it is used in many indicators.
      What is still not so clear, is the simple logic or idea behind RemoveLastBar().

      Could you explain one more additional thing:
      In what situation should I think about RemoveLastBar()? In what situation it is needed/useful?

      Thank you

      Comment


        #4
        Depends on the bar type. There are a few uses of them in the system bar types, other custom bar types are noted to use it. The use of this method goes back to NT7. You can find some discussion on its usage in some archived threads if you search around

        Imagine you have some condition that invalidated the previous condition and you would like to remove a bar that was previously created. For example, you processed an open price which later needs to be amended to fist the logic of your bar type which may be using a different opening...
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        147 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        4 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,282 views
        0 likes
        Last Post Leafcutter  
        Working...
        X