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

Times and Sales data with Ninja Script?

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

    Times and Sales data with Ninja Script?

    Hi,
    Is there any way to have access to the time and sales data from Ninja Script?
    Thanks

    #2
    Please take a look at this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=3478
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your answer Josh.

      I had a look at the example you referenced but I cannot see how to deduce the sales or buys.

      OnMarketDepth gives you the change in volume in the ask and bid. Every change in an entry doesn't mean a sale or buy , as it will include cancelations and new orders.

      Is there any way I can get the last price sale or buy and its volume?

      Thanks
      PS: I can get the difference in volume on the Bar Update (changing the refresh of the bar to be minimal) but that will be all the buys and sales for that period of time (refresh of the bar) so it won't be the time and sales either.

      Comment


        #4
        Check out the OnMarketData event which probably is what you are looking for: http://www.ninjatrader-support.com/H...arketData.html

        Comment


          #5
          That works

          protected override void OnMarketData(MarketDataEventArgs e)
          {
          // Print some data to the Output window
          if (e.MarketDataType == MarketDataType.Last)
          Print("Last = " + e.Price + " " + e.Volume);


          I can get the last sale and its volume.

          Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          435 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          3 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          18 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frslvr, 04-11-2024, 07:26 AM
          9 responses
          126 views
          1 like
          Last Post caryc123  
          Started by selu72, Today, 02:01 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X