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 frankthearm, Today, 09:08 AM
          3 responses
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by yertle, Today, 08:38 AM
          5 responses
          15 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by adeelshahzad, Today, 03:54 AM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by bill2023, Yesterday, 08:51 AM
          6 responses
          27 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by NinjaTrader_ChelseaB, 01-08-2017, 06:59 PM
          80 responses
          19,667 views
          5 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X