Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

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

Reply
 
Thread Tools Display Modes
Old 02-24-2012, 01:54 PM   #1
scott__
Junior Member
 
Join Date: Jan 2012
Posts: 5
Thanks: 1
Thanked 2 times in 2 posts
Default Beginner Indicator Problem

I cannot find the problem with this indicator - I was literally following someone doing a webinar and for the life cannot see what is wrong.

error - "Cannot implicitly convert type 'double' to 'NinjaTrader.Data.DataSeries' Line 95

Can someone please help me out. Now when I create another separate Indicator - and try to compile - it gives me the same error and references the above indicator.

Any help would be appreciated I have attached the indicator.

Thanks,
Attached Files
File Type: cs TESTMACDOscillator.cs (9.6 KB, 6 views)
scott__ is offline  
Reply With Quote
Old 02-24-2012, 02:05 PM   #2
NinjaTrader_RyanM1
NinjaTrader Customer Service
 
NinjaTrader_RyanM1's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,127
Thanks: 249
Thanked 434 times in 427 posts
Default

Hi scott,

The compile error is caused by this section:
Code:
[Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Signal
{
get { return _signal[0]; }
}
I don't see anywhere in your code you use this DataSeries Signal, so you can delete all of the above section and it will likely compile and work.

The structure for that section of code would be needed if you wanted to expose the value of _signal from another indicator, using the public Signal that's linked to it. If you want to maintain this functionality, try with this change:

Code:
[Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Signal
{
get { return _signal; }
}
NinjaTrader_RyanM1 is offline  
Reply With Quote
The following user says thank you to NinjaTrader_RyanM1 for this post:
Old 02-24-2012, 02:37 PM   #3
scott__
Junior Member
 
Join Date: Jan 2012
Posts: 5
Thanks: 1
Thanked 2 times in 2 posts
Default

Ryan - figured it out - thank you that was it.
Last edited by scott__; 02-24-2012 at 02:47 PM.
scott__ is offline  
Reply With Quote
Old 02-24-2012, 02:43 PM   #4
NinjaTrader_RyanM1
NinjaTrader Customer Service
 
NinjaTrader_RyanM1's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,127
Thanks: 249
Thanked 434 times in 427 posts
Default

What should I be looking for? For help resolving your compile errors, please see my last reply for two different approaches.
NinjaTrader_RyanM1 is offline  
Reply With Quote
Old 02-24-2012, 02:53 PM   #5
scott__
Junior Member
 
Join Date: Jan 2012
Posts: 5
Thanks: 1
Thanked 2 times in 2 posts
Default

sorry - my lack of understanding at this point lead to the response. I made the change you recommended and all is good

Thanks again
scott__ is offline  
Reply With Quote
The following user says thank you to scott__ for this post:
Old 02-24-2012, 02:55 PM   #6
NinjaTrader_RyanM1
NinjaTrader Customer Service
 
NinjaTrader_RyanM1's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,127
Thanks: 249
Thanked 434 times in 427 posts
Default

Great that took care of it. Thanks for updating us!
NinjaTrader_RyanM1 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
Daily indicator, Minute Input Series (Beginner question) markus1000 Indicator Development 7 01-27-2012 01:32 PM
Beginner Help with Backtesting IN0V8R Charting 3 04-20-2011 11:09 AM
Beginner strategy w84larisa Strategy Development 2 05-04-2010 08:48 AM
Beginner Drake60 Installation and Licensing 1 01-14-2005 04:37 AM


All times are GMT -6. The time now is 12:50 AM.

FULL RISK DISCLOSURE: 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.

The NinjaTrader Support Forum is hosted and operated by NinjaTrader LLC (“NT”), a software development company which owns and supports the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is an NFA registered introducing broker (NFA #0339976). The Support Forum is intended for information and educational 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. Developers who offer products or other trading software tools to be used with the NinjaTrader trading platform are independent persons or companies that are in no manner affiliated with NT or NTB. Please be aware that any performance information provided by a 3rd party developer should be considered hypothetical and must contain the required additional disclosures. Specific questions related to a brokerage account should be sent to your broker directly. The views and opinions expressed in this forum are those of the authors and do not necessarily reflect the official policy or position of NT or NTB.