NinjaTrader Support Forum  

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 06-30-2007, 04:27 AM   #1
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 Pivots

I am trying to call the Pivots indicator from within another indicator I am building to use the pivot points for some calculations, but I am having difficulty calling the indicator.

I tried "Pivots(Data.PivotRange.Daily,20);" to no avail. It is telling me it cannot convert "NinjaTrader.Data.PivotRange" to "NinjaTrader.Data.IDataSeries". What is the IDataSeries value I can put in there in order for this to work? Thank you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-30-2007, 04:43 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Please check out the methods signature provided by Intellisense:
Pivots(Data.IDataSeries input, int width)

This means you need to code something like:
Pivots(Input, 20).PivotRangeType = PivotRange.Daily; // extra code to change pivots type to daily
double val = Pivots(Input, 20).PP[0];

Note: the PivotRangeType is not supported yet as a parameter on the Pivots() method, that's why you'll need to the extra code line. We'll look into it and likely support it codewise by fall time frame
NinjaTrader_Dierk is offline  
Reply With Quote
Old 06-30-2007, 05:32 AM   #3
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

Fabulous. Exactly what I was looking for. It works great thanks.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-16-2007, 12:05 PM   #4
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

This method doesn't seem to work when you try to set two variables to two different range types.

Pivots(Input, 20).PivotRangeType = PivotRange.Daily; // extra code to change pivots type to daily
double val = Pivots(Input, 20).PP[0];
Pivots(Input, 20).PivotRangeType = PivotRange.Weekly;
double val2 = Pivots(Input, 20).PP[0];

I was playing around with various Print() throughout to see where it messes up and this is what I've found. The indicator does acknowledge the change in PivotRangeTypes, but it does not recognize that you are calling Pivots twice. Once with the first PivotRangeType and once with the second. It seems to ignore the second PivotRangeType change completely. It takes the Daily and just does both val and val2 on Daily.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-16-2007, 12:14 PM   #5
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Right, this will not work (unfortunately). We will address this issue with 6.5.
NinjaTrader_Dierk 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
Woodies pivots rally7 Miscellaneous Support 11 11-09-2007 03:18 PM
Globex Pivots guym Indicator Development 6 07-20-2007 06:08 PM
Pivots Problem Paolo333 Charting 6 05-10-2007 05:31 AM
Weekly Pivots Freddie Charting 2 02-21-2007 01:46 AM
Pivots Indicator bmaltz Charting 8 12-03-2006 04:46 AM


All times are GMT -6. The time now is 12:52 AM.