GANNSWING() Function

Author: Optuma Team Last updated: Jun 15, 2021 10:26

Overview

Gann Swing charts include a scripting function: GANNSWING()

GannSwing Function 1

Dot Notations

The GANNSWING() function supports dot notations, allowing different aspects of the swing to be referenced.

GSDot

From Optuma 2.0 and later support has been added for Swing Trend Up and Swing Trend Down notations, which produce a Boolean result.

Properties

GSScriptPro

Tool Name: Allows you to adjust the name of the tool, as it’s displayed in the Structure Panel.

Default Plot: Allows you to set which part of the swing is being used within the script. The 3 options are Swing List (the full swing), Swing Start and Swing End

Swing Count: Sets how many time periods (bars) must take place in the same direction for the swing to turn. For example, if set to three there would need to be three successive higher bars before a down swing would turn up.

Outside Bar Calc: Sets how outside bars are treated in the swing calculation. Click the drop down arrow to select the Use Outside Bar or Use Next Bar option.

Use Inside: Sets whether inside bars are considered in a bar count of Gann Swings.

Cluster Outside and Inside Bars: Lets you set which rules are used when handling clusters of inside and outside bars.

Use Breakout: This option can only be used with a swing count greater than one. If the turning point of the previous swing is exceeded before the number of bars in the swing count has occurred this is called a ‘breakout’ and the new swing will be drawn.

Example Scripts

Find where the Gann Swing is higher than the previous day (after Swing Confirmation):

GANNSWING() IsUp

GannSwing Function 3

Find the Turning Point for the Gann Swing moving from Up to Down Swing (Swing Confirmation Point)

GANNSWING() TurnsDown

GannSwing Function 4

Look for an upswing and the swing high is lower than the previous swing high

GS1=GANNSWING();
(SWINGEND(GS1) > SWINGSTART(GS1)) and (SWINGEND(GS1) IsUp) and SWINGEND(GS1) < SWINGEND(GS1)[2]

GannSwing Function 5

Weekly Swing on Daily Chart

Gann Swings are able to handle time frames different to those they are placed on. For example:

GANNSWING(Week())

If the above script is applied to a daily chart, the Weekly Gann Swing will be drawn on over the daily time frame.

GannSwing Function 6