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 07-21-2009, 01:34 PM   #1
zacharydw00
Member
 
Join Date: Jul 2008
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
Default Drawing a single dot in indicator panel

I want to draw a single dot & text in the MACD indicator panel when a condition is met. I have modified my own MACD, and tried using the DrawDot function, but that draws the dot on the price panel.
Can this only be done by adding another Add(new Plot... function?
Can you please point me in the right direction on how to do this?

Thank you.

UPDATE TO QUESTION: i figured out how to draw a single dot on the indicator panel. Now I would like to know how to draw text on the indicator panel(below the dot). Thanks.
Last edited by zacharydw00; 07-21-2009 at 02:05 PM.
zacharydw00 is offline  
Reply With Quote
Old 07-21-2009, 02:00 PM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
Default

Hi Zac, I know I've seen the code somewhere. Give me a few minutes and I'll find it.
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-21-2009, 02:04 PM   #3
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
Default

The property you're looking for is DrawOnPricePanel. Here is a link that will take you to the help guide reference for DrawOnPricePanel.
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-21-2009, 02:07 PM   #4
zacharydw00
Member
 
Join Date: Jul 2008
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
Default

I figured out how to draw a single dot in the indicator panel. Now I would like to know how to draw text in the indicator panel(below the dot). The DrawText function does not seem to work.
Thanks.
Last edited by zacharydw00; 07-21-2009 at 02:18 PM.
zacharydw00 is offline  
Reply With Quote
Old 07-21-2009, 02:19 PM   #5
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
Default

Quote:
Originally Posted by zacharydw00 View Post
I figured out how to draw a single dot on the indicator panel. Now I would like to know how to draw text on the indicator panel(below the dot). Thanks.
Zac, setting DrawOnPricePanel = false should force all Draw objects onto the indicator panel. I edited the MACD indicator a little to help me help you. You can see that it draws text and dots in the indicator window. I've also attached the indicator that I created so you can see what works--the relevant section is from line 77 to line 91.
Attached Images
File Type: jpg 6E 09-09 7_21_2009 (1 Min).jpg (50.0 KB, 68 views)
Attached Files
File Type: zip macd2.zip (2.2 KB, 23 views)
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-21-2009, 02:53 PM   #6
zacharydw00
Member
 
Join Date: Jul 2008
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
Default

Maybe it's something on my end. A global setting or something. When I load your macd2, no text shows up in the indicator panel, but the dots do. I copied the drawtext line from your macd2 into my macd, but the text did not print. I uploaded my macd for you to verify.
Thanks.
Last edited by zacharydw00; 10-01-2009 at 11:02 PM.
zacharydw00 is offline  
Reply With Quote
Old 07-21-2009, 03:09 PM   #7
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
Default

The version you posted is a little complicated for debugging purposes, so we'll use mine to find out why the text isn't being drawn.

I'll outline a few steps for you to try so we can pin this down:
  1. Start Ninjatrader and close any open workspaces (or just make sure you're starting from a blank slate).
  2. Open a new chart with <None> for the chart template.
  3. Open the indicator window and add only macd2
  4. Is the text plotted on top of the dots?
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-21-2009, 03:22 PM   #8
zacharydw00
Member
 
Join Date: Jul 2008
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
Default

For some reason restarting Ninja fixed the text problem this time. I did restart Ninja last time, but it did fix the text problem.
Well thanks... it's all working now.
zacharydw00 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
Panel drawing selection from Strategy saltminer Charting 12 12-06-2010 08:40 AM
Single dot swing high/low raycam Indicator Development 5 03-20-2009 07:16 AM
Removing Single Drawing Object? wannabeninjatrader Charting 2 01-18-2009 10:03 AM
Drawing objects in a strategy other than in Chart Panel 1(Price) JT454 Strategy Development 1 11-07-2008 03:43 PM
Indicator writing to own panel and price panel cherriman Indicator Development 6 10-13-2008 03:14 PM


All times are GMT -6. The time now is 09:05 AM.