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

  • Mindset
    replied
    Hi Chris_L
    Thanks but I had already found that and
    that doesn't work in playback

    if(e.Price >= e.Ask)
    ......

    The T& S shows it as an Above Ask trade but the code does not fire.


    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi Mindset, thanks for posting. The best way to do this is detailed in the "BuySellVolume" indicator that is in the Indicators folder of the NinjaScript Editor. Tick Replay needs to be used for this for the historical chart data.

    Leave a comment:


  • Mindset
    replied
    How can I compare the latest price to say the last ask and detect when it is above ?
    Ive tried everything I can think of - saving Close[0] to a variable, putting that variable into OnMarketDepth, putting Close[0] into the method, using GetCurrentAsk(0) ,etc and it just pumps out errors or doesn't give the desired ouput.

    Leave a comment:


  • 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:



    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:	587
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:



    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";
    
    [B]Print("Above Ask" + " / " + marketDataUpdate.Volume);[/B]
    }
    else if (marketDataUpdate.Price < marketDataUpdate.Bid)
    {
    AboveWhich = "Below Bid";
    
    [B]Print("Below Bid" + " / " + marketDataUpdate.Volume);[/B]
    }
    
    //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 cmtjoancolmenero, Yesterday, 03:58 PM
12 responses
42 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by FrazMann, Today, 11:21 AM
0 responses
5 views
0 likes
Last Post FrazMann  
Started by geddyisodin, Yesterday, 05:20 AM
8 responses
52 views
0 likes
Last Post NinjaTrader_Gaby  
Started by DayTradingDEMON, Today, 09:28 AM
4 responses
27 views
0 likes
Last Post DayTradingDEMON  
Started by George21, Today, 10:07 AM
1 response
22 views
0 likes
Last Post NinjaTrader_ChristopherJ  
Working...
X