Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

OnBarUpdate not called on each Custom Bar Close using TickReplay

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

    OnBarUpdate not called on each Custom Bar Close using TickReplay

    I have a custom bar type and I want to use TickReplay or AddDataSeries to process each incoming tick. When TickReplay is enabled, I would expect OnBarClose to be called when a bar closes, however it appears that OnMarketData runs through all the 1 tick data, then OnBarClose is called for each bar close.. Is there a way to fix this?

    Indicator Loads
    OnMarketData is called for each tick for the whole chart
    OnBarUpdate is called after all tick data on chart has been processed

    I'm expecting:
    Indicator Loads
    OnMarketData called for each tick for current bar
    OnBarUpdate called when bar closes
    OnMarketData called for each tick for current bar
    OnBarUpdate called when bar closes
    etc...

    #2
    Hello habibalex,

    Does the custom bar type have IsRemoveLastBarSupported set to true?

    Bar Types which use remove last bar concepts CANNOT be used with Tick Replay.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      No it is set to False.

      The tick replay works on the chart, it just runs through all the OMD calls first before OBU. However, it works as expected on live and replay data.

      Comment


        #4
        Hello habibalex,

        I am not able to reproduce this behavior.

        Below is a link to a video of the test.


        Attached is the test script.

        If you test the test script on the ES 06-19 1 Minute with 50 bars to load and Tick Replay enabled, are you experiencing different output in the output window than what is shown in the video?
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Can you try it with this custom bar type? I don't see OnBarUpdate called at all when using this bar type. Why would that be?



          Comment


            #6
            Hello habibalex,

            I am able to reproduce this behavior where OnBarUpdate is not triggering for this custom bar type.

            I tested with the UniRenko available on the User App Share to see if other custom bar types are affected, however the UniRenko bars do not exhibit this behavior and update OnBarUpdate as expected.
            (Update March 11th, 2020 – Fix for TickReplay, calculates values if bar object is mid-session and have not been calculated as least once) This is a conversion of the UniRenko ‐ Universal Renko BarType developed and originally coded for the NinjaTrader 7 platform by monpere. Please contact the original author for any questions or comments. […]


            I recommend you reach out to the vendor that is distributing this bar type and report this behavior.


            The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mattbsea, Today, 05:44 PM
            0 responses
            3 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            31 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            2 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  
            Started by WHICKED, Today, 12:45 PM
            2 responses
            20 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Working...
            X