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

T&S

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

    T&S

    Hi,

    I want something like :

    if (e.MarketDataType == MarketDataType.Last) {
    if (e.MarketDataType == MarketDataType.Bid) a = e.Volume;
    if (e.MarketDataType == MarketDataType.Ask) b = e.Volume;
    }

    I want to access the MarketDataType.Last hit at the bid (and below) and the MarketDataType.Last hit at the ask (and above). How to do that ?

    I tried comparing e.Price with the price of the tick before but unfortunately I don't get what I want. Rising/falling price doesn't always mean the ask/bid is hit.

    Thanks

    #2
    Hi sam30,

    You sound like you want your own Level II book. Please see this reference sample for how to do that: http://www.ninjatrader-support.com/v...ead.php?t=3478
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I know this SampleMarketDepth.cs
      My question is more with the T&S than the market depth.

      I'd like to know if the last tick was traded at the ask or the bid.
      --> so if MarketDataType.Last was traded at the ask or the bid.

      It should be possible to do as the T&S in NT has different colours for the bid, below the bid, for the ask and above the ask.

      Comment


        #4
        Hi sam30,

        I see. Maybe you can try this. Create your own bid/ask ladder with OnMarketDepth() then compare it to the last tick price?

        Or maybe you can try storing the bid/ask event and then comparing it to the last event directly.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi Sam30/NinjaTrader_Josh,

          I would like to do something very similar. What I would like is to:
          1) Identify the last trade (to either hit the bid side or the ask side)
          2) Identify the volume
          3) Identify which ECN / MM did it come from (if possible)
          4) Write the information out to a file/database for later analysis

          Is that doable? If so, can you provide sample code?

          Thanks,
          B-

          Comment


            #6
            Blade,

            It is doable, but will require a lot of coding. Unfortunately there is no sample code available.

            To get the last trade you can try proceeding with my earlier suggestion of running your own price ladders and then comparing it on there when you get the last tick.

            Identifying volume is easier. To get the total volume of the bar you can do something like Volume[0]. To get volume of the last trade only you can do e.Volume inside OnMarketData() or OnMarketDepth().

            This is generally not available unless your data provider offers this data. In that case you can get to it by using OnMarketDepth(). Please use e.MarketMaker. (http://www.ninjatrader-support.com/H...EventArgs.html)

            To write out to a file please see this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=3475
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thanks Josh.

              In that case can you tell me which of the supported data providers offers this data? Is there a brokerage firm that would provide this type of data to their clients for free?

              Furthermore, since I am experimental stage of building a trading system using this data, do you know of any place that I can download one to six month of historical T&S and market depth data (regardless of how old it might be or the type of instrument)?

              Thanks again,
              B-

              Comment


                #8
                Break down of the supported data feeds can be found here: http://www.ninjatrader-support.com/H...HistoricalData

                You will need Level II data and you would need to come into contact with the data providers directly as many have a whole suite of services they offer. You will need to find one that suits you.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh;
                  You mean compare the Last to the latest Bid and Ask then determine where it falls in relation to those two?
                  Is this how you manage your T&S color scheme?
                  thanks

                  Originally posted by NinjaTrader_Josh View Post
                  Hi sam30,

                  I see. Maybe you can try this. Create your own bid/ask ladder with OnMarketDepth() then compare it to the last tick price?

                  Or maybe you can try storing the bid/ask event and then comparing it to the last event directly.

                  Comment


                    #10
                    Yes, you need to compare the last trade event to stored prices for last bid/ask.
                    RayNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by funk10101, Today, 09:43 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post funk10101  
                    Started by pkefal, 04-11-2024, 07:39 AM
                    11 responses
                    36 views
                    0 likes
                    Last Post jeronymite  
                    Started by bill2023, Yesterday, 08:51 AM
                    8 responses
                    44 views
                    0 likes
                    Last Post bill2023  
                    Started by yertle, Today, 08:38 AM
                    6 responses
                    26 views
                    0 likes
                    Last Post ryjoga
                    by ryjoga
                     
                    Started by algospoke, Yesterday, 06:40 PM
                    2 responses
                    24 views
                    0 likes
                    Last Post algospoke  
                    Working...
                    X