This is a continuation of a thread that I think got closed by support because I said I could figure it out from what you had already told me; boy was I wrong.
I have the following code in a calling strategy and a UserDefinedMethod. This involves the primary instrument 1 minute 6E and a secondary 5 minute 6E.
I have tried this with the DataSeries variable in the main strategy as well as in the UserDefinedMethod and they both produce the same results.
In the main strategy
In Initialize
Add(PeriodType.Minute, 5);
In OnBarUpdate
if (BarsInProgress == 1 && FirstTickOfBar == true)
{
// call the UserDefinedMethod
...
In the UserDefinedMethod
if (test == null)
test = new DataSeries(this);
test.Set(1, Opens[1][1]);
Print("Open " + test[1].ToString() + " " + Times[1][1].ToString() + " " + test[2].ToString() + " " + Times[1][2].ToString());
Since this is called on the first tick to the secondary data, I use Opens[1][1] to get the open of the last completed bar in the secondary series.
Here is my output and my argument for the discovery of an alternate universe
The first numbers match the times but the second not only don't line up with the line before it, they aren't even in the right big figure. I have no idea what I am doing wrong but it is definitely something.
Open 1.3633 9/29/2010 11:25:00 AM 1.3465 9/29/2010 11:20:00 AM
Open 1.363 9/29/2010 11:30:00 AM 1.3466 9/29/2010 11:25:00 AM
Open 1.363 9/29/2010 11:35:00 AM 1.3464 9/29/2010 11:30:00 AM
Open 1.3621 9/29/2010 11:40:00 AM 1.3462 9/29/2010 11:35:00 AM
Open 1.3619 9/29/2010 11:45:00 AM 1.346 9/29/2010 11:40:00 AM
Open 1.3616 9/29/2010 11:50:00 AM 1.3458 9/29/2010 11:45:00 AM
Open 1.3621 9/29/2010 11:55:00 AM 1.346 9/29/2010 11:50:00 AM
Open 1.3627 9/29/2010 12:00:00 PM 1.3456 9/29/2010 11:55:00 AM
Open 1.3627 9/29/2010 12:05:00 PM 1.3451 9/29/2010 12:00:00 PM
Open 1.3635 9/29/2010 12:10:00 PM 1.3454 9/29/2010 12:05:00 PM
Open 1.3635 9/29/2010 12:15:00 PM 1.3452 9/29/2010 12:10:00 PM
Open 1.3635 9/29/2010 12:20:00 PM 1.3461 9/29/2010 12:15:00 PM
Open 1.364 9/29/2010 12:25:00 PM 1.3453 9/29/2010 12:20:00 PM
Open 1.3635 9/29/2010 12:30:00 PM 1.3449 9/29/2010 12:25:00 PM
Open 1.3631 9/29/2010 12:35:00 PM 1.3452 9/29/2010 12:30:00 PM
Open 1.3628 9/29/2010 12:40:00 PM 1.345 9/29/2010 12:35:00 PM
Thanks
Scott
Comment