Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 04-16-2018, 10:20 AM   #1
soulfx
Senior Member
 
Join Date: Mar 2011
Posts: 379
Thanks: 48
Thanked 28 times in 27 posts
Default Indicator Label and Name clarification

Hello, I want to clarify a few items regarding the Name field as set in the OnStateChange() State.SetDefaults section.

I made a copy of VOL (standard ninja indicator) to test this.

I called this copy VOLTest1604 so the header of indicator looks like :

public class VOLTest1604 : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{

Name = "VOLNameInside";
}
}
etc...

I put some code in the OnBarUpdate()

which iterates over the indicator collection on the chart and prints out the

Name & DisplayName of each indicator it finds.

Prior to changing the Label parameter in the indicator parameters BOTH the
Name and DisplayName show as VOLNameInside

If i delete the Label so there is nothing there :

the Name shows as null (empty) and the DisplayName reverts to VOLTest1604 ie the name of the file & header of indicator.

Is this expected behaviour ? I would have expected the DisplayName to be null and perhaps the Name to remain as it is VOLNameInside or as VOLTest1604 ?

Please advise.

thanks
soulfx is offline  
Reply With Quote
Old 04-16-2018, 10:34 AM   #2
NinjaTrader_JoshG
NinjaTrader Customer Service
 
Join Date: Jun 2017
Location: Denver, CO
Posts: 303
Thanks: 8
Thanked 71 times in 68 posts
Default

Hello soulfx,
Thanks for your post.

This would be expected behavior. What are you trying to achieve?
NinjaTrader_JoshG is offline  
Reply With Quote
Old 04-16-2018, 10:39 AM   #3
soulfx
Senior Member
 
Join Date: Mar 2011
Posts: 379
Thanks: 48
Thanked 28 times in 27 posts
Default

I just wanted to check as i would have expected the Label parameter to refer to the DisplayName when iterating through the indicator list in the code. Instead it sets the Name to null and then defaults the DisplayName to the actual header/public class XXX : indicator name? Do you see what i mean?

If this is how it is set up (which is not intuitive to me) then i just need to handle it in the code in that manner if i am checking on the indicator name.

thanks
soulfx is offline  
Reply With Quote
Old 04-16-2018, 12:03 PM   #4
eDanny
Vendor
 
eDanny's Avatar
 
Join Date: Jul 2008
Location: East Rochester, NY
Posts: 1,244
Thanks: 15
Thanked 170 times in 139 posts
Default

JoshG, ask Brett if it is in the works to change the naming behavior to the way it worked in NT7, per our fairly recent discussion.
eDanny
NinjaTrader Ecosystem Vendor - Integrity Traders
eDanny is offline  
Reply With Quote
Old 04-17-2018, 07:18 AM   #5
NinjaTrader_JoshG
NinjaTrader Customer Service
 
Join Date: Jun 2017
Location: Denver, CO
Posts: 303
Thanks: 8
Thanked 71 times in 68 posts
Default

Hello eDanny,

I forwarded your message to Brett. However, he has no comment at this time.
NinjaTrader_JoshG is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Force Indicator Label / Prevent Label Changes trader449 Indicator Development 2 07-10-2015 11:57 AM
Indicator Label kiss987 General Development 2 02-23-2014 07:08 PM
Indicator Label photog53 Indicator Development 3 08-28-2011 05:17 PM
Indicator Label Mike Winfrey Indicator Development 3 01-16-2008 12:13 PM
Indicator: Removing and Custom Formatting an Indicator’s Chart Label NinjaTrader_JoshP Reference Samples 0 12-30-2007 07:49 PM


All times are GMT -6. The time now is 06:07 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.