![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jun 2011
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
Hello,
I've been toying around with the BarTimer indicator to customize it a little. I can do this, but I still don't really understand how the BarTimer indicator is being plotted. For example, the Plot() method is being overwritten in both the BarTimer and the TickCounter indicators. But I don't see anywhere where this method is being called. No Plots are added to the chart. Plot values are not being set. etc. Could someone please tell me how the Plot() method is being used in the BarTimer and/or TickCounter methods? How/when is this method being called to make these indicators update properly? From where is the Plot() method being called? etc. Like I say, I understand these indicators enough to modify them to work like I want them to, but I would really like to understand how they are being plotted. On this point, I'm confused. Thanks in advance for any help with this question. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 973 times in 956 posts
|
flonkle, these indicators are using advanced C# technique to achieve the display for which we here unfortunately could only offer limited support. In the Misc section the default Plot() method is overridden to allow for custom plotting / drawing with C#, this happens with the graphics.DrawString call later in this method code section then.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jun 2011
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
I understand that the default Plot() method is overridden and that graphics.DrawString is doing the drawing.
I just want to understand the flow of control of the program so I can do stuff like this on my own if the need arises. In other words, what method is calling the Plot() method that is overridden in the BarTimer and TickCounter indicators? In the BarTimer indicator, the timer has a tick event that triggers multiple times a second and calls this eventhandler method: Code:
private void OnTimerTick(object sender, EventArgs e)
{
if (DateTime.Now.Subtract(lastTimePlot).Seconds >= 1 && DisplayTime())
{
ChartControl.ChartPanel.Invalidate();
lastTimePlot = DateTime.Now;
}
}
As far as the TickCounter indicator is concerned, I see nowhere where the Plot() method is or even could be called. No events are thrown within the code, and the OnBarUpdate() method, which is called on every incoming tick, is empty. Please tell me how/when/where the Plot() method is being called in these indicators. I'd like to know so I can learn from these indicators as code examples. Thanks. P.S. There could be something going on in the NinjaTrader.Gui.Chart namespace that is calling the Plot() method. That is one of my guesses at the moment. Or, there could be something going on with the Indicator class itself, under the hood, that is doing the call. In any case, as a side question, is there any way for us end-users to see the structure of classes like NinjaTrader.Indicator.Indicator or the NinjaTrader namespace in general? |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jun 2011
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
Anyone... bueller... bueller...
![]() I'm not trying to be a pain in the butt, so I apologize for hounding you guys for an answer about this. I do appreciate the NT staff answering me at all. However, if the NT guys are going to respond to this thread, I would appreciate an answer that addresses the question I actually posed in the thread, instead of giving me an answer that evades the question. If the NT guys are still monitoring this thread, please tell me about how the Plot() method is being called in the BarTimer and TickCounter indicators. If you can't tell me this, e.g. in order to protect the proprietary interests of NT, please inform me of this informational constraint, instead. Also, I would like to know how/if we end-users can learn about the structure of the NinjaTrader namespace and the classes within it. Again, if this is proprietary info that NT does not want to divulge to end-users, please tell me so in response to this thread. Thanks. |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 973 times in 956 posts
|
flonkle, working the overriden Plot() method is not officially supported / documented by us - it's available for advanced C# coders to offer the utmost of flexibility - to make yourself more familiar with it and start experimenting I would suggest checking into the CustomPlotExmaple shipped with NT for that purpose.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jun 2011
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
Thanks. I'll look into the CustomPlotExample to see what I can find out from it.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Incorrect output from TickCounter | MikeInMA | Version 7 Beta General Questions & Bug Reports | 1 | 10-18-2010 12:43 PM |
| TickCounter text location | ssg10 | Indicator Development | 4 | 02-10-2009 01:53 AM |
| TickCounter comes with sound alert? | Greenmoney21 | Suggestions And Feedback | 12 | 08-07-2008 05:38 AM |
| TickCounter | T.D.NINJA | Suggestions And Feedback | 1 | 06-04-2008 03:55 PM |
| TickCounter Indicator (Download) Version 5 Only | NinjaTrader_Ray | Indicator Development | 0 | 04-06-2006 01:28 PM |