Stats on Swings Function

Author: Optuma Team Last updated: Mar 14, 2023 15:21

Overview

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