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

Bid and Ask data

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

    Bid and Ask data

    Is there a way to collect Bid and Ask data historically.

    I know I can get it through the OnMarketData but that has to be
    on real time data.



    Thanks

    #2
    Hello,

    If you dont mind me asking who is your current data feed provider. There are some data feed providers that provide this automatically without the need to record it and will provide it has historical data. Understanding section and then you will see historical Bid and Ask data.




    Let me know if I can be of further assistance.

    Comment


      #3
      Brett


      My data provider is Zen Fire. I would have access to historical Bid and Ask tick data.

      How would I get these data ? OnMarketData is used only on real time data, right ?



      Thanks

      Comment


        #4
        What I need to know is if the last price has been traded at bid or at the offer.

        So what is the syntax to access the bid and ask data ?
        Last edited by blar58; 02-28-2011, 04:18 PM.

        Comment


          #5
          You can access it from OnMarketData in real-time indeed, it is in the event args
          Code:
          protected override void OnMarketData(MarketDataEventArgs e)
          {
              if (e.MarketDataType == MarketDataType.Ask)
                   Print("Ask = " + e.Price );
              else if (e.MarketDataType == MarketDataType.Bid)
                   Print("Bid = " + e.Price );
          }
          You'll probably need to compare your Last price's time to e.Time to verify it's correct.

          edit: there is also MarketDataType.Last!
          Last edited by Dexter; 02-28-2011, 05:08 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by traderqz, Today, 12:06 AM
          2 responses
          3 views
          0 likes
          Last Post traderqz  
          Started by RideMe, 04-07-2024, 04:54 PM
          5 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by f.saeidi, Today, 08:13 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by DavidHP, Today, 07:56 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by kujista, Today, 06:23 AM
          3 responses
          11 views
          0 likes
          Last Post kujista
          by kujista
           
          Working...
          X