• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Last Market Order Trade Type

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

    Last Market Order Trade Type

    Hi, I would like to know how can I get the last market order/trade type (buy or sell) executed in the market (not by me). I'm in a tick chart and this I the code that I use to know how many ticks passed on the last operation, but I can't know how to identify if those ticks were involved in a buy or sell trade.

    Code:
    protected override void OnBarUpdate()
            {
    
    			tickAct = Bars.TickCount;
    			Print("Ticks passed: " + Time[0] + " - " + (tickAct - tickAnt));
    			tickAnt = Bars.TickCount;
            }
    Another thing I would like to clarify is if a tick is the same that a trade with 1 contract, keeping this line I could say that 34 ticks in a bar is the same that 1 operation (trade) of 34 contracts, is that correct? I got this question when I exported historical data from NT7 and I got a tick value with the data, please see the image attached.

    Thanks in advance.
    Attached Files

    #2
    Hello ricardo88,

    The OnMarketData method triggers when a last tick is set or an ask or bid level changes.

    Below is a public link to an example script that demonstrates reproducing the information in the Time & Sales window..
    https://ninjatrader.com/support/foru...265#post503265

    The .Volume will show the number of contracts with the last last tick.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello ricardo88,

      The OnMarketData method triggers when a last tick is set or an ask or bid level changes.

      Below is a public link to an example script that demonstrates reproducing the information in the Time & Sales window..
      https://ninjatrader.com/support/foru...265#post503265

      The .Volume will show the number of contracts with the last last tick.
      That is correct.

      Comment


        #4
        Thank you!! Worked as espected

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Rednael90, Today, 07:22 AM
        0 responses
        7 views
        0 likes
        Last Post Rednael90  
        Started by dadarara, Today, 02:42 AM
        0 responses
        4 views
        0 likes
        Last Post dadarara  
        Started by TraderYoda, 10-17-2018, 09:06 AM
        14 responses
        163 views
        1 like
        Last Post TraderYoda  
        Started by Johnny Santiago, Yesterday, 09:31 PM
        0 responses
        7 views
        0 likes
        Last Post Johnny Santiago  
        Started by DarkCloudCover, Yesterday, 07:29 PM
        1 response
        28 views
        1 like
        Last Post TraderYoda  
        Working...
        X