![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Senior Member
Join Date: Sep 2008
Posts: 185
Thanks: 20
Thanked 2 times in 2 posts
|
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:
Thanks for any samples you can give. Kirk |
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |