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 GLFX005, Today, 03:23 AM
        0 responses
        1 view
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        12 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X