![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jul 2009
Posts: 53
Thanks: 0
Thanked 0 times in 0 posts
|
I am writing a system and I am trying to divide up the logic.
One custom indicator that computes moving average entry conditions has to call another custom indicator that tracks the bollinger entry conditions. How would I call my own custom indicator? Another related question: I know I can call the built in standard indicators in my custom script. But am I really calling methods on those indicators, or is it constructing the indicator on every call? That would seem expensive. Thanks in advance.. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
DancesWithBears, just as you call other custom indicators as well for example -
Code:
double myCustomValue= MyCustomIndicator(Parameter1, Parameter2);
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Member
Join Date: Jul 2009
Posts: 53
Thanks: 0
Thanked 0 times in 0 posts
|
Bertrand,
Think I got it right but you can please confirm. I construct a Custom Indicator object then call method on it. // in my other custom indicator body MyCustomerIndicator myCustomIndicator(Parameter1, Parameter2); myCustomIndicator.DoThis(); myCustomIndicator.DoThat(); I just wanted to avoid creating another instance of the indicator. But you are saying that the system won't if it sees the same constructor arguments that match an object already instantiated. (caches). Seems logical. Quote:
|
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
DancesWithBears, yes that is correct, you could also use the UserDefinedMethods for this purpose - http://www.ninjatrader-support.com/H...verview45.html
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Jul 2009
Posts: 53
Thanks: 0
Thanked 0 times in 0 posts
|
Tausend Dank! A thousand thanks! Thanks very much!
|
|
|
|
|
|
#6 | |
|
Member
Join Date: Jul 2009
Posts: 53
Thanks: 0
Thanked 0 times in 0 posts
|
Getting "error compiling sources" when I try to export now.
After I put my functions in UserDefinedMethods.cs. hmm.. Quote:
|
|
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
Yes, unfortunately you can't export UserDefinedMethods
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom Indicators | meyer99 | Charting | 6 | 05-25-2009 04:09 AM |
| Custom Indicators again ... | murfinp | Strategy Development | 3 | 04-16-2009 08:31 AM |
| Custom Indicators missing | monpere | Installation and Licensing | 2 | 03-04-2009 06:43 AM |
| Can't import custom indicators | T2020 | Indicator Development | 4 | 08-07-2008 08:03 AM |
| Two color custom indicators | stefy | Indicator Development | 1 | 05-16-2008 11:41 AM |