![]() |
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: Feb 2012
Posts: 25
Thanks: 0
Thanked 2 times in 2 posts
|
Hi
Quite a while back Roonius posted a simple Plot Override indicator that showed 12 static lines printed into the right margin using Plot Override. (I can't find that explicit post again, sorry). I understand how the Plot Override is working but I can't figure out how it is actually invoked. There is an OnBarUpdate() but it has no statements in it. There is an Initialize where the pens and brushes are defined. But that's it. The lines are made to show by selecting a user parameter to "true" and it all works beautifully, But I don't see how the Plot is "called". Can anyone shed any light on this, and/or point me in the direction of the C# explanation of this behaviour? thanks in advance |
|
|
|
|
|
#2 | |
|
Senior Member
|
Quote:
There is no Plot() statement in the OnBarUpdate() event handler, because the code was written to call the default Plot() function. It is just like any other event handler/function, where you can define a new function that calls another function, so that the new function when called shows no explicit call to the called function.
Last edited by koganam; 03-18-2012 at 09:31 PM.
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2012
Posts: 25
Thanks: 0
Thanked 2 times in 2 posts
|
many thanks for the explanation Koganam.
I'm sure with a bit more C# experience I will understand it, lol. I get the gist though, many thanks. Can I mix this type of plot override with the usual Ninja Plot functions ? for example I would like to show 3 or 4 Ninja plots together with my own custom label plots... say by "Calling" specific instances of the custom label plot under certain circumstances. (Edit: I will leave that question in to provide context but I think I see the answer is that I can do anything providing my C# skills are up to the mark! unlucky me then :-) However may I ask where the arguments for the Plot Override are created? public override void Plot(Graphics graphics, Rectangle bounds, double min, double max) The reason I ask is so that if I create my own customPlot( arguments ) I know how to create the bounds, min and max values ... thanks again your help is appreciated.
Last edited by I_Quant; 03-18-2012 at 11:33 AM.
|
|
|
|
|
|
#4 | |
|
Senior Member
|
Quote:
Last edited by koganam; 03-18-2012 at 09:31 PM.
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access data into override Plot | skuvv | Indicator Development | 0 | 12-12-2011 09:34 AM |
| Arraylist, List and override Plot weirdness.. | darthtrader | Indicator Development | 0 | 05-16-2011 09:49 AM |
| Question about public override void Plot() | rcsingleton | Indicator Development | 7 | 04-18-2011 10:18 AM |
| Plot Override | chantj | Indicator Development | 2 | 04-09-2008 09:10 AM |
| Override Plot Method | cls71 | General Programming | 1 | 03-14-2008 01:32 PM |