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 fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,404 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          95 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          8 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          159 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Yesterday, 09:29 PM
          0 responses
          8 views
          0 likes
          Last Post Belfortbucks  
          Working...
          X