Appreciate help in this:
I´m trying to input an incrementing value into the SUM method that counts when [VolratioDS[0]>Threshold], and then resets. I need to use a dataseries value as input (I asume). But since these are doubles and the method expects an int input, I get stuck.
When I try to pass the dataseries value (CountDS) to an int variable (count) I once again get stuck cos I "cannot convert double to int".
Is there way to make the SUM method accept the double input, to make the dataseries an int, or to convert the dataseries double to a variable int? Any other solution?
if (VolratioDS[0]>Threshold)
{
if (Crossover == false)
{
CountDS.Set(1);
count = CountDS[0];
CumvolDS.Set(SUM(VoldiffDS, count)[0]);
Crossover = true;
if (CumvolDS[0]>0)
{
Plotpos.Set(CumvolDS[0]);
}
else
{
Plotneg.Set(CumvolDS[0]);
}
}
else
{
CountDS.Set(CountDS[0]+1);
count = CountDS[0];
CumvolDS.Set(SUM(VoldiffDS, count)[0]);
if (CumvolDS[0]>0)
{
Plotpos.Set(CumvolDS[0]);
}
else
{
Plotneg.Set(CumvolDS[0]);
}
}
}
else
{
Crossover = false;
count = 0;
CountDS.Set(0);
Plotpos.Set(0);
Plotneg.Set(0);
}
//Fredrik
Comment