|12-14-2010, 04:59 PM||#1|
Join Date: Dec 2010
Thanked 0 times in 0 posts
Hi I am not sure if this is available either with Ninjasscript or the MSDN library I am just trying to get the below function done: Thanks!
compoundValue(int length, IDataHolder visible data, IDataHolder historical data);
The default value of the length parameter is 1.
Calculates a compound value according to following rule: if a bar number is bigger than length then the visible data value is returned, otherwise the historical data value is returned. This function is used to initialize studies with recursion.
declare lower;rec x = compoundValue(2, x + x, 1);plot FibonacciNumbers = x;
The example calculates the Fibonacci sequence. Starting from the third bar each following number is calculated as the sum of the previous two numbers while the numbers for the first two bars are equal to one. As a result you will get a plot containing the 1 1 2 3 5 etc values.
|12-14-2010, 05:03 PM||#2|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Thanked 106 times in 70 posts
I am not sure where you got that method from as it is not a standard method from .NET that I am aware of. You can still feel free to create yourself your own method named that that does exactly that if you wish though.
NinjaTrader Customer Service
|Thread||Thread Starter||Forum||Replies||Last Post|
|Recursive property||bascher||Strategy Development||3||09-01-2010 04:34 PM|
|Recursive Property Error ??||AresBowman||Strategy Development||3||06-17-2010 11:23 AM|
|recursive parameter error||junkone||General Programming||2||11-20-2008 07:08 AM|
|Recursive Properties||zoltran||General Programming||3||05-07-2008 01:29 AM|
|a function that does this||HelloHello||Automated Trading||1||09-13-2007 03:24 AM|