Swingstat filter

Having done the scripting course, I can find no way of applying the ‘filter stats boxes’ when scripting the swingstat function.

Does anyone know if this is actually possible?

Hi Jody,

What’s your objective? Did you see this video on the SwingStat function?

https://learn.optuma.com/course/advanced-scripting/?course_type=content&course_page=1&lecture=11

Hi Darren,

That is the video I’ve seen.

Using the Barros swings in the swingstat function, I’m looking to filter out the outliers with a standard deviation outside mean 2, in a similar way it’s done with the manual stats box tool. Is this possible?

You should be able to, something like this to calculate the Std Dev SwingStat for the last 5 up swings:

BS1=BARROSSWING();

SWINGSTAT(BS1, DEFAULT=StdDevSwing, SWINGS=5, TYPE=Up)>2

 

I’m new to the forum, so please excuse my apparent vagueness.

This is the code I currently have which expresses the current swing as a percentage of the mean impulse swing:

BS1 = barrosswing(DEFAULT=Mid);

SWR1 = abs(swingstart(bs1) - swingend(bs1));

#$SW = 30;

SWM2 = swingstat(BS1, SWINGS=$SW, TYPE=Impulse, DEFAULT=AvgSwing);

SWSTD1 = swingstat(BS1, SWINGS=$SW, TYPE=Impulse, DEFAULT=StdDevSwing);

SWR1 / SWM2

Within the sample of 30 I would like to be able to remove any which are greater than 2 std dev from mean.