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

Bug - Difference between OnMarketData and BarsRequest

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

    Bug - Difference between OnMarketData and BarsRequest

    I wrote a volume profile indicator and tried out 2 different approaches to load tick data.
    The first one loads tick data in the OnMarketData function.
    The other one loads tick data with a BarsRequest.

    However, the indicator looked different when I compared the 2 different approaches, so I tried to find a bug in my code.
    After I was not able to find a bug, I exported the incoming tick data as is with a simple Print. I would like to point out that I did not change the tick data, I just exported it as is.
    The format of the export was like this: dateTime, price, volume, ask, bid.

    Then I compared the roughly 100k ticks in Notepad++ with the compare function.

    The result is that the tick data is 99,9% similar. However, there are some random differences, which are very weird.
    Sometimes each approach has some ticks which the other on does not. And sometimes the ticks are even different.
    For example the 6L Future with OnMarketData has the following tick data which the BarsRequest has not.
    29.03.2022 15:30:06 0,2081 1 0,20815 0,2081
    This is very weird because 15:30 is the middle of the day. I was rather expecting ticks to miss in the middle of the night or when the market is closed.

    I then thought that it may be a bug in the Ninja Trader local database, so I deleted the local database and tried it again. However the same differences occur.

    I really think this is a bug in those two functions OnMarketData and BarsRequest.

    #2
    Hi Bobin, thanks for posting. Please post the test scripts you are using so I can test the same thing on my side. You can Export the scripts from the Tools>Export menu. Please also let me know what data feed you are using to test.

    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alifarahani, Today, 09:40 AM
    6 responses
    36 views
    0 likes
    Last Post alifarahani  
    Started by Waxavi, Today, 02:10 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    14 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X