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
Modifications to chart WPF elements and tab considerations
Collapse
X
-
Originally posted by Entwaze View PostYou can delete this thread, i found a way to get the automation id of everything
This thread should not (and hopefully will not) be deleted.
It has a large amount of historical information, aka large number of postings.
If you wish to delete your individual posts in this thread, that's entirely up to you.
- Likes 2
Comment
-
-
The thread belongs to NinjaTrader_ChelseaB. It is not something they would likely delete as it was created here for a reason.Last edited by QuantKey_Bruce; 07-03-2023, 06:13 PM.
Comment
-
I think She moved it,
The solution i used was to go through the children in the WPF module to find them, you can do this not only with the chart window, but every element that exists that you have access.
// GRAB MAIN WINDOW
MAIN_CHART_WINDOW = System.Windows.Window.GetWindow (ChartControl.Parent) as Chart;
//GRAB CHART TRADER,BUT ALSO GRAB CHART TRADER GRID, ASSIGN TO GLOBAL VARIABLES
if (MAIN_CHART_WINDOW != null)
{
CHART_TRADER = (MAIN_CHART_WINDOW.FindFirst ("ChartWindowChartTraderControl") as ChartTrader);
CHART_TRADER_GRID = CHART_TRADER.Content as Grid;
}
last just loop through CHARTTRADERGRID.Children , ensure that it is not null first and print the the type of each element
get type of element with CHART_TRADER_GRID.Children[i].GetType () ; PRINT THAT SHEET
test conditions with typeof(THE TYPE THAT YOU PRINT)
- Likes 1
Comment
-
So to extend upon this for food for thought, you could also loop through all window children and get their type then, when you hit the typeof(ChartTrader ) nice because of the object reference you can just initialize a global to that and then boom you have access to chart trader throughout your script without using findfirst with heart automation ids
can also test:
- Names
- Content
- Other elemental properties
- Likes 1
Comment
-
Does anyone know how to modify the background color of the sub-menu items for use case #4? When you have NinjaTrader using a black or slate background, the main menu items have a background of black, but I cant figure out how to modify the background color or font color of the sub menu item menus.
Comment
-
Hello NT team,
Based on the nice examples you have provided to implement buttons on the side of the chart, I have created a series of buttons for use on my charts. On NT8 ver.8.0.27, the buttons fitted into the grid space with room to spare on the bottom (NT8027_grid.png). However with NT8 ver.8.1.17, the size of the buttons has increased significantly (NT81117_grid1.png), which resulted in many buttons not showing on the screen.
Is there an easy way to fix this?
Comment
-
Hello kkc2015,
You can set the Width and Height of a System.Windows.Controls.Button to be smaller.
Note, I am not seeing this behavior with the SampleWPFModifications reference sample. Trying using the code from this example linked in the help guide from post # 1 in this thread.Chelsea B.NinjaTrader Customer Service
Comment
-
You could also adjust the padding or margins. And, check if you have changed the scale and layout size of your monitor (possibly from 100% to 125% or 150%?) as this can affect how these appear as well. It is possible to program these UI elements to behave well for all different scale settings, and it's also possible to not do that, and almost certainly easier.
Comment
-
Hi Chelsea and QuanKey_Bruce,
Thank you both for the quick response. QuanKey_Bruce is correct that the issue is caused by monitor scaling, as the latest NT8 is installed on my laptop with 200% layout scaling. The side buttons on the NT8 charts are implemented for a 4k display and I knew that not all buttons would be visible on a 2k display.
Thank you both again, much appreciated.
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello REI140205,
Possibly you could set and look for AutomationID's with strings that have a incremented value.. You could use string.Substring to match the first part of the string, parse the number on the second part of the string, and this would tell you how many times that control has been added to the wpf on that tab. Each time the is added and there is already one existing, you might change the color for the new object.
The ChartToolBarCustomMenuExample shows a little of finding and setting AutomationIds.
How can more buttons be added to the left menu panel of the WPF EXAMPLE?
Thanks
Bob Perez
Comment
-
Hello Bob,
See the regions '#region Use case #2: Custom left toolbar' in the SampleWPFModifications reference sample.
In the CreateWPFControls() method the toolbarLeftMenuButton2 is a button that is added to the customToolBarVerticalStackPanel.
You can also create a button and add this to the customToolBarVerticalStackPanel.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Graci117, Today, 09:02 PM
|
1 response
6 views
0 likes
|
Last Post Today, 09:09 PM | ||
Started by ETFVoyageur, Today, 07:55 PM
|
0 responses
7 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:55 PM
|
||
Started by janio973, Today, 07:24 PM
|
1 response
7 views
0 likes
|
Last Post Today, 07:35 PM | ||
Started by aligator, 01-06-2022, 12:14 PM
|
4 responses
246 views
0 likes
|
Last Post
by john_44573
Today, 06:11 PM
|
||
Started by reynoldsn, Today, 05:56 PM
|
0 responses
14 views
0 likes
|
Last Post
by reynoldsn
Today, 05:56 PM
|
Comment