Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I've created a few indicators and NOW I decide to use a personal naming standard.
I started by simply renaming the .CS files with no problems. So when i edit the indicators they show up as expected.
However, In the indicator panel of a chart, they still show the original names, so I started to rename them the same as the .CS file name. I did this in the statement "public class Name: Indicator" Where, as an example, I changed "Name" to "myName" After I did that with one indicator, i recompiled it and there were a ton of errors generated in the "Ninjascript generated code, do not remove or change" section:
The type or namespace name 'Name' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Name could not be found (are you missing a using directive or an assembly reference?)
'NinjaTrader.Indicator.Indicator.Name(int)' is a 'method' but is used like a 'type'
'NinjaTrader.Indicator.Indicator.Name(int)' is a 'method' but is used like a 'type'
The type or namespace name 'Name' does not exist in the namespace 'NinjaTrader.Indicator' (are you missing an assembly reference?)
The type or namespace name 'Name' does not exist in the namespace 'NinjaTrader.Indicator' (are you missing an assembly reference?)
The type or namespace name 'Name' does not exist in the namespace 'NinjaTrader.Indicator' (are you missing an assembly reference?)
The type or namespace name 'Name' does not exist in the namespace 'NinjaTrader.Indicator' (are you missing an assembly reference?)
Any suggestion on how to proceed as I really do want to be uniform in indicator names.
Open the original indicator and choose to 'Save As' by right clicking on the window. Ninjatrader will rename all of the vital stuff to the correct name in most cases.
Compile and check the name.
If all goes well that is it.
(As I posted this I see Mike beat me to it.)
If not:
Ask again and I will show you how to do it manually.
Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
An indicator has three names. Two, the class name and file name, are mandatory. The third one, the this.Name property, is optional.
Each indicator is a C# class object that lives in the Ninjatrader Indicator namespace.
The actual, real name is the class name. For example, line 24 of the @ADX indicator:
ADX is the name of the class. Class names cannot contain any spaces or special characters other than the underscore. The name of every class object must be unique. But there is nothing to prevent you from having multiple versions of the exact same indicators, as long as each one has its own unique class name.
Then there is the name of the .cs file which in this case is @ADX.cs. The file name does not need to match the class name, but generally it should. In this particular case the leading ampersand identifies the ADX as a System Indicator provided by Ninjatrader and prevents you from changing it. File names are subject to the Windows file naming rules. They can be changed using Windows explorer. Sometimes they can only be changed when Ninjatrader is not running.
One thing to remember is that the system indicators tend to be coded in a very simplistic and inefficient way, and to give very poor performance. Also bear in mind that these get overwritten or replaced when you re install Ninjatrader
The third way to name an indicator is to set the this.Name property in the Initialize() module. The big advantage of this property is that it is a string that can include spaces and special characters. This string will be displayed in the dropdown indicator list and in the chart panel. An example of what could be done with this would be to prefix all your moving average names with "MA " so that they would all be grouped together in the indicator list.
But if you did this you would probably want to change the class names and file names so that everything is consistent. The class name would have to use underscores instead of spaces and would not be able to have any parentheses.
This is what I have done. I hardly use any of these, but enjoyed tinkering with them. Before I re install or update Ninjatrader I need to archive my Indicator folder, then ditch the one that Ninjatrader installed and put mine back. Otherwise I will lose changes that I made to some of the system indicators.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett