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

print Above ask Above bid from T & S

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

    print Above ask Above bid from T & S

    print Above ask Above bid from T & S

    Hello, How can I get this print
    analog from T&S columns (filters)

    Above ask
    Above bid

    Need a real example of how I can get it

    #2
    Hello memonolog,

    Thank you for your reply.

    I'm assuming you're meaning how to find which updates are below the bid, not above it, since that would also include ones above the ask. You can get this data within OnMarketUpdate(). I'm attaching an example indicator that will print the most recent ask/bid updates to the NinjaScript Output window if they are above ask or below the bid.

    Please let us know if we may be of further assistance to you.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello memonolog,

      Thank you for your reply.

      I'm assuming you're meaning how to find which updates are below the bid, not above it, since that would also include ones above the ask. You can get this data within OnMarketUpdate(). I'm attaching an example indicator that will print the most recent ask/bid updates to the NinjaScript Output window if they are above ask or below the bid.

      Please let us know if we may be of further assistance to you.
      Thanks for the basic example, but the data from the T&S does not match the results of this script. The question remains open, how exactly the data is filtered and how to get it in the printout from T&S, I am interested in how to get what is issued under
      Above ask
      Below bid

      Comment


        #4
        I want to get the result in printout only Above ask Below bid:

        Code:
        protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
        {
        if (marketDataUpdate.MarketDataType != MarketDataType.Last)
        return;
        
        if (marketDataUpdate.Price > marketDataUpdate.Ask)
        {
        AboveWhich = "Above Ask";
        
        Print("Above Ask" + " / " + marketDataUpdate.Volume);
        }
        else if (marketDataUpdate.Price < marketDataUpdate.Bid)
        {
        AboveWhich = "Below Bid";
        
        Print("Below Bid" + " / " + marketDataUpdate.Volume);
        }
        
        //Print(string.Format("{0:HH:mm:ss} | last: {1:0.00}, ask: {2:0.00}, bid: {3:0.00} | volume: {4} | color: {5}", marketDataUpdate.Time, marketDataUpdate.Price, marketDataUpdate.Ask, marketDataUpdate.Bid, marketDataUpdate.Volume, AboveWhich));
        }
        but nothing

        Comment


          #5
          Hello memonolog,

          Thank you for your reply.

          We've checked on this with our development team and it looks like the T&S window actually involves comparing against Level 2 data. I've created an example of printing just the ask and bid rows that are above or below the current bid or ask price. The attached is just a modification of the SampleLevel2Book indicator found here:

          https://ninjatrader.com/support/help...vel_ii_dat.htm

          Please let us know if we may be of further assistance to you.


          Attached Files
          Kate W.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Kate View Post
            Hello memonolog,

            Thank you for your reply.

            We've checked on this with our development team and it looks like the T&S window actually involves comparing against Level 2 data. I've created an example of printing just the ask and bid rows that are above or below the current bid or ask price. The attached is just a modification of the SampleLevel2Book indicator found here:

            https://ninjatrader.com/support/help...vel_ii_dat.htm

            Please let us know if we may be of further assistance to you.

            I don’t understand what has to do with this level 2 and the book, if I need past transactions

            Below I am attaching a picture from the TS of what I need to get.

            Click image for larger version

Name:	TS.png
Views:	212
Size:	101.5 KB
ID:	1130550

            Comment


              #7
              Hello memonolog,

              Thank you for your reply.

              The information from the development team is simply that the way in which the T&S window gets those values is by checking level 2 data against the current bid and ask prices. The example provided is simply one way to display that information. You would need to work with that logic on your end to display the orders like the T&S window.

              Please let us know if we may be of further assistance to you.
              Kate W.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Kate View Post
                Hello memonolog,

                Thank you for your reply.

                The information from the development team is simply that the way in which the T&S window gets those values is by checking level 2 data against the current bid and ask prices. The example provided is simply one way to display that information. You would need to work with that logic on your end to display the orders like the T&S window.

                Please let us know if we may be of further assistance to you.
                the last example does not work for me, I cannot get the result that I need in the output window, all that is in the output is the two hanging lines

                Above Ask Book
                Below Bid Book

                so the question remains open, how can I solve the problem of getting this data into the output window?

                Comment


                  #9
                  Hello memonolog,

                  Thank you for your reply.

                  I've just tested with the above script and I am seeing values printed. If you're not seeing the same, can you confirm the following:

                  Are you using the latest version of NinjaTrader? The current version is 8.0.23.2. You can check this under Help > About.

                  Do you receive L2 data from your provider? You may want to confirm your account is set up to receive L2 data.

                  On what instrument did you test the script?

                  Thanks in advance; I look forward to assisting you further.
                  Kate W.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_Kate View Post
                    Hello memonolog,

                    Thank you for your reply.

                    I've just tested with the above script and I am seeing values printed. If you're not seeing the same, can you confirm the following:

                    Are you using the latest version of NinjaTrader? The current version is 8.0.23.2. You can check this under Help > About.

                    Do you receive L2 data from your provider? You may want to confirm your account is set up to receive L2 data.

                    On what instrument did you test the script?

                    Thanks in advance; I look forward to assisting you further.

                    I do not have the latest version of the platform, today I will update and check.

                    I have another question right away, if the example script you provided above works, what needs to be done to get prints of past transactions only that have passed on the current high or low price update of the day?

                    I have to enter those deals that in the base time and sales, are marked with L or H. how do i get the prints only marked H / L?

                    thank you in advance.

                    Comment


                      #11
                      Hello memonolog,

                      Thank you for your reply.

                      Since the H/L is printed only if the incoming update is above or below the current session high or low, you could call the CurrentDayOHL indicator within OnBarUpdate and use that to get the current high and low, then save those to a variable, then check the incoming update in OnMarketData against those variables and if it is higher or lower print it.

                      Please let us know if we may be of further assistance to you.
                      Kate W.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by johnMoss, Today, 10:12 AM
                      1 response
                      6 views
                      0 likes
                      Last Post NinjaTrader_Kate  
                      Started by thaison316, 03-29-2021, 03:12 PM
                      4 responses
                      47 views
                      0 likes
                      Last Post NinjaTrader_Kate  
                      Started by WHICKED, Today, 09:51 AM
                      1 response
                      13 views
                      0 likes
                      Last Post NinjaTrader_Kate  
                      Started by simple_goodoboy, Today, 09:15 AM
                      1 response
                      15 views
                      0 likes
                      Last Post NinjaTrader_Kate  
                      Started by debleded, Today, 09:10 AM
                      1 response
                      16 views
                      0 likes
                      Last Post NinjaTrader_Kate  
                      Working...
                      X