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 06-07-2010, 08:21 AM   #1
zeller4
Senior Member
 
Join Date: Sep 2008
Posts: 185
Thanks: 20
Thanked 2 times in 2 posts
Default UserDefinedMethods.cs

Hello,

I've seen the sample UserDefinedMethods.cs strategy file. This has two samples - 1 for IsMorningSession and HigherPrices (both bool).

Are there other samples for the indicators file?

Are the results available as int or double or DataSeries as well?

Would there be a reason to NOT use DataSeries (if historical info is needed)?

In the Overview section, it states
Quote:
You can not share user defined methods created for custom strategies with custom indicators.
Does that mean that only the unique names (of the .cs file and individual method) is required or does it have to also do with how or from where it is called?

Thanks for any samples you can give.

Kirk
zeller4 is offline  
Reply With Quote
Old 06-07-2010, 08:51 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello Kirk,

Unfortunately there aren't additional samples available. The samples were written to return true or false but you could write methods that return int or double as well. If you're looking for more information on what you could do here, look into general C# reference on writing methods.

Creating and managing custom methods for data series shouldn't be done here, because they need to be instantiated in Initialize() method and values set in OnBarUpdate(). This framework requires creating a custom indicator.

Indicator methods are available to indicators and strategies. Strategy methods are available only to strategies. The unique name must be provided to call the method. You don't have to reference a file. The custom methods are added and accessible just by the method name.
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
UserDefinedMethods in NinjaTrader 7 xTrader1 General Programming 1 10-21-2009 07:08 AM
userdefinedmethods 8DTK8 Strategy Development 4 02-22-2009 07:49 AM
Question about UserDefinedMethods clint2008 Strategy Development 1 11-07-2008 10:37 AM
Sharing UserDefinedMethods between indicators and strategies FireFly General Programming 1 05-16-2008 10:20 AM
Compile error with UserDefinedMethods NinjaTrader_Josh Indicator Development 6 06-06-2007 08:34 AM


All times are GMT -6. The time now is 01:48 PM.