PDA

View Full Version : Working with Dataseries


tinkerz
02-06-2010, 08:50 AM
When you work with dataseries, you are storing a historical data set to work things like SMA that need history, correct

Variables are just datastorage that wont carry a history beyond the event that triggers the script,correct

So why when I .set the dataseries Volumeseries.Set(VolumeData/5);

VolumeData being the variable that I collect in the loop.

So why does
//Values[2].Set(VolumeData/5);
work and produce a histogram
and
Values[2].Set(Volumeseries[0]);
Setting the history at 0 does not?

I am using first tick of bar, but the data should be there.

Because I want to smooth the dataset via sma, so where is my data?

Values[2].Set(SMA(Volumeseries,3)[0]);

This works but I cannot smooth the data
//Values[2].Set(VolumeData/5);



if (FirstTickOfBar)
{
timeOfInterest = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, Time[0].Hour, Time[0].Minute, 0);

barsAgo =0;
VolumeData=0;
for (int x = 1; x < 5; x++)
{
barsAgo = GetBar(timeOfInterest.AddDays(-x));
VolumeData=Volume[barsAgo]+VolumeData;
}
Volumeseries.Set(VolumeData/5);
}

if (CurrentBar> barsAgo)
{
//Values[2].Set(VolumeData/5);
Values[2].Set(Volumeseries[0]);
}

tinkerz
02-06-2010, 08:54 AM
Ah I did not set the dataseries...

Tradestation programmer you see :)

NinjaTrader_Austin
02-06-2010, 10:37 AM
Tinkerz, just to clarify, you've found a solution to your issue?

tinkerz
02-06-2010, 11:53 AM
Yes thanks