![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
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
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Fabulous. Exactly what I was looking for. It works great thanks.
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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. |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Right, this will not work (unfortunately). We will address this issue with 6.5.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |