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

Working with historical Bid/Ask prices revisited.

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

    Working with historical Bid/Ask prices revisited.

    I know this issue was already discussed. I know that NinjaTrader does not ensure a proper sequence of events in case of working with separate bid/ask data series . However I hoped somehow to synchronize programmatically my historical data to be able to compute my historical spread = bid-ask. To check, is it possible, I wrote a trivial indicator that prints current bar value for last(primary) , bid and ask series, both added. According to the output , historical data processing is quite out of order, and bid/ask events in OnBarUpdate are lagging more and more behind the last.
    In this situation, it seems that the only way to compute the spread is to populate a database with Close values of Bid/ask, or writing 3 files for last,bid and ask data and attempting to synchronize them in my indicator. Both methods seem cumbersome.
    Any better advice?
    Encl. the indicator.
    Attached Files

    #2
    Hello xTrader1,

    I would expect this if there are not any last trades, bid or ask trades coming to NinjaTrader or being reported by the Data Provider.

    One of the reasons why there is no proper sequence of order between bid and ask is because we do not know when this is happening until it does.

    With that said, you should still be able to access the last Bid price or last Ask Price to get the spread or using the GetCurrentAsk() and GetCurrentBid() methods if you are using this on real-time data.

    For example: Spread.Set( GetCurrentAsk() - GetCurrentBid() )


    Let me know if you have any questions
    JCNinjaTrader Customer Service

    Comment


      #3
      OK, I checked my data, seems you're right it's a matter of my data.
      Last edited by xTrader1; 04-02-2014, 08:51 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,281 views
      0 likes
      Last Post Leafcutter  
      Started by WHICKED, Today, 12:45 PM
      2 responses
      19 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Tim-c, Today, 02:10 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      5 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      53 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X