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

  • NinjaTrader_Kate
    replied
    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.

    Leave a comment:


  • memonolog
    replied
    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.

    Leave a comment:


  • NinjaTrader_Kate
    replied
    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.

    Leave a comment:


  • memonolog
    replied
    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?

    Leave a comment:


  • NinjaTrader_Kate
    replied
    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.

    Leave a comment:


  • memonolog
    replied
    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:	239
Size:	101.5 KB
ID:	1130550

    Leave a comment:


  • NinjaTrader_Kate
    replied
    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

    Leave a comment:


  • memonolog
    replied
    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

    Leave a comment:


  • memonolog
    replied
    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

    Leave a comment:


  • NinjaTrader_Kate
    replied
    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

    Leave a comment:


  • memonolog
    started a topic print Above ask Above bid from T & S

    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

Latest Posts

Collapse

Topics Statistics Last Post
Started by AlessioCianini12, Today, 01:55 PM
0 responses
2 views
0 likes
Last Post AlessioCianini12  
Started by rajneesh.sehgal, Today, 12:06 PM
1 response
8 views
0 likes
Last Post NinjaTrader_ChristopherJ  
Started by mo_fi, 01-21-2021, 10:08 PM
22 responses
1,313 views
0 likes
Last Post Wessel
by Wessel
 
Started by ezrollin, 01-12-2022, 03:43 PM
2 responses
40 views
0 likes
Last Post iq200
by iq200
 
Started by Red_70, Today, 11:07 AM
3 responses
16 views
0 likes
Last Post Red_70
by Red_70
 
Working...
X