Screening "Cup and Handle" patterns
Author: Ninozah
Creation Date: 3/10/2013 12:21 AM
profile picture

Ninozah

#1
I would like to know if it is possible to make a program which will go thru the list of all stocks from S&P500 and extract or flag stocks that meet certain chart/price pattern. The specific pattern I am looking for is Investors Business Daily so called "Cup and Handle". Fidelity has that as one of their indicators in Power Trader Pro, but it cannot be taken out and used elsewhere.

Or to program wealth lab to go thru the list of all stocks from S&P500 and flash daily chart for 2-3 seconds on the screen and move on automatically to the next stock. So I can visually flag what I need.
profile picture

Eugene

#2
Detecting Cup&Handle patterns is possible using this Strategy:

Trading system: Semi-Cup Trading System
Scanner: TASC 2011-04 | Identifying Cup Formations Early (Siligardos)

An active C&H in a stock will trigger an Alert on the Alerts tab of your multi-symbol backtest. You can double-click on it to observe the stock's chart with the C&H pattern.
profile picture

Ninozah

#3
you guys are geniouses!!!!!
Thank you so much.
profile picture

NoelG80

#4
Hi,

as I'm very satisfied with the backtesting results of this strategy, i'm now trying to create a screener to detect these Chart Patterns.

When I'm using the normal approach to create a screener and changing the code line from

CODE:
Please log in to see this code.

to
CODE:
Please log in to see this code.


an error message pops up. So how can I create a screener for this strategy?


Thanks a lot in advance.


Greetings,

Steffen
profile picture

NoelG80

#5
Hi again,

I'm sorry for my post yesterday. I have overread the post #2 from Eugene, where i find the answer to my question. Please ignore my post from yesterday.


Greetings,

Steffen

profile picture

Eugene

#6
Hi Steffen,

Glad to find that you were able to find a solution. For easier recognition, I've highlighted which entity in post #2 is a backtestable system and which one is the C&H pattern scanner.
profile picture

NoelG80

#7
Hi Eugene,

first, thanks for clarifying which is the backtestable system and which is the scanner.

I got two questions to this issue.

1. After running a backtest i also got alerts from the backtest. So is there a difference between the backtestable system and the scanner? And if yes, what's the difference?

2. As i'm just copying the following code of the scanner:

http://www2.wealth-lab.com/WL5Wiki/TASCApr2011.ashx

into a new code, two error messages are popping up. Unfortunately there are in german and i can't translate them in a proper way. Otherwise i would have copied them in here.

Are there some adjustments needed to the scanner to work properly?


Thanks in advance for answering my questions.


Greetings,

Steffen

profile picture

Eugene

#8
Steffen,

There indeed is a compile error. Please stand by while we fix it. Thanks for the heads-up.
profile picture

Cone

#9
1. A scanner looks for a pattern, trigger, signal, etc. that is valid for the last bar in the chart without any "memory" to what has preceded it. In Wealth-Lab terms, a scanner won't show any historical trades and only generates an Alert if the trigger condition is valid.

A backtestable system has both entry and exit logic for a trading strategy. In Wealth-Lab, BuyAt or ShortAt signals create Position objects that you have to manage in the script's exit logic.

2. After the article was published, I modified the SemiCup class to include a public Dictionary<int bar, CupStatus cs> Status that holds the CupStatus for each bar between the semi-cup's StartBar and BarInactive.

Wiki script fixed. Recopy and try again.
profile picture

NoelG80

#10
Hi Cone,

thanks for your explanations. The script now works fine.


Thanks again for your fast answer.


Greetings,

Steffen