![]() |
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
|
|||||||
| Charting Support for NinjaTrader Advanced Charting. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#16 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
|
|
|
|
|
|
#17 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#18 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Harry,
Please try one of these in FormatPriceMarker() instead: Code:
return Gui.Chart.ChartControl.FormatYValue(price); Code:
return price.ToString(Gui.Globals.GetTickFormatString(TickSize));
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#19 |
|
Junior Member
Join Date: Jun 2010
Posts: 27
Thanks: 0
Thanked 4 times in 3 posts
|
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.
|
|
|
|
|
|
#20 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#21 | |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
Quote:
|
|
|
|
|
|
|
#22 | |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
Quote:
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. |
|
|
|
|
|
|
#23 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
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;
}
Last edited by Harry; 01-22-2011 at 05:54 PM.
Reason: code replaced, as it had a minor bug
|
|
|
|
|
The following user says thank you to Harry for this post: |
|
|
|
#24 |
|
Senior Member
Join Date: Jul 2009
Posts: 143
Thanks: 5
Thanked 11 times in 7 posts
|
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. |
|
|
|
|
|
#25 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
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? |
|
|
|
|
|
#26 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hi Harry,
A work around is available for this in the following post.
Ryan M
NinjaTrader Customer Service
Last edited by NinjaTrader_RyanM; 04-26-2011 at 09:29 AM.
|
|
|
|
|
|
#27 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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)
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#28 | |
|
Senior Member
Join Date: Oct 2007
Posts: 1,829
Thanks: 12
Thanked 83 times in 67 posts
|
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:
|
|
|
|
|
|
|
#29 |
|
Senior Member
Join Date: Jul 2009
Posts: 143
Thanks: 5
Thanked 11 times in 7 posts
|
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 |
|
|
|
|
|
#30 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_RyanM for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |