But we can always think about paint events as the last resort.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Plot() method in NT8 ???
Collapse
X
-
Plot Override
NinjaTrader,
I originally posted this on the BigMikeTrading site and was advised that I should post on the NT Forum instead so hopefully I have found the right place. I am not part of the closed group involved in the Beta Test so I will wait for others to work out solutions if this question is too early. I hope my points prompt thoughts or answers from others.I understand that the technologies are different but... can the same type of feature made available to help with at least a speedy transition?
Q) I know there is going to be a new way of drawing objects on the screen in NT8. Is there however going to be a some way we can access similar Plot Override functionality along with the Graphics Object?I have about 12000 lines of a partially completed project where I have used this NT7 functionality extensively. It would be nice if there was some way to use this functionality and make the job of porting our work a little easier.In essence, All my calculations are done in the On Bar Update Section. I use Plot Override to simply to render drawing objects to the screen. I would have stayed with the built-in NT7 Ninjascript commands if I hadn't met a number of limitations along the way.
I am getting the horrible feeling from reading the little info available that I am looking at another learning curve and possibly a complicated rewrite.
Thanks in advance for the response.
Answer from NT so far.
This level of question is best suited for the NinjaTrader 8 section of our own support forum. That being said, NT7 uses Winforms while NT8 for charts uses DirectX hosted in WPF window. My point is the technologies are completely different for those doing custom rendering.
Maybe I just need to find some tutorials / introduction materials on WPF in relation to NinjaTrader.
One example of why I use Plot Override in NT is to do with scaling (dynamic shrinking and expanding) of text (above / below Price bars) and drawing objects (e.g. synthetic bars) on the screen when I increase or decrease the number of price bars displayed.
Regards,
Comment
-
@MBScalper
Without quoting your post, the short answer is YES.. Everything you can do in NT7 you can do in NT8 and/or more/better/easier (just different)! Conversions of most indicators won't be a real difficult process! EXCEPT for those that were implementing the PlotOverride.. That part is completely and totally different in almost every aspect! For me, because I used this method extensively, that part has been the hardest and both a daunting and exhaustive process! Both from a learning curve on my part, and the actual conversion itself. (mainly due to my lack of knowledge and ignorance in this area, as well as the lack of current documentation at the moment) (although I'm sure that is to come, and there are several code example references all over the place inside the platform).. But to ease your mind and others, everything to the right of the bars here in this pic was done in the now OnRender override.
But if your inexperienced like myself in WPF, and using this technique, get ready for a brand new learning curve, and some extensive rework of existing code!
Initially in the short term here you might be thinking that's a bummer.. BUT Long Term, WOW!.. This new structure is going to open up a whole new world of ideas, capabilities, and development for the NinjaTrader Community!!!
Comment
-
Thank you Edge for taking the time to reply to my post and thank you for the reassurance. The attached Chart does make me help me feel better about things. This does look like you can set margins, text size, draw custom shapes etc. through OnRender even without the graphics object.
I have programmed in many languages over the years as part of my job but only started programming in C# about 8 months ago so I am very new to the C# thing. Despite this I have learned a lot and developed things in NT that I could only have dreamed about developing on other platforms. I hope to pick up new knowledge and move my work to NT8 when possible.
No doubt, WPF is the direction the platform should go. Maybe someone will be kind enough as the beta gets underway to produce a WPF introduction document for those familiar with custom development in NT7. I look forward to the public beta release so that I can start transitioning.
Thanks again
Comment
-
Were those VWAP line plots and opacity fill between the upper and lower line plots were also done in OnRender? Thanks!
Originally posted by -=Edge=- View Post@MBScalper
Without quoting your post, the short answer is YES.. Everything you can do in NT7 you can do in NT8 and/or more/better/easier (just different)! Conversions of most indicators won't be a real difficult process! EXCEPT for those that were implementing the PlotOverride.. That part is completely and totally different in almost every aspect! For me, because I used this method extensively, that part has been the hardest and both a daunting and exhaustive process! Both from a learning curve on my part, and the actual conversion itself. (mainly due to my lack of knowledge and ignorance in this area, as well as the lack of current documentation at the moment) (although I'm sure that is to come, and there are several code example references all over the place inside the platform).. But to ease your mind and others, everything to the right of the bars here in this pic was done in the now OnRender override.
But if your inexperienced like myself in WPF, and using this technique, get ready for a brand new learning curve, and some extensive rework of existing code!
Initially in the short term here you might be thinking that's a bummer.. BUT Long Term, WOW!.. This new structure is going to open up a whole new world of ideas, capabilities, and development for the NinjaTrader Community!!!
Comment
-
Originally posted by ninZa View PostHi Edge,
Can you recommend some good webpages on the net for us to learn WPF ourselves?
Thank you very much.
Pi
www.codeprojects.com
www.stackoverflow.com
both provide great references for any number of things.. not just wpf..
just an example
In this section we will run through important WPF interview questions asked during .NET interviews. I know the list is not complete but wanted to at least start with something and then keep adding as time goes.
Comment
-
Originally posted by lawyse View PostWere those VWAP line plots and opacity fill between the upper and lower line plots were also done in OnRender? Thanks!
Comment
-
Originally posted by -=Edge=- View PostTo be honest, when I'm stuck I just do a yahoo search.. But tend to like both of these sites..
www.codeprojects.com
www.stackoverflow.com
both provide great references for any number of things.. not just wpf..
just an example
In this section we will run through important WPF interview questions asked during .NET interviews. I know the list is not complete but wanted to at least start with something and then keep adding as time goes.
I also find useful articles at http://www.wpf-tutorial.com
Comment
-
Originally posted by -=Edge=- View Post@MBScalper
everything to the right of the bars here in this pic was done in the now OnRender override.
For example, shading between plots, all the Profile stuff, etc?
Thanks!
Comment
-
Originally posted by ninZa View PostThanks. There are a lot of new things to learn
What about the toolbar? Is it still ToolStrip, with which we can get the toolbar as:
toolStrip = (ToolStrip)ChartControl.Controls["tsrTool"];
Thank you.
Pi
Here is my first AddOn:
Code:using NinjaTrader.Gui; using NinjaTrader.Gui.Tools; using NinjaTrader.NinjaScript; using NinjaTrader.NinjaScript.Indicators; using System; using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Automation.Peers; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Media; public class MyWindowAddOn : AddOnBase { private NTMenuItem myMenuItem; private NTMenuItem existingMenuItem; protected override void OnWindowCreated(Window window) { foreach (Button btn in FindVisualChildren<Button>(window)) { if (btn != null && btn.HasContent && btn.Content is string) { var text = btn.Content.ToString(); if (text == "OK") { btn.Content = "_" + btn.Content; btn.IsDefault = true; } if (text == "Cancel") { btn.Content = "_" + btn.Content; btn.IsCancel = true; } if (text == "Apply") { btn.Content = "_" + btn.Content; } } } } public static IEnumerable<T> FindVisualChildren<T>(DependencyObject depObj) where T : DependencyObject { if (depObj != null) { for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++) { DependencyObject child = VisualTreeHelper.GetChild(depObj, i); if (child != null && child is T) { yield return (T)child; } foreach (T childOfChild in FindVisualChildren<T>(child)) { yield return childOfChild; } } } } }
I'm looking for a way to find all controls on Window by their type, for example: find all TextBoxes, find all controls implementing specific interface etc.
VisualTreeHelper seems to be the key to WPF.
Code:foreach (NTMenuItem item in FindVisualChildren<NTMenuItem>(window)) { }
Comment
-
Originally posted by neoikon View PostDo you have any code examples you can share to accomplish what you have in that pic? For example, shading between plots, all the Profile stuff, etc? Thanks!
Although you could look at the default VolumeZones and VolumeProfile indys that come in NT8 to spark some idea's and possibly get you started in the right direction..
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, Yesterday, 06:40 PM
|
2 responses
23 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
||
Started by ghoul, Today, 06:02 PM
|
3 responses
14 views
0 likes
|
Last Post Today, 06:43 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
45 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
22 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
181 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
Comment