Semi-Cup Trading System
In the April 2011 issue of TASC magazine, Dr. Siligardos presented an algorithm to detect cups (as in "cup and handle") early in their formation. As such he called the pattern a "semi-cup". 
		I improved the algorithm (I think) and added backtesting capability for Semi-Cup
		patterns as demonstrated by this script.  Due to the use of the 30-week
		moving average, I recommend running this particular Strategy on Daily or Weekly
	bars. 
Trading Rules
	- Go long when SemiCup CupStatus = CupStatus.FormingCup and
	Price (Close) is above 30-week sma
 
	- Install an initial stop at the L0 level,
	below which the Semi-cup is determined to have "failed"; CupStatus.Failed
 
	- When price exceeds the L4 level, raise stop to breakeven
 
	- When price exceeds L5 (the peak on which the
	Semi-cup is based) raise stop to the L3 level or 30-week ma, which ever is greater. 
 
Getting in earlier
	Before entering a Position this Strategy
		waits for a "L2" breakout, which is an indication that a
		"cup" is actually forming.  Nonetheless, a Semi-cup is often
		identified when price is very close to is base L0 level.  You could, for
		example, enter larger Positions (using Risk Stop sizing) closer to L0 to take
		advantage of the move to and above L2.  The trade-off is accepting more
		Semi-cup failures on a closing price below L0.  Note that since the
		detection algorithm re-enters CupStatus.Search immediately after a failure, the
		same Semi-cup will most often be reformed at the new base level, at which time
an aggressive trader could take on a new Position again.
Notes and more
		documentation: 
	 
	- Requires TASCIndicators Extension
		2011.4.0.1
	
 
	- 
		
 Identifying
			Cup Formations Early in the Wiki. 
	
 
	- 
		
 SemiCup
				Pattern Detection  has the TASCIndicators API documentation for
				the SemiCup classes used in
			this script.