NinjaTrader Support Forum  
X

Attention!

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


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 08-20-2012, 07:34 PM   #1
Wi!s0n
Member
 
Join Date: Mar 2008
Posts: 33
Thanks: 2
Thanked 2 times in 2 posts
Default move text from left to inside right margin

I have copied the NT7 "Pivots" indicator and amended it to only show the R1,S1 and mid pivots. However, the text is to the left of the lines and over the price bars. How do I move the text to the right side of the lines and away from the price bars (inside the margin)? (Please see screenshot) Thanks.

Wilson
Attached Images
File Type: jpg Example.jpg (149.0 KB, 15 views)
Wi!s0n is offline  
Reply With Quote
Old 08-20-2012, 08:35 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,783
Thanks: 160
Thanked 566 times in 557 posts
Default

Hello,

The area you're looking for is in the #regions Miscellaneous section.

The exact line is around 508 and reads:

graphics.DrawString(plot.Name, ChartControl.Font, brush, lastX, lastY - textHeight / 2, stringFormatFar);

You'll want to change lastX to whichever X value you would like this to plot.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-20-2012, 10:59 PM   #3
Wi!s0n
Member
 
Join Date: Mar 2008
Posts: 33
Thanks: 2
Thanked 2 times in 2 posts
Default

Thanks Matthew for your reply. If I input a value for lastX, say "1500" the letters are placed to the right of the lines like I want, however if I reduce the chart dimensions, the letters are obscured. How can I place the letters at the end of the lines so they remain visable with the lines ?
Wi!s0n is offline  
Reply With Quote
Old 08-21-2012, 04:42 AM   #4
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello Wi!s0n,
You can use properties exposed by the unsupported ChartControl class to do it. ChartControl.CanvasRight for example will give you the right parameter.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 08-21-2012, 07:21 AM   #5
Wi!s0n
Member
 
Join Date: Mar 2008
Posts: 33
Thanks: 2
Thanked 2 times in 2 posts
Default

Thanks Joy, that works best
Wi!s0n is offline  
Reply With Quote
The following user says thank you to Wi!s0n for this post:
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
Left Margin? chuckt101 Miscellaneous Support 6 03-24-2011 11:06 AM
Chart Trader: Request to move the X cancel button from right to the left of the line cw30000 Version 7 Beta General Questions & Bug Reports 3 07-08-2010 09:14 AM
#region/endregion + / - boxes at left margin zeller4 General Programming 2 06-11-2010 09:17 AM
plot not move with right side margin kingfish88 Indicator Development 5 05-23-2008 08:15 AM
NT 6 How to move X box on open orders back to the left nightowl Charting 1 01-16-2007 05:52 AM


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