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.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Pivots
Collapse
X
-
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.Josh P.NinjaTrader Customer ServiceTags: None
-
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
-
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.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by alifarahani, Today, 09:40 AM
|
6 responses
36 views
0 likes
|
Last Post
by alifarahani
Today, 03:18 PM
|
||
Started by Waxavi, Today, 02:10 AM
|
1 response
17 views
0 likes
|
Last Post Today, 03:03 PM | ||
Started by Kaledus, Today, 01:29 PM
|
5 responses
14 views
0 likes
|
Last Post Today, 02:56 PM | ||
Started by Waxavi, Today, 02:00 AM
|
1 response
12 views
0 likes
|
Last Post Today, 02:53 PM | ||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
3 responses
17 views
0 likes
|
Last Post Today, 02:41 PM |
Comment