NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Charting

Charting Support for NinjaTrader Advanced Charting.

Reply
 
Thread Tools Display Modes
Old 01-19-2011, 11:50 AM   #16
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
Default

Do not understand this answer. Does it mean that development accepts that the axis shifts, or will they solve problem with one of the next releases?

Quote:
Originally Posted by NinjaTrader_RyanM View Post
Hi Harry,

Updating here as this was found to be expected. Please see my previous reply.
Harry is offline  
Reply With Quote
Old 01-19-2011, 11:55 AM   #17
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Sorry for the confusion, Harry. I updated the thread prematurely. Development is still looking into this and I will post again here as soon as I have more information.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-21-2011, 09:03 AM   #18
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Harry,

Please try one of these in FormatPriceMarker() instead:

Code:
return Gui.Chart.ChartControl.FormatYValue(price);
Code:
return price.ToString(Gui.Globals.GetTickFormatString(TickSize));
The white space will appear if the formatting pushes it out to require more space. This is unavoidable, but with the above it will take the least amount of space. The white space will remain on the chart even if you remove the indicator too. This persisted white space will be resolved in the next version.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-21-2011, 10:20 AM   #19
TCust
Junior Member
 
Join Date: Jun 2010
Posts: 27
Thanks: 0
Thanked 4 times in 3 posts
Default

How add Plot Name ( lines name ) in Price Marker, if we have many lines ?

DrawText not good, for some purposes.
Last edited by TCust; 01-21-2011 at 10:25 AM.
TCust is offline  
Reply With Quote
Old 01-21-2011, 11:19 AM   #20
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello TCust,

Unfortunately I'm not aware of a way to do this. You can easily return the name of the indicator. I'm not sure if there's a way to conditionally change FormatPriceMarkers based on the specific plot used. There's no supported NinjaScript properties that offer this.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-21-2011, 11:25 AM   #21
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Harry,

Please try one of these in FormatPriceMarker() instead:

Code:
return Gui.Chart.ChartControl.FormatYValue(price);
Code:
return price.ToString(Gui.Globals.GetTickFormatString(TickSize));
The white space will appear if the formatting pushes it out to require more space. This is unavoidable, but with the above it will take the least amount of space. The white space will remain on the chart even if you remove the indicator too. This persisted white space will be resolved in the next version.
Hi Josh, thanks for the information, I will try your suggestions and further wait for the next release.
Harry is offline  
Reply With Quote
Old 01-21-2011, 03:07 PM   #22
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Harry,

Please try one of these in FormatPriceMarker() instead:
Code:
return price.ToString(Gui.Globals.GetTickFormatString(TickSize));
This solution worked for all instruments, but there is a general problem with interest rate futures, which are quoted in 1/32, 1/64 or 1/128.

As long as no indicators are applied to a default chart, the y-axis in the correct position. As soon as you apply an indicator - no matter which one - two problems can be observed:

(1) the format of the price marker of the indicator is not correct
(2) the y-axis shifts to the left

Below a test with ZN. First opened a default chart 15 min. Then applied a default EMA. You will notice the false format and the shifted y-axis.
Attached Images
File Type: jpg ZN 03-11 (15 Min) 21_01_2011 default.jpg (104.6 KB, 12 views)
File Type: jpg ZN 03-11 (15 Min) 21_01_2011 indicator.jpg (116.6 KB, 17 views)
Harry is offline  
Reply With Quote
Old 01-21-2011, 03:22 PM   #23
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
Default

I have now modified the indicator code of the EMA to address the problem - but, then I would have to add that piece of code to all my indicators to make them display properly on bond and treasury note futures.

Code:
public override string FormatPriceMarker(double price)
{
	double trunc = Math.Truncate(price);
	int fraction = Convert.ToInt32(320 * Math.Abs(price - trunc) - 0.0001); // rounding down for ZF and ZT
	string priceMarker = "";
	if (TickSize == 0.03125) 
	{
		fraction = fraction/10;
		if (fraction < 10)
			priceMarker = trunc.ToString() + "'0" + fraction.ToString();
		else 
			priceMarker = trunc.ToString() + "'" + fraction.ToString();
	}
	else if (TickSize == 0.015625 || TickSize == 0.0078125)
	{
		if (fraction < 10)
			priceMarker = trunc.ToString() + "'00" + fraction.ToString();
		else if (fraction < 100)
			priceMarker = trunc.ToString() + "'0" + fraction.ToString();
		else	
			priceMarker = trunc.ToString() + "'" + fraction.ToString();
	}
	else
		priceMarker = price.ToString(Gui.Globals.GetTickFormatString(TickSize));
	return priceMarker;
}
Maybe not elegant, but it seems to work. I attach the modified indicator which uses this piece of code.
Attached Images
File Type: jpg ZN 03-11 (15 Min) 21_01_2011 correct.jpg (113.2 KB, 40 views)
Attached Files
File Type: zip EMAmod.zip (2.2 KB, 7 views)
Last edited by Harry; 01-22-2011 at 05:54 PM. Reason: code replaced, as it had a minor bug
Harry is offline  
Reply With Quote
The following user says thank you to Harry for this post:
Old 02-27-2011, 01:07 AM   #24
Ricam
Senior Member
 
Join Date: Jul 2009
Posts: 143
Thanks: 5
Thanked 11 times in 7 posts
Default FormatPriceMaker falls down when indicator has more than one plot

FormatPriceMarker is a very useful technique. But if an indicator has more than one plot, FormatPriceMarker returns the same string (value and format) for all of them, as indicated in a previous post.

This is something that cries out to be addressed. Would be nice to be able to use conditionals to apply different values and formats to the different plots, or to have the FormatPriceMarker method accept a parameter to make it specific to a particular plot.
Ricam is offline  
Reply With Quote
Old 04-25-2011, 10:51 AM   #25
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
Default Y Axis of Indicator adapted to Interest Rate Futures

Is it possible to format the y-axis for an indicator, such as to show 32nds for interest rate futures?

For example, if I display the average true range for bonds, I might like to display this as 23/36 instead of 0.0731, which would be in line with the first indicator panel.

By using FormatPriceMarker, I can display the current indicator value correctly, see chart below. But what about the y-axis? Is it possible to format the y-axis of the indicator in the same way as it has been done for the main panel?
Attached Images
File Type: jpg ZN 06-11 (30 Min) 25_04_2011.jpg (94.3 KB, 32 views)
Harry is offline  
Reply With Quote
Old 04-25-2011, 10:59 AM   #26
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi Harry,

A work around is available for this in the following post.
Last edited by NinjaTrader_RyanM; 04-26-2011 at 09:29 AM.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 04-26-2011, 09:29 AM   #27
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

We were able to identify this as a work around to get Y axis displayed in tick for an indicator panel:

- add data series on same scale and panel as indicator
- set colors for 'candle outline', 'up color', 'down color' and 'wick' to 'transparent'
- set the 'Label' property of the data series to "" (makes label in panel header disappear)
--> y axis looks and behaves like there is a bar series on panel & scale (which actually is the case)
NinjaTrader_RyanM is offline  
Reply With Quote
Old 04-26-2011, 11:57 AM   #28
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
Default

Yes, I have used this already for some indicators on the main panel, will try whether it works. I understand that a transparent bar series will not trigger an adjustment of the vertical scale, as I only want to scale the indicator (value 1) and not the bond (value 100).

Quote:
Originally Posted by NinjaTrader_RyanM View Post
We were able to identify this as a work around to get Y axis displayed in tick for an indicator panel:

- add data series on same scale and panel as indicator
- set colors for 'candle outline', 'up color', 'down color' and 'wick' to 'transparent'
- set the 'Label' property of the data series to "" (makes label in panel header disappear)
--> y axis looks and behaves like there is a bar series on panel & scale (which actually is the case)
Harry is offline  
Reply With Quote
Old 05-06-2011, 11:57 AM   #29
Ricam
Senior Member
 
Join Date: Jul 2009
Posts: 143
Thanks: 5
Thanked 11 times in 7 posts
Default Custom y axis formatting of multiple plots

Once again am requesting a way to do the following:

In an indicator that has more than one plot, to be able to use FormatPriceMarker to display properly formatted values for all of the plots, not just one.

I believe there would have to be different FormatPriceMarker statements for each of the plots, not sure if that can be done.

Can anyone can figure out a way to do this, Thanks
Ricam is offline  
Reply With Quote
Old 05-06-2011, 02:11 PM   #30
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello Ricam,

Currently, you would have to use multiple indicators as FormatPriceMarkers() will apply to all charts. There would have to be a change here to allow different format per plot. Thank you for taking the time to provide us with valuable feedback, we have inserted your suggestion into our tracking system and assigned it ID # 715.
NinjaTrader_RyanM is offline  
Reply With Quote
The following user says thank you to NinjaTrader_RyanM 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
Rolling Pivot Points enochbenjamin Charting 3 09-03-2009 01:30 PM
Pivot Points j4068 Charting 1 05-04-2009 10:00 AM
Pivot Points ek1688 Charting 3 12-31-2008 08:19 AM
Pivot Mid Points yimbot Indicator Development 6 10-24-2008 02:08 AM
Plotting Pivot Points Chuck FL Indicator Development 3 07-23-2008 01:34 PM


All times are GMT -6. The time now is 03:32 PM.