- Desktop
- Scripting
- Formulas and Scripting Functions
- Stats on Swings Function
Stats on Swings Function
Overview
Section titled “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)
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)
Your privacy choices
We use cookies and similar technologies to make the site work, see how it's used, and improve it. Analytics and advertising cookies only run with your consent — see our Privacy Policy for details.