DataSeries objects can be used on supplementary series in a multi-time frame and instrument strategy. Please see our support forum NinjaScript reference samples section for further information.
Can you point me to where this is discussed? I am having issues with setting a dataseries passed by ref to a UserDefinedMethod.
Once there have been enough bars to start calling the method, I set the value the first time through with a specific calculation and after that a more general one - the equivalent of an EMA calculation where I provide the first value and from that point on it is a normal EMA calculation.
I want to do this in the UserDefinedMethod to push as much code into the method as possible and therefore encapsulate the process to the extent possible.
I am only calling the method once there are enough bars and thought I could use
if (ds1.ContainsValue(1) == false) to see if a value had been set yet and if not, set ds1[0]. Then the next test would fail and I could switch to the other calculation.
It would seem that once I have set a value in the data series that test should fail from then on but although normally it does, at times it does not. What could cause this (a missing bar)?
Thanks in advance
Scott
Comment