Watchlist script for Double Bottoms / Tops

I am currently constructing a workbook of the stocks in the S&P/ASX 200. The workbook includes a watchlist of each of these stocks. I wanted to create a column which shows where a potential double bottom or a double top could potentially arise from where the current stock price is. I was thinking of a script that could detect a potential double bottom or double top within a tolerance of between 1% and 3%.

An example of this is Polynovo Ltd (ASX:PNV) which I have attached.

Any help would be greatly appreciated.

Thanks,

Tony

Hi Tony,

Here’s the script formula I used to create the example. It’s based on 10% swings, but can be adapted for other values or Gann Swings. Workbook for the ASX50 attached.

Top/Bottom column for swing direction:

//Set swing parameters;
PS1 = PERCENTSWING(PERCENT=10.0);
//Is the swing currently up?;
SWINGUP(PS1)

The column is then formatted under Custom Labels:

Swing % Diff:

//Set Swing parameters;
PS1 = PERCENTSWING(PERCENT=10.0);
//Compare Swingend values for previous swings; 
SE=SWINGEND(PS1);
SE2=SWINGEND(PS1,2);
//Calculate % diff;
(SE/SE2)-1

Within 2.5%:

//Set Swing parameters;
PS1 = PERCENTSWING(PERCENT=10.0);
//Compare Swingend values for previous swings; 
SE=SWINGEND(PS1);
SE2=SWINGEND(PS1,2);
//Calculate % diff;
R1=(SE/SE2)-1;
//Set % range;
R1 > -0.025 and R1 < 0.025

ASX50-Double-Top-Bottoms.owb (48.8 KB)