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

transactions per bar

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

    transactions per bar

    I use tick bars for day trading, so it's easy to see the number of transactions/ticks per bar.

    How can I see the number of transaction per bar if I don't use tick bars? (minute, day, etc.)

    Thank you.

    #2
    Hello imalil,

    Thank you for your note.

    This would be possible with a custom indicator which pulls in a secondary series of type tick, which you could pull the desired information from. If you'd like I can provide a sample.

    An indicator may exist already which does what you'd like, I suggest checking out the following section of our forum to see if it does,


    Or if you'd like I can have someone reach out with a list of third parties that would be interested in building this for you.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      A sample is exactly what I'm looking for. Thanks.

      Comment


        #4
        here you go
        dont forget to enable TickReplay for historical data
        Attached Files
        Last edited by gubbar924; 02-20-2018, 06:56 PM.

        Comment


          #5
          Hello gubbar924,

          Thank you.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            I use this
            if (BarsPeriod.BarsPeriodType == BarsPeriodType.Tick)
            tickValue = BarsPeriod.Value;
            to get the number of transactions in tick bars. If I use a 100 tick bar chart, for example, it returns 100 ticks. Is there a way to see how many of these transactions/ticks happened at the bid and how many happened at the ask?

            Thank you.

            Comment


              #7
              Hello imalil,

              Thank you for your note.

              It would be possible however you may want to look at the BuySellPressure and BuySellVoume indicators preloaded on NinjaTrader as these count the volume at the bid and ask.

              Please let us know if you need further assistance.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                Thanks. I'm not having a problem getting bid/ask volume. It's the number of transactions occurring at either the bid or ask that I want to determine.

                You said it would be possible. What's the most accurate way to go about getting this value?

                Thank you.

                Comment


                  #9
                  Hello imalil,

                  You would want to compare the amount of ticks which occurred at the bid or the ask using GetCurrentBid and GetCurrentOffer,




                  And want to add a secondary tick series using AddDataSeries,


                  Then you would write the logic if the Close of the tick series was equal to the CurrentBid, add 1 to a running counter and the same for the CurrentOffer. A great indicator reference preloaded with NinjaTrader would be BuySellVolume, which demonstrates logic of counting trades based on a set of conditions. You would want to run the indicator with Calculate set to OnEachTick, or you could run the counter in OnMarketData like the BuySellVolume indicator.

                  Please let us know if you need further assistance.
                  Alan P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  43 views
                  0 likes
                  Last Post jeronymite  
                  Started by frankthearm, Today, 09:08 AM
                  4 responses
                  9 views
                  0 likes
                  Last Post frankthearm  
                  Started by yertle, Today, 08:38 AM
                  5 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by adeelshahzad, Today, 03:54 AM
                  3 responses
                  16 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by bill2023, Yesterday, 08:51 AM
                  6 responses
                  27 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Working...
                  X