NexusFi: Find Your Edge


Home Menu

 





Changing indicator names


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Tasker_182 with 2 posts (4 thanks)
    2. looks_two Zondor with 1 posts (8 thanks)
    3. looks_3 Big Mike with 1 posts (4 thanks)
    4. looks_4 DavidHP with 1 posts (3 thanks)
      Best Posters
    1. looks_one Zondor with 8 thanks per post
    2. looks_two Big Mike with 4 thanks per post
    3. looks_3 DavidHP with 3 thanks per post
    4. looks_4 Tasker_182 with 2 thanks per post
    1. trending_up 4,174 views
    2. thumb_up 19 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 1 attachments




 
Search this Thread

Changing indicator names

  #1 (permalink)
 
Tasker_182's Avatar
 Tasker_182 
Cedar Rapids, iowa
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Ninjatrader - Continuum
Posts: 716 since Aug 2009
Thanks Given: 476
Thanks Received: 1,401

Hello,


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.

Thanks in advance.

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665


The correct way is to open the indicator, then do right-click Save As.

The filename has no relevance on the class name and indicator name of the code within.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,342
Thanks Received: 2,747


Tasker_182 View Post
Hello,

Any suggestion on how to proceed as I really do want to be uniform in indicator names.

Thanks in advance.

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 ! ! !
Follow me on Twitter Reply With Quote
  #5 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

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:

 
Code
public class 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.

 
Code
this.Name="MA, Exponential (EMA)";
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
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Tasker_182's Avatar
 Tasker_182 
Cedar Rapids, iowa
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Ninjatrader - Continuum
Posts: 716 since Aug 2009
Thanks Given: 476
Thanks Received: 1,401

Thank-you all for your replies.

For whatever reason a simple right click on the editable file has never occurred to me, oh the wasted minutes of my life, LOL, oh well.

Zondor, thanks for the detail view, much appreciated.

Regards to you all. Hopefully my asking the question will relieve others of having to ask.

Started this thread Reply With Quote
Thanked by:




Last Updated on December 8, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts