![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Dec 2010
Posts: 27
Thanks: 0
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!
Syntax compoundValue(int length, IDataHolder visible data, IDataHolder historical data); The default value of the length parameter is 1. 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. |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
ziggymeister,
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.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| 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 |