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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
333 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment