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-10-2009, 11:50 AM   #1
simpletrades
Senior Member
 
Join Date: Aug 2009
Posts: 289
Thanks: 0
Thanked 2 times in 2 posts
Default Trying to rearrange order the pivots line up on Data Box

I thought I just posted this but cant find it.

I tried to rearrange the order the pivots show in the data box to read top to bottom:
R3,R2,R1,PP,S1,S2,S3

but all I was able to do was rearrange the names, but the values stayed in the original order as the ninja default that runs from PP on down.

I think it must be in properties somehow but I couldnt figure out how.
It wont let me post all the code so I just posted the parts I changed from the ninja default after copying it into 'MyPivots' script. I didnt switch any data in properties, but reproduced the relevant parts I think so you can view it easily.
HTML Code:
 
/// </summary>
protected override void Initialize()
{
Add(new Plot(Color.Red, "R3"));
Add(new Plot(Color.Red, "R2"));
Add(new Plot(Color.Red, "R1"));
Add(new Plot(Color.Black,"PP"));
Add(new Plot(Color.Green,"S1"));
Add(new Plot(Color.Green,"S2"));
Add(new Plot(Color.Green,"S3"));
 
{
R3.Set(r3);
R2.Set(r2);
R1.Set(r1);
PP.Set(pp);
S1.Set(s1);
S2.Set(s2);
S3.Set(s3);
}
}
#region Properties
/// <summary>
/// </summary>
[Description("Type of period for pivot points.")]
[Category("Parameters")]
public Data.PivotRange PivotRangeType 
{
get { return pivotRangeType; }
set { pivotRangeType = value; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore]
public DataSeries PP
{
get { return Values[0]; }
}
/// <summary>
/// </summary>
[Description("Approach for calculation the prior day HLC values.")]
[Category("Parameters")]
public Data.HLCCalculationMode PriorDayHLC
{
get { return priorDayHLC; }
set { priorDayHLC = value; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore]
public DataSeries R1
{
get { return Values[1]; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore]
public DataSeries R2
{
get { return Values[3]; }
}
 
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore]
public DataSeries R3
{
get { return Values[5]; }
}
 
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore]
public DataSeries S1
{
get { return Values[2]; }
}
 
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore]
public DataSeries S2
{
get { return Values[4]; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore]
public DataSeries S3
{
get { return Values[6]; }
}
/// <summary>
/// close value for user defined pivots calculation
 
 
simpletrades is offline  
Reply With Quote
Old 08-10-2009, 11:57 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

See the Properties region of the code. Notice how you have Values[0], Values[1], etc. You need to change the order there.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-10-2009, 12:00 PM   #3
simpletrades
Senior Member
 
Join Date: Aug 2009
Posts: 289
Thanks: 0
Thanked 2 times in 2 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
See the Properties region of the code. Notice how you have Values[0], Values[1], etc. You need to change the order there.
i tried changing the values so from top down R3 had 0, R2 had 1 etc.. but that didnt do it correctly.
simpletrades is offline  
Reply With Quote
Old 08-10-2009, 12:09 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Your code does not suggest you have made the change. Values[0] corresponds with the first Add(new Plot(...)) in Initialize(). Values[1] goes to the next, etc.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-10-2009, 12:11 PM   #5
simpletrades
Senior Member
 
Join Date: Aug 2009
Posts: 289
Thanks: 0
Thanked 2 times in 2 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Your code does not suggest you have made the change. Values[0] corresponds with the first Add(new Plot(...)) in Initialize(). Values[1] goes to the next, etc.

I'll try again. I did change the properties but when it didn’t change properly I put it back as it was originally in order to post to the forum
simpletrades is offline  
Reply With Quote
Old 08-10-2009, 12:16 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Remember you need to remove the indicator and add a new instance after you compile these changes.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-10-2009, 01:27 PM   #7
simpletrades
Senior Member
 
Join Date: Aug 2009
Posts: 289
Thanks: 0
Thanked 2 times in 2 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Your code does not suggest you have made the change. Values[0] corresponds with the first Add(new Plot(...)) in Initialize(). Values[1] goes to the next, etc.
finally got it. thanks.
it just makes more sense that if r1 gets hit that i care more about easily seeing r2 or pp rather than seeing s1 being next on the data box list.
simpletrades 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
How to rearrange Y axis biorjin Charting 1 07-10-2009 02:51 AM
Info box, daily opening line, news event calendar indicators pa188 Indicator Development 6 05-28-2009 03:58 AM
Charts; Multi-line/word wrapped text box SteveB Suggestions And Feedback 1 05-09-2008 06:15 AM
Removing a data line from the Data Box hammall Charting 3 01-30-2008 10:02 AM
Line "names" in Indicator Box change to "Line" after modification higler Charting 3 05-02-2007 06:05 AM


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