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

BarsRequest and Sync Update and MarketData

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

    BarsRequest and Sync Update and MarketData

    Hello,

    I am storing bars to memory using BarsRequest objects by listening to the BarsRequest.Update event.

    At the same time I'm listening to the Intrument.MarketData.Update event to receive Level1 type information and to be able to accumulate Bid and Ask information in each bar.

    The main problem is that both listeners are out of sync. When a bar ends sometimes Level1 events have not arrived yet, and other times there are more.

    Obviously, this problem is solved in the core of NinjaTrader. Please, could you give me some clue to solve this problem in my code? (I want to avoid developing a synchronization algorithm from scratch).

    Thanks in advance.

    #2
    Hello cls71,

    Thank you for your patience.

    How we build the bars internally would be proprietary. However, if you can provide the code you use and more detail we can look into this with you.

    So we are expecting one MarketData update to occur when the BarsRequest closes?
    How are you closing the Bars on BarsRequest?

    If possible can you provide the code you are using here or send it to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and a reference to this thread?

    I look forward to your response.

    Comment


      #3
      Hello Patrick,
      I sent you an email with the requered code. Thanks for your support.

      Comment


        #4
        Originally posted by cls71 View Post
        Hello Patrick,
        I sent you an email with the requered code. Thanks for your support.
        Let me know if you solve this as I had this same problem and abandoned the work until a solution was found.

        Comment


          #5
          I already found the cause of the issue, The MarketData.Update event subscription must be made within the dispatcher requesting the BarsRequest object. Then the sync between BarUpdate and MarketData works fine.

          Attached Files
          Last edited by cls71; 03-23-2017, 05:57 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by quantismo, 04-17-2024, 05:13 PM
          3 responses
          25 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          7 responses
          34 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by cls71, Today, 04:45 AM
          0 responses
          5 views
          0 likes
          Last Post cls71
          by cls71
           
          Started by mjairg, 07-20-2023, 11:57 PM
          3 responses
          214 views
          1 like
          Last Post PaulMohn  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          4 responses
          547 views
          0 likes
          Last Post PaulMohn  
          Working...
          X