NinjaTrader Support Forum  

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_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,128
Thanks: 249
Thanked 427 times in 423 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_RyanM is offline  
Reply With Quote
The following user says thank you to NinjaTrader_RyanM 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_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,128
Thanks: 249
Thanked 427 times in 423 posts
Default

What should I be looking for? For help resolving your compile errors, please see my last reply for two different approaches.
NinjaTrader_RyanM 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_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,128
Thanks: 249
Thanked 427 times in 423 posts
Default

Great that took care of it. Thanks for updating us!
NinjaTrader_RyanM 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 07:02 AM.