Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tick by Tick Data

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

    Tick by Tick Data

    Hi,

    I'm developing an indicator that analyze tick by tick data,CalculateOnBarClose=false;

    My question is how I get to the last tick data that called OnBarUpdate():
    1. The tick price.
    2. The tick volume.

    This is different from using bars and accessing the bar data such as Close[0];

    Thanks in advance!

    #2
    freewind, Close[0] will actually give you the last tick price, but to get the last tick volume you'll either have to keep track of the difference between each Volume[0] to get the most recent volume change, or you can use OnMarketData() to get the most recent tick volume.

    Code:
    OnMarketData(MarketDataEventArgs e)
    {
       // if nt7
       long currentVolume = e.Volume;
       
       // if nt6.5
       int currentVolume = e.Volume;
    }
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank Austin.
      So if I understand correctly I can set CalculateOnBarClose=true. and separate the logic for tick analysis to OnMarketData() and bar logic to OnBerUpadate().
      The OnMarketData() is called on each tick because the voume is changing even if the price didn't change, correct?
      BTW can I use the last tick volume as Volume[0]-Volume[1]?

      Comment


        #4
        freewind, yes, this is correct. There is a reference sample that demonstrates how to separate the tick-by-tick logic from the bar-by-bar logic.

        OnMarketData() is called on every bid, ask, or trade update.

        You cannot use the last tick volume as Volume[1]-Volume[0] because volume[1] contains the entire volume of the last bar while volume[0] is updated continuously as the bar progresses.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Thank again Austin.
          Is there a way to backtest my strategy on tick data? I don't need Bid Ask just the data that is in the tick DB.

          Comment


            #6
            freewind, here is the reference sample that demonstrates how to backtest with an intrabar granularity.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Austin,
              If I have a strategy that CalculateOnBarClose set to false, and I have tick data and I run the strategy on a 150 tick bar chart does OnBarUpdate() is called on each tick on my historical data?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sjsj2732, 03-23-2026, 04:31 AM
              0 responses
              89 views
              0 likes
              Last Post sjsj2732  
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              324 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              331 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              155 views
              1 like
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              122 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Working...
              X