• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
    Patrick H.NinjaTrader Customer Service

    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, 04:57 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pjsmith, Today, 09:58 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Don David, Today, 10:18 AM
          0 responses
          3 views
          0 likes
          Last Post Don David  
          Started by akvevo, Today, 09:43 AM
          2 responses
          10 views
          0 likes
          Last Post akvevo
          by akvevo
           
          Started by aprendiz, Today, 08:04 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Martin89, Today, 02:09 AM
          4 responses
          13 views
          0 likes
          Last Post Martin89  
          Working...
          X