Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Change Pivots Formulas
Collapse
X
-
Change Pivots Formulas
Just saved NT Pivots as a new indicator with a different name. All I want to do is modify the formulas for the variables S3 and R3. My knowledge of C# is nonexistent. Any pointers?Tags: None
-
Hello WollenGeld,
Thanks for the post.
I made my own Pivots called MyPivots and then the compiler was complaining about duplicate definitions. The Pivots indicator defines a class called PivotsTypeConverter and then two enums called HLCCalculationMode and PivotRange.
These names need to be refactored to make them unique. There is a way to quickly find and replace the definition and any place these are used.
First, highlight the entire name for "PivotsTypeConverter", copy it, then press ctrl-f on your keyboard to bring up the find options.
Paste PivotsTypeConverter into "Find what" then click the plus under "find options", then select "match case"
Now click on "Quick Replace" and in the "Replace with" field, type something like "MyPivotsTypeConverter" to make the name unique, then click "Replace all"
You will need to do this for PivotsTypeConverter, HLCCalculationMode PivotRange.
Add "My" to these occurrences and you will be able to compile the code.
I have attached my pivots "Save as" for an example of the script compiling after completing this procedure.
Please let us know if you have any questions.Attached Files
-
Thanks. That worked great. But, I get error messages when I try to change the formulas for S3 and R3.
For example, the formula change for S3 would be:
From: S3 = pp - 2 * (currentHigh - currentLow);
To: S3 = S1 - (currentHigh - currentLow);
The Console gives me the following error:
Operator '-' cannot be applied to operands of type 'NinjaTrader.NinjaScript.Series<double>' and 'double'
Comment
-
I think I got it. I read about C# being case sensitive. I then noticed I was using caps for S3 and R3. I changed to lower case and that worked.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
44 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
58 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
35 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
95 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
59 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment