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 data

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

    time and sales data

    Hi,
    What functions in the library would we use to access time and sales data in a strategy?
    thanks,
    David

    #2
    Hello trader3000a,

    Thanks for your post.

    OnMarketData would be used to read Level 1 Time and Sales data.





    The major items to look at are MarketDataType.Ask, MarketDataType.Bid, and MarketDataType.Last. Last represents completed trades, and you can identify buys/sells by comparing the Last tick's Price to the current Bid/Ask. Volume represents the corresponding volume of that individual tick.

    BuySellVolume which comes with NinjaTrader may be referenced as an example for using OnMarketData and working with volume.

    Let us know if there is anything else we can do to help.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi,
      I'm specifically looking for code to identify "above ask" and "below bid" orders that show up on the time and sales. Is there an existing syntax?
      thanks,
      David

      Comment


        #4
        Hello David,

        BuySellVolume demonstrates that exactly.

        Please see below how e.Price, e.Bid, e.Ask, and e.Volume are used when e.MarketDataType is MarketDataType.Last. This tells you if the Last completed trade was a buy/sell.


        Click image for larger version  Name:	NinjaTrader_2022-04-12_06-13-25.png Views:	0 Size:	17.5 KB ID:	1197438
        Attached Files
        JimNinjaTrader Customer Service

        Comment


          #5
          thanks, Jim!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          21 views
          0 likes
          Last Post halgo_boulder  
          Started by mishhh, 05-25-2010, 08:54 AM
          19 responses
          6,189 views
          0 likes
          Last Post rene69851  
          Started by gwenael, Today, 09:29 AM
          0 responses
          5 views
          0 likes
          Last Post gwenael
          by gwenael
           
          Started by Karado58, 11-26-2012, 02:57 PM
          8 responses
          14,830 views
          0 likes
          Last Post Option Whisperer  
          Started by Option Whisperer, Today, 09:05 AM
          0 responses
          2 views
          0 likes
          Last Post Option Whisperer  
          Working...
          X