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
-
It was happening because I had 6 rows and 6 grids instead of 6 rows in 1 grid. I changed to one grid, issue got fixed
-
Hi Chelsea
Me again. Still can't wrap my head around creating more buttons/grids.
I followed your model and added a second lower grid (lower1buttonsgrid ) with a further 2 buttons
Code:lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition()); lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition() { Width = new GridLength((double)Application.Current.FindResourc e("MarginBase")) }); lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());
Code:addedRow3 = new System.Windows.Controls.RowDefinition() { Height = new GridLength(31) };
Code:System.Windows.Controls.Grid.SetColumn(buttonsArra y[4], 0); System.Windows.Controls.Grid.SetColumn(buttonsArra y[5], 2); for (int i = 4; i < 6; ++i) lower1ButtonsGrid.Children.Add(buttonsArray[i]);
Code:if (chartTraderButtonsGrid != null || lower1ButtonsGrid != null) { chartTraderGrid.Children.Remove(lower1ButtonsGrid) ; chartTraderGrid.RowDefinitions.Remove(addedRow3); }
Its so frustrating. User fawzanalim managed to kindly share his code with 12 buttons but that has issues when you reload ( it moves all the instrument and account details downwards underneath the new buttons upon reload).
If you can help I would be most grateful.
Attached FilesLast edited by Mindset; 10-13-2021, 08:11 PM.
Comment
-
It contains 12 buttons. Haven't faced any issues so far. But my buttons are in the uppergrid, not lowergrid.Attached FilesLast edited by fawzanalim; 10-13-2021, 11:46 PM.
Comment
-
Comment
-
Hello Mindset,
Take one step at a time.
First, are any errors appearing on the Log tab of the Control Center?
Are the indexes used all correct and smaller than the size of the collection?
Are the buttons being added to the proper columns in your custom grid?Chelsea B.NinjaTrader Customer Service
Comment
-
Hi Chelsea B
Simple dumb error that #fawzanalim helped me solve. I had the wrong margins when setting the buttons - so buttons were written over each other or not at all etc! that only took a month to sort out.
On with the next issue!
Edit - code for 8 buttons provided here as raw material for anyone else having similar issues/ looking to learn
Please note I have found in using it every now and again it won't load/fouls up - throw the chart away and use another one; works for me!
Ps Chelsea, I get nothing in the logs when this happens.Attached FilesLast edited by Mindset; 10-16-2021, 01:11 AM.
- Likes 1
Comment
-
Hi Chelsea, Thank you for the amazing sample code. I took ChartCustomToolbarExample and modified to have only the top toolbar. I simply removed all the references to left*
to get rid off the left toolbar. It didn't work. I still get blank left toolbar. Any clues? TY!
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello cay7man,
Is the menu still being created and added to the chart grid?
For the top toolbar, Yes. Looks fine. Left bar is blank and couldn't be removed. I'm attaching the modified code...Attached Files
Comment
-
Hi Chelsea,
Thanks for the sample code. I've been using it for awhile now. Everything seems to work properly, but I get this weird bug sometimes. All my buttons disappear except the last row. I tried to regenerate the bug a lot, but couldn't. It happens with any buttons. It's working fine, all of a sudden all the buttons are gone when I pressed a button. There is no log messages. In order to bring those buttons back, I have to remove the script and add it again. Any idea whats causing this issue?
Comment
-
Originally posted by Subhash Badri View PostStill not working
I followed the exact steps like you suggested. I checked the custom\indicators folder and the file is present and I hope that confirms that import was successful.
I launch the chart but do not see any button controls.
I have the same issue man! did everything as yousaid and no changes.. what else can you suggest?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
32 responses
266 views
0 likes
|
Last Post
by f.saeidi
Yesterday, 06:49 AM
|
||
Started by Mestor, Today, 03:15 AM
|
0 responses
2 views
0 likes
|
Last Post
by Mestor
Today, 03:15 AM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
11 responses
306 views
0 likes
|
Last Post
by z.franck
Today, 02:29 AM
|
||
Started by Padan, Today, 02:02 AM
|
0 responses
6 views
0 likes
|
Last Post
by Padan
Today, 02:02 AM
|
||
Started by bukowa, 11-09-2023, 06:07 PM
|
20 responses
409 views
0 likes
|
Last Post
by Adfra
Today, 01:36 AM
|
Comment