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

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..


    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..


      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 frankthearm, Today, 09:08 AM
        7 responses
        29 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by NRITV, Today, 01:15 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by maybeimnotrader, Yesterday, 05:46 PM
        5 responses
        25 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by quantismo, Yesterday, 05:13 PM
        2 responses
        17 views
        0 likes
        Last Post quantismo  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X