![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2009
Location: Budapest, HUNGARY
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
my question would be: if i add indicator in strategy, then can i rename the indicator label in the strategy code (that is seen at the top of the chart)? |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Try something like
SMA(20).Name = myName;
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2009
Location: Budapest, HUNGARY
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Mar 2008
Location: UK West Sussex
Posts: 665
Thanks: 9
Thanked 9 times in 7 posts
|
I see you can do it from a strategy.
Is it possible to set the label in an indicator and if it is could you show the code line? |
|
|
|
|
|
#5 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Something like this? http://www.ninjatrader-support2.com/...ead.php?t=4749
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Mar 2008
Location: UK West Sussex
Posts: 665
Thanks: 9
Thanked 9 times in 7 posts
|
no the label in the Dialogue Box under General is what I am looking to define.
btw the sample label trim - how does that work anyway? What exactly does the override string method do as my chart shows all 4 parameters? |
|
|
|
|
|
#7 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Mindset,
The sample can trim your label to anything you want. It can rename the label that shows up on the chart, remove inputs from even showing, etc. The display name will show up as whatever name you name the indicator in the dialogue window though. If you want it to display a different name I suggest you take a look at the TEMA indicator above where it declares the public class.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Mar 2008
Location: UK West Sussex
Posts: 665
Thanks: 9
Thanked 9 times in 7 posts
|
I must be dim.
1. I can't find the TEMA indicator you refer to. 2. the samplelabel trim doesn't do anything. I simply get 4 pieces of text on the chart - the ToString() override doesn't affect what is displayed on the chart in any way |
|
|
|
|
|
#9 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
1. Scroll down on your list. It should be there. It is a system indicator.
2. Notice how the sample has four parameters. Then notice how only 1 of the parameters is listed in the header.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Mar 2008
Location: UK West Sussex
Posts: 665
Thanks: 9
Thanked 9 times in 7 posts
|
I didn't think of that - I spent 20 mins searching all through the forums (lol)
So if you want to have no label you just put:- Code:
public override string ToString()
{
return " ";
}
Thanks for the patience. FYI I will use this with almost every indicator I have as I hate having labels cluttering up my nice clean charts! |
|
|
|
|
|
#11 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Mindset,
That would be correct.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Modifying Indicator Label | Mike Winfrey | Indicator Development | 1 | 09-03-2008 08:07 AM |
| Rename Indicator | mgbloomfield | Indicator Development | 3 | 04-17-2008 03:37 PM |
| Indicator Label | Mike Winfrey | Indicator Development | 3 | 01-16-2008 11:13 AM |
| Indicator: Removing and Custom Formatting an Indicator’s Chart Label | NinjaTrader_Josh | Reference Samples | 0 | 12-30-2007 06:49 PM |
| Easy way to rename a custom indicator? | higler | Indicator Development | 2 | 05-19-2007 10:47 AM |