Thursday, October 11, 2007

The Swing Indicator - Part 2

The Swing Indicator

We here have 3 adaptive Swing indicators applied to QQQQ 5 mins, declined in 3 different lengths or Time Frame Multipliers.
The shortest Swing is the white line, calculated over 128 bars. The second one is the yellow line, which with a TF multiplier of 2 calculates swings over 256 bars. The third one is the green line with a TF multiplier of 3.

The Swing indicator also has a Search Depth parameter. In most cases, the default setting (0) will suffice. However, in certain circumstances like a strong bull run, the indicator will obviously 'keep it simple' and bring about a straight line. The user may want to search longer for less obvious waves with a Search Depth parameter set to 1. The plot colour is then a little darker.

Since the indicator focuses on a fixed number of bars, the oldest leg is always incomplete. A future version may be implemented to draw all swings since bar 1, or give the user more flexibility in choosing the number of bars. It is not a technical difficulty, but rather a speed compromise which led to the current design. The Swing indicator indeed uses a Genetic Algorithm to detect pivot points, and can sometimes be computing intensive particularly on low time frames if a number of charts are open simultaneously.

An additional indicator can be added to the chart to retrieve pivot points and calculate Fib retracement and expansions automatically when swing legs show the right characteristics. Please note that communication between indicators, in this particular instance, the swing indicator writing pivot points in shared memory later retrieved by the Fib calculation. The same principle can be applied outside TradeStation, i.e. pivot information can be used in a VC++ program via the API.
More details on the API will be posted soon on a separate site. Contact me for details.