Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT do not save all ticks for ask, bid

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

    NT do not save all ticks for ask, bid

    Hello~
    I'm using dll interface to push ticks from my dataserver to NT.
    It works well. But I found something strange.

    I saved bid price, ask price, last(trade) price and bid volume, ask volume, trade volume when trade has occured. But, the number of saved ticks are not eqaul.
    I found that NT save only one tick when two ticks have same price, volume and timestamp for Ask and Bid(not for last).
    My data have several ticks in 1 sec, so I need to save all ticks to know the order. Is there any way to save all ticks?

    #2
    gyunhak, how are you saving the ticks? If you call OnMarketData(), you'll definitely get a tick for every L1 update. Also, which version of NinjaTrader are you using? It should be saving all ticks, albeit with one second resolution.
    AustinNinjaTrader Customer Service

    Comment


      #3
      I'm using datafeed which is not supported in NT. So I use dll Interface.
      I write an application that get ticks from datafeed and pass to NT by dll interface
      I use following dll interface function

      - int Ask(string instrument, double price, int size)
      - int Bid(string instrument, double price, int size)
      - int Last(string instrument, double price, int size)

      I add symbols and EMA indicator to market analyzer for saving ticks.
      My NT version is 7.0.1000.4.

      I tested OnMarketData(), but it seems that DLL interface functions do not pass all ask and bid ticks to Indicator.

      C# application Test code

      Code:
       
      for (int i = 0; i < 10; i++)
      {
      NTClient.Last("TEST", 50, 1);
      NTClient.Ask("TEST", 55, 1);
      NTClient.Bid("TEST", 45, 1);
      }
      NT Test Indicator Script

      Code:
       
      protected override void OnMarketData(MarketDataEventArgs e)
      {
      if (e.MarketDataType == MarketDataType.Last)
      Print("[OnMarketData] Last = " + e.Price + " " + e.Volume);
      else if (e.MarketDataType == MarketDataType.Ask)
      Print("[OnMarketData] Ask = " + e.Price + " " + e.Volume);
      else if (e.MarketDataType == MarketDataType.Bid)
      Print("[OnMarketData] Bid = " + e.Price + " " + e.Volume);
      }
      Output Window
      Ask = 55 1
      Bid = 45 1
      Last = 50 1
      Last = 50 1
      Last = 50 1
      Last = 50 1
      Last = 50 1
      Last = 50 1
      Last = 50 1
      Last = 50 1
      Last = 50 1

      Comment


        #4
        gyunhak, I am not entirely sure of the specifics, but the dll adapter drops ticks every so often. If you need 100% tick accuracy, you'll either have to slow down sending the ticks or use a supported data provider.
        AustinNinjaTrader Customer Service

        Comment


          #5
          If I can take a guess, a bid event with no change in price or size will not be treated as a new event because nothing has changed. So the OnMsrketData call is skipped since it is redundant

          Comment


            #6
            aviat72, you are correct here. If the bid price or volume hasn't changed, then there wouldn't even be L1 update.
            AustinNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Irukandji, Today, 04:58 AM
            0 responses
            2 views
            0 likes
            Last Post Irukandji  
            Started by fitspressoburnfat, Today, 04:25 AM
            0 responses
            2 views
            0 likes
            Last Post fitspressoburnfat  
            Started by Skifree, Today, 03:41 AM
            1 response
            4 views
            0 likes
            Last Post Skifree
            by Skifree
             
            Started by usazencort, Today, 01:16 AM
            0 responses
            1 view
            0 likes
            Last Post usazencort  
            Started by kaywai, 09-01-2023, 08:44 PM
            5 responses
            604 views
            0 likes
            Last Post NinjaTrader_Jason  
            Working...
            X