![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Mar 2008
Location: Teddington
Posts: 45
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Sep 2008
Posts: 75
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jan 2008
Location: Madrid, Spain
Posts: 229
Thanks: 2
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jul 2008
Posts: 271
Thanks: 4
Thanked 7 times in 7 posts
|
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 |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Alex, I will give that a try. Makes sense now that I see it written down!
All the best... Tom |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |