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

Time and Sales

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

    Time and Sales

    Is the data in T&S the same as OnMarketData()?

    #2
    re: marketdepth t&s data

    so, in the time & sales window, what is displayed is the last price, last volume? and that comes from marketdepth()? 'cause I can't get last price and volume from marketdepth, I need to get it from marketdata, right?

    Comment


      #3
      funk101,

      Sorry for the misinformation. Please take a look at this screenshot: http://i36.tinypic.com/35d3yjb.png
      You will notice the corresponding numbering related to the T&S window representing last prices. The color scheme I have on the T&S is if the background is green the price is at the ask, if the background is red the price is at the bid. Pink text means below the bid and lime text means above the ask.

      You can see everything matches up and coloring is all accurate based on the outputs. You will use OnMarketData() and T&S shows last price, last volume.
      Last edited by NinjaTrader_JoshP; 09-24-2008, 09:34 AM.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        ah

        Ok, so I DO NOT user marketdepth, I use marketdata. Thanks for the correction.

        Comment


          #5
          T&S and Print to Output vs OnMarketData()

          I'm sure I just haven't figured it out, but, T&S can spit out multiple orders in one 250ms shot, when I print to output window, it gives me the same spurt of data, like for instance, 5 trades at ES 1184.50 with diff. volumes, however, the very same code, which basically calls OnMarketData() and looks for the lastPrice and lastVolume; When I display it in a DrawText(), will ONLY give me the very LAST of the *lastPrices, and *lastVolumes. I would like to get ALL the trades I see in the output window into a loop of DrawText(), as if I could do a for() loop on the lastPrice, but it's not an array. Hmm.

          Comment


            #6
            funk101,

            You get all of the exact same events in T&S as you do in OnMarketData(). As demonstrated in my earlier post, you can find all updates present and accounted for. As for what shows up on displays please see if modifying the chart properties for the "Display update interval" helps.

            Note: this will make it much more CPU intensive.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              re: T&S...

              Please check image. T&S shows 3 trades happening at 10:16:58AM - 1183.75, with 3 diff vols: 4, 13, 12, however in my OnMarketData(), I only get the *last* entry. I want to display *exactly* those 3 trades like in the T&S:


              (dummied code sample)
              protected override void OnMarketData(MarketDataEventArgs e)
              {
              if (e.MarketData.Last == null)
              return;

              if (e.MarketData.Last.Price == e.MarketData.Bid.Price)
              { DrawText("spread",false,e.MarketData.Last.Price.To String()+"@"+e.MarketData.Last.Vol.ToString(), (int)gBoundsX+40, yPos, txtColor, gSpreadFont, StringAlignment.Center, outlineColor, gLargeTradeColor, 10);
              }
              }
              Attached Files

              Comment


                #8
                If you only print one line like that it will only print out the latest value. If you want it to print out more lines you simply need to save those previous data points and print additional lines.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh,
                  Is the below method the only way to distinguish idf a trade occurred At Bid and is that how you manage your color coding or the exchange provides that info?

                  if (e.MarketData.Last.Price == e.MarketData.Bid.Price)

                  thanks

                  Originally posted by NinjaTrader_Josh View Post
                  funk101,

                  Sorry for the misinformation. Please take a look at this screenshot: http://i36.tinypic.com/35d3yjb.png
                  You will notice the corresponding numbering related to the T&S window representing last prices. The color scheme I have on the T&S is if the background is green the price is at the ask, if the background is red the price is at the bid. Pink text means below the bid and lime text means above the ask.

                  You can see everything matches up and coloring is all accurate based on the outputs. You will use OnMarketData() and T&S shows last price, last volume.

                  Comment


                    #10
                    What you need to do is create local variables in your indicator such as:

                    private double lastBidPrice;

                    then in OnMarketData()

                    when e.MarketDataType == MarketDataType.Bid assign the value e.Price to this variable. Then when e.MarketDataType == MarketDataType.Last, compare e.Price to this variable.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      thanks for the quick response, that's what had occurred to me but needed to make sure that the exchanges through the feed do NOT supply the data already tagged as at bid or at ask etc.
                      BTW, here's an relevant question maybe I could get an answer for. How can a trade occur for the eminis at say between the bid and the ask?
                      In order to buy or sell there must exist an offer or a bid first, or NOT? I understand the below and the above but not the between?!
                      Anybody?

                      Originally posted by NinjaTrader_Ray View Post
                      What you need to do is create local variables in your indicator such as:

                      private double lastBidPrice;

                      then in OnMarketData()

                      when e.MarketDataType == MarketDataType.Bid assign the value e.Price to this variable. Then when e.MarketDataType == MarketDataType.Last, compare e.Price to this variable.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by cls71, Today, 04:45 AM
                      2 responses
                      9 views
                      0 likes
                      Last Post eDanny
                      by eDanny
                       
                      Started by proptrade13, Today, 11:06 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post proptrade13  
                      Started by kulwinder73, Today, 10:31 AM
                      1 response
                      10 views
                      0 likes
                      Last Post NinjaTrader_Erick  
                      Started by RookieTrader, Today, 09:37 AM
                      3 responses
                      15 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by terofs, Yesterday, 04:18 PM
                      1 response
                      24 views
                      0 likes
                      Last Post terofs
                      by terofs
                       
                      Working...
                      X