Skip to content

Stats on Swings Function

By Optuma Team · Updated 2023-03-14

The SWINGSTAT() function allows you to output specific values from any swing script. To work the SWINGSTAT() function needs to be wrapped around a swing function.

For example:

GS1 = GannSwing();
SWINGSTAT(GS1)

This function allows you to output the following values…

  • Average Swing (in points)
  • Standard Deviation Swing
  • Average Time
  • Standard Deviation Time
  • Average Bars
  • Standard Deviation Bars
  • Average Percentage (Retracement)
  • Standard Deviation Percentage
  • Bars: The number of Bars between each swing.
  • Days: The number of Calendar days between each swing.

The SwingType option allows you to choose either up swings, down swings, or all swings.

Example Script: This will calculate the average number of bars for each swing over the last 10 3-bar Gann Swings:

GS1=GANNSWING(SWINGCOUNT=3);
SWINGSTAT(GS1, SWINGS=10, DEFAULT=AvgBars, TYPE=All)

Capture

On a 5% swing, the average swing over the last 5 up swings:

P1=PERCENTSWING(PERCENT=5.0);
SWINGSTAT(P1, SWINGS=5, DEFAULT=AvgSwing, TYPE=Up)

and down swings:

P1=PERCENTSWING(PERCENT=5.0);
SWINGSTAT(P1, SWINGS=5, DEFAULT=AvgSwing, TYPE=Down)

Capture

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.