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 algospoke, Yesterday, 06:40 PM
        2 responses
        19 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        45 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X