Go Back   NinjaTrader Support Forum > NinjaTrader 7 > Indicator Development

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

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 03-12-2018, 03:11 PM   #1
TazoTodua
Senior Member
 
Join Date: Sep 2016
Posts: 350
Thanks: 244
Thanked 5 times in 5 posts
Default something like chart id?

this topic was not helpful - https://ninjatrader.com/support/foru...ad.php?t=36165

so, I want to know Is here any way to get and ID (or any temporary identifier) for current open Chart id?

(from two indicators I try to find out if they are both attached to same chart)
Last edited by TazoTodua; 03-12-2018 at 03:14 PM.
TazoTodua is offline  
Reply With Quote
Old 03-12-2018, 03:21 PM   #2
TazoTodua
Senior Member
 
Join Date: Sep 2016
Posts: 350
Thanks: 244
Thanked 5 times in 5 posts
Default

I've found that `this.ChartControl.Handle.ToInt32()` returns something ID, is that what i am looking for?
TazoTodua is offline  
Reply With Quote
Old 03-12-2018, 03:26 PM   #3
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 8,639
Thanks: 126
Thanked 1,889 times in 1,761 posts
Default

Hello TazoTodua,

You could generate an ID and save this to the ChartControl.Tag and find it this way.

Code:
if (ChartControl != null)
{
	ChartControl.Dispatcher.InvokeAsync(() =>
	{
		ChartControl.Tag = Guid.NewGuid();
		Print(ChartControl.Tag);
	});
}
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Old 03-12-2018, 03:56 PM   #4
TazoTodua
Senior Member
 
Join Date: Sep 2016
Posts: 350
Thanks: 244
Thanked 5 times in 5 posts
Default

I dont want to modify any property of chartcontrol (I'm trying to avoid extra hard-coding and invoking). I just want to detect any identifier using existing properties ...
Can you please tell me if my previous reply was correct method too? (i mean using: ChartControl.Handle.ToInt32() )

thanks as always!
Last edited by TazoTodua; 03-12-2018 at 04:00 PM.
TazoTodua is offline  
Reply With Quote
Old 03-13-2018, 09:23 AM   #5
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 8,639
Thanks: 126
Thanked 1,889 times in 1,761 posts
Default

Hello TazoTodua,

I'm not aware of the ChartControl having a handle property.

Are you able to use this on your end?
Is the generated integer unique?

I'm not aware of any documented or undocumented properties (or methods) that uniquely identify each chart control.

I am happy to submit a feature request on your behalf for the NinjaTrader Development to consider adding an unique ID property of ChartControl in a future version of NinjaTrader if you would like.
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 03-14-2018, 09:11 AM   #6
koganam
Senior Member
 
Join Date: Feb 2008
Location: omegasigmaindicators.com
Posts: 7,211
Thanks: 56
Thanked 3,000 times in 2,427 posts
Default

Quote:
Originally Posted by TazoTodua View Post
I dont want to modify any property of chartcontrol (I'm trying to avoid extra hard-coding and invoking). I just want to detect any identifier using existing properties ...
Can you please tell me if my previous reply was correct method too? (i mean using: ChartControl.Handle.ToInt32() )

thanks as always!
You can always query the chart itself to know all the indicators that are loaded on the chart. Of course, in NT7, that means that you probably need to code it into the indicator in the first place.
koganam is online now  
Reply With Quote
The following user says thank you to koganam for this post:
Old 03-14-2018, 09:14 AM   #7
koganam
Senior Member
 
Join Date: Feb 2008
Location: omegasigmaindicators.com
Posts: 7,211
Thanks: 56
Thanked 3,000 times in 2,427 posts
Default

Quote:
Originally Posted by TazoTodua View Post
I dont want to modify any property of chartcontrol (I'm trying to avoid extra hard-coding and invoking). I just want to detect any identifier using existing properties ...
Can you please tell me if my previous reply was correct method too? (i mean using: ChartControl.Handle.ToInt32() )

thanks as always!
I found an old post that I made many years ago on how to do that which I explained in an earlier reply, on how we can get the Indicators that are loaded on a chart..

ref: https://ninjatrader.com/support/foru...81&postcount=1
koganam is online now  
Reply With Quote
The following user says thank you to koganam for this post:
Old 03-14-2018, 11:23 AM   #8
TazoTodua
Senior Member
 
Join Date: Sep 2016
Posts: 350
Thanks: 244
Thanked 5 times in 5 posts
Default

KOGANAM ! YOU ARE AWESOME AS ALWAYS !!!! thank you so much for your help!
TazoTodua 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
OCO ID cannot bre reused. Please use a new OCO ID. gordongekko Strategy Development 12 04-17-2018 07:12 AM
Machine ID billbrasil Platform Technical Support 8 12-03-2014 04:32 PM
Chart Trader account ID seahn General Development 4 07-31-2014 04:01 PM
machine ID davidt Indicator Development 7 04-24-2013 07:25 AM
Ninjascript access to license Id/machine Id? RichardTodd General Development 1 09-17-2008 08:40 AM


All times are GMT -6. The time now is 10:00 AM.

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.