Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Modifying Time And Sales...
Collapse
X
-
Modifying Time And Sales...
I would like to modify the T&S window to display the cumulative trades as they scroll by For instance, if 10 trades fired off at bid, I would like to display that total as opposed to each individual. Would I do this as an "AddOn"? Can I modify an existing T&S window as opposed to reinventing the wheel?Tags: None
-
Hello funk101,
I have submitted a feature request to the product management team for the following feature :
This user would like to be able to add customizable columns to the T&S window, similar to MarketAnalyzerColumnsI will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.
I am also preparing a starter sample for the T&S window which will allow you to access it from an add-on.
Please let us know if there are any other ways we can help.Jessica P.NinjaTrader Customer Service
-
Thank you for the starter template looking forward to it. However, as far as the feature request, adding a column will not achieve the same result as I am requesting if you think about it. I think the data has to be accumulated before it is displayed, adding a column would just, well, add a column to each individual trade. Maybe I'm missing something? Anyway, thanks for the template.
Comment
-
I would be happy to clarify my intent with this feature request. With the ability to add a column, you could run a simple check to see if the previous row was the same type of trade as the current row, and if this was the case, you could accumulate data from the previous row into this row's data and display it. For instance, if 10 trades occurred at the bid, and then 10 more, and then 8 more, before 10+ trades occurred at the ask, and your block size is 10, you would be able to display information for all 38 trades at the bid in a single cell. The information for the 1st 10 trades would appear in this row for the first 10 trades at bid, the first 20 trades in the 2nd row, and all 38 trades in the third row.Jessica P.NinjaTrader Customer Service
Comment
-
This is awesome, but I have no clue where to begin. This code will sort of "override" the existing T&S window? Is there anything you can point me to that I can reverse engineer? Like the T&S code where it get's the marketdata, etc? Not used to seeing this code in NT. Not as familiar as the DrawingTools, or Indicator base code.
Comment
-
I would be happy to walk through this code.
Add-ons have a method OnWindow that is created whenever any kind of window is created. This code tries to see if the created window is a Time and Sales window and, if it is, it sets up another process OnTnSWindow to be called once a second. If you would like this to happen more often, I have defined the constants ONE_US, ONE_MS, and ONE_S to represent one microsecond, one millisecond, and one second, respectively. For example, 100 milliseconds would be 100 * ONE_MS . You would make this change on line 81.
At any rate, inside the method OnTnSWindow, I have used the instructions my colleague Jesse put together here, http://ninjatrader.com/support/forum...44&postcount=7 , to dissect the various parts of the Time and Sales window itself, and I have made them available to you. For example, myTimeAndSalesAskPriceText allows you to read or modify the Ask price at the top of the Time and Sales window.
This is as far as I have gone with this script. It is intended as a sort of a blank canvas you can use to decide how you would like the Time and Sales window to be displayed. As an exercise to get you familiar with using add-ons of this type, and to help you modify the time and sales window however you see fit, I would like to recommend you review the publicly available MSDN documentation on System.Windows.Controls.TextBlock at this link,
With that documentation, I would then add code to this add-on after line 125 like the following :
You can see this addition in the attached picture. I have attached the revised code as well. This is probably the best place to start reverse engineering from.Code:if (null != myTimeAndSalesBidPriceText) { myTimeAndSalesBidPriceText.Text += " and a nickel"; }Jessica P.NinjaTrader Customer Service
Comment
-
You will need to have data coming in to the T&S window for this to work I have made a video going over everything in my most recent post. Please let me know if any questions come up I may answer.
Jessica P.NinjaTrader Customer Service
Comment
-
I realize that I made a typo with the first version of my script that is not in the second version of my script. If you have not already, please use the second version of my script completely, or copy / paste the following over your existing OnTnSWindow method.
Code:[FONT=Courier New] private static void OnTnSWindow(object s, WindowEventArgs e) { Gui.TimeAndSales.TimeAndSalesControl myTnSControl = e.Window.FindFirst("TimeAndSalesControl") as Gui.TimeAndSales.TimeAndSalesControl; System.Windows.Controls.TabControl myTimeAndSalesTabControl = e.Window.FindFirst("TimeAndSalesTabControl") as System.Windows.Controls.TabControl; System.Windows.Controls.TextBlock myTimeAndSalesAskText = e.Window.FindFirst("TimeAndSalesAskText") as System.Windows.Controls.TextBlock; System.Windows.Controls.TextBlock myTimeAndSalesBidText = e.Window.FindFirst("TimeAndSalesBidText") as System.Windows.Controls.TextBlock; System.Windows.Controls.TextBlock myTimeAndSalesAskPriceText = e.Window.FindFirst("TimeAndSalesControlAskPriceText") as System.Windows.Controls.TextBlock; System.Windows.Controls.TextBlock myTimeAndSalesAskSizeText = e.Window.FindFirst("TimeAndSalesControlAskSizeText") as System.Windows.Controls.TextBlock; System.Windows.Controls.TextBlock myTimeAndSalesBidPriceText = e.Window.FindFirst("TimeAndSalesControlBidPriceText") as System.Windows.Controls.TextBlock; System.Windows.Controls.TextBlock myTimeAndSalesBidSizeText = e.Window.FindFirst("TimeAndSalesControlBidSizeText") as System.Windows.Controls.TextBlock; if (null != myTimeAndSalesBidPriceText) { myTimeAndSalesBidPriceText.Text += " and a nickel"; } }[/FONT]Jessica P.NinjaTrader Customer Service
Comment
-
I'm kind of reviving this thread because I pulled this code to access TnS "source code".
Firstly, I'm wondering if there is a better way to do this now since it's been a few years.
If this is still the best way to pull the data, I am trying to build the orderflow labs "bubble tape" kind of thing that I've seen.
My first question being, is it possible to take in an integer (size of last trade) and then output a shape of some kind? And then have the size and color of said shape be dependent on trade size and direction (at bid/ask).
Also having thought about it some more, would the size of these shapes possibly cause ninja to break if the size isn't restricted to the given row on the times and sales?
Thank you for any help
Comment
-
Hello Entropy7,
Thanks for your note.
We are looking into your inquiry at this time and will get back to you with more information as soon as we have researched this topic further.
Thanks for your patience. I look forward to further assisting.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment