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!
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
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 :
Code:if (null != myTimeAndSalesBidPriceText) { myTimeAndSalesBidPriceText.Text += " and a nickel"; }
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
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
46 views
0 likes
|
Last Post Today, 02:36 PM | ||
Started by arvidvanstaey, Today, 02:19 PM
|
1 response
6 views
0 likes
|
Last Post Today, 02:33 PM | ||
Started by mmckinnm, Today, 01:34 PM
|
3 responses
5 views
0 likes
|
Last Post Today, 02:12 PM | ||
Started by f.saeidi, Today, 01:32 PM
|
2 responses
9 views
0 likes
|
Last Post
by f.saeidi
Today, 02:10 PM
|
Comment