NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 09-05-2008, 11:05 AM   #1
cherriman
Member
 
Join Date: Mar 2008
Location: Teddington
Posts: 45
Thanks: 0
Thanked 0 times in 0 posts
Default Indicator writing to own panel and price panel

Hi Guys,

I had a search but couldn't find what I was looking for. Basically, I want to be able to program an indicator to draw on its own panel and on the price panel from time to time.

Is this possible, please ?

Thanks,
Eric
cherriman is offline  
Reply With Quote
Old 09-05-2008, 11:08 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Unfortunately not. You can have the indicator plot on its own panel and use Draw() on the price panel though. But you can't have Draw() on both.
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-08-2008, 09:10 PM   #3
RandyT
Member
 
Join Date: Sep 2008
Posts: 75
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Unfortunately not. You can have the indicator plot on its own panel and use Draw() on the price panel though. But you can't have Draw() on both.
Can I get a bit of clarification on this? I am debugging a problem where my indicator is not updating. The only way to keep it current is to set to "updatebaronclose". I am however drawing both the indicator plots AND calling DrawArrowDown, to draw on the price panel. I am confused about whether that is possible and secondly, if this could be causing the problems I am having with the plot not updating.
RandyT is offline  
Reply With Quote
Old 10-09-2008, 01:56 AM   #4
cls71
Senior Member
 
Join Date: Jan 2008
Location: Madrid, Spain
Posts: 229
Thanks: 2
Thanked 0 times in 0 posts
Default

Hello,
it's possible. In this figure, I plot an indicator and draw lines (divergences) in Price's panel & Indicator's panel, by programming (I use the DrawLine instruction combined with DrawOnPricePanel).

Greetings.


Attached Images
File Type: jpg divergencias02.jpg (74.4 KB, 171 views)
cls71 is offline  
Reply With Quote
Old 10-09-2008, 04:17 PM   #5
atangram
Junior Member
 
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
Default

Hey cls71,

I would love to see this code if possible. This is exactly what I am attempting to do but without any success. Could you post it or send it to me please?

Thanks
atangram is offline  
Reply With Quote
Old 10-13-2008, 02:44 PM   #6
anachronist
Senior Member
 
Join Date: Jul 2008
Posts: 271
Thanks: 4
Thanked 7 times in 7 posts
Default

That divergence code is likely to be more complicated than you need. The concept is simple:

DrawOnPricePanel = false;
DrawLine(....); // this draws a line on the indicator panel

DrawOnPricePanel = true;
DrawLine(....); // this draws a line on the price panel

DrawOnPricePanel is initialized in the Initialize() method, and this controls where your indicator will plot. Once that is set, you can no longer change where the indicator will plot.

However, you can subsequently reset DrawOnPricePanel. Doing so will only change where the drawing tools will plot, like DrawLine, DrawVerticalLine, DrawEllipse, etc. It won't change where the indicator itself will plot.

-Alex
anachronist is offline  
Reply With Quote
Old 10-13-2008, 03:14 PM   #7
atangram
Junior Member
 
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Alex, I will give that a try. Makes sense now that I see it written down!

All the best...
Tom
atangram is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Draw Vertical Line not in Price Panel mason Indicator Development 3 12-01-2009 09:50 AM
DrawText on Indicator Panel thepcmd General Programming 7 09-03-2008 10:24 PM
draw on price panel argito Strategy Development 8 06-09-2008 10:09 AM
Stop and Target displayed on Price Panel CashCache Strategy Development 2 01-12-2008 09:35 AM
Indicator/Price scales in 1 panel monpere Indicator Development 5 12-26-2007 04:52 PM


All times are GMT -6. The time now is 08:07 PM.