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 script

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

    time and sales script

    where can I locate the time and sales ninja script

    #2
    euroventure, I'm not exactly sure what you're asking for, but you can get to the NinjaTrader Time & Sales window from File -> New -> Time and Sales.
    AustinNinjaTrader Customer Service

    Comment


      #3
      time and sales

      thank you for the reply austin,

      I am looking for the ninja trader script ( code ) that creates the time and sales

      Comment


        #4
        There isn't a specific script that prints out the time and sales, but this would do the trick:
        Code:
        protected override void OnMarketData(MarketDataEventArgs e)
        {
          // Print some data to the Output window
          if (e.MarketDataType == MarketDataType.Last)
          {
            string msg = e.Price.ToString() + "\t" + e.Volume.ToString();
            Print(msg);
          }
        }
        AustinNinjaTrader Customer Service

        Comment


          #5
          Hi thanks for the sample code, which I expanded:

          protected override void OnMarketData(MarketDataEventArgs e)
          {
          // Print some data to the Output window
          if (e.MarketDataType == MarketDataType.Last)
          {
          string msg = "Last traded is" + e.Price.ToString() + "\t" + e.Volume.ToString();
          Print(msg);
          }
          else if (e.MarketDataType == MarketDataType.Bid)
          {
          string msg = "Bid is " +e.Price.ToString() + "\t" + e.Volume.ToString();
          Print(msg);
          }
          else if (e.MarketDataType == MarketDataType.Ask)
          {
          string msg = "Ask is" +e.Price.ToString() + "\t" + e.Volume.ToString();
          Print(msg);
          }
          }


          Question is : Why am I seeing duplicates? I thought OnMarketData is triggered only when there is a Lvl 1 change in bid, ask, last or its corresponding change volume?

          e.g.

          Bid is 8400 73
          Ask is 8405 125
          Bid is 8400 73
          Ask is 8405 125

          Comment


            #6
            matthiasho,

            Are you perhaps using multiple data series in your indicator?

            Directly from the help guide for OnMarketData()

            With multi-time frame and instrument strategies, OnMarketData() will be called for all unique instruments in your strategy. Use the BarsInProgress to filter the OnMarketData() method for a specific instrument. (BarsInProgress will return the first BarsInProgress series that matches the instrument for the event)
            For more information on BarsInProgress, please see this link.
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              Dear Adam.

              No, I am not using multiple data series in my indicator.
              Just pure and simple like the codes I provided.

              In fact there isnothing in the Onbarupdate.
              If you provide me with yr email, I can mail you my source code for you to take a look.

              Thanks!

              Comment


                #8
                matthiasho, could it perhaps simply be the script is running double, i.e on another chart or workspace as well as you check the output window? If you would like us to take a look at the source, please send to support at ninjatrader dot com with a reference to this thread here.

                Thanks,
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  hi the indicator is not running double. I only apply it to 1 chart

                  how to send source code to ninjatrader dot com?

                  [email protected]

                  Thanks

                  Comment


                    #10
                    Thanks Matthias, please email us at "support at ninjatrader dot com" with a reference to this thread here.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by andrewtrades, Today, 04:57 PM
                    1 response
                    10 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by chbruno, Today, 04:10 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post chbruno
                    by chbruno
                     
                    Started by josh18955, 03-25-2023, 11:16 AM
                    6 responses
                    436 views
                    0 likes
                    Last Post Delerium  
                    Started by FAQtrader, Today, 03:35 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post FAQtrader  
                    Started by rocketman7, Today, 09:41 AM
                    5 responses
                    19 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Working...
                    X