- Desktop
- Scripting
- Formulas and Scripting Functions
- SwingTrend functions
SwingTrend functions
SwingTrend is a colour scheme for swing charts based on WD Gann’s trend rules of higher highs and lows, regardless of the current swing direction. The example below shows the trend colours changing depending on previous swing highs and lows.

The swing trend can be easily determined in scripting with the SWINGTRENDUP() and SWINGTRENDDOWN() functions. The functions can be used with Gann, Point, Percent, or Volatility Swings.
This example can be used in a watchlist or scan to determine the trend direction based on 10% swings:
S1 = PERCENTSWING(PERCENT=10.0);
SWINGTRENDUP(S1) == 1
This example shows the Dow30 members and their current swing trend. Note that CRM is showing false because the trend is down, with the current swing in an upwards direction. The swing trend will turn green (ie up) if the previous swing high at 251.23 is taken out:

Custom Bar Colours
Section titled “Custom Bar Colours”This will colour the bars red for negative trend and green for positive based on 3 bar Gann swings:
GS1 = GANNSWING(SWINGCOUNT=3, METHOD=Use Next Bar, USEINSIDE=True);
SWINGTRENDDOWN(GS1)

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.