jcollins01 29 posts msg #92805 - Ignore jcollins01 |
5/16/2010 2:45:28 AM
Is there a stockfetcher function equvalent to the following thinkscript?
Syntax
compoundValue(int length, IDataHolder visible data, IDataHolder historical data);
Description
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.
Example
declare lower;
rec x = compoundValue(2, x[1] + x[2], 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.
|