hey nasdaq.... you might be able to use the linregslope function or perhaps the pricechannelhigh(periods) and pricechannellow(periods) to determine the base....
the code below is a quick and rough idea of breakout exploration, with plenty of room for improvement......
===========================Exploration notes
Col A: base
( LinRegSlope(C , 20) )> -.002 AND (LinRegSlope(C ,
20) < .002)
Col B: volume
V>Mov(V,50,S)
Col C: highest
a:=HHV(H ,20);
C> Ref(a,-1)
Filter colA AND colB AND colC
Filter enabled Yes
Periodicity Daily
Records required 500
==========================
==========================
someone did a lot of research on breakouts and their research determined most breakouts fail.... can't remember who did the research but it was a legitimate group.... as an example, here is a channel breakout system ...... put those rules, the ones in that link, in the system tester and test the entire nasdaq 100..... after you see the results , switch the buys with the sells as i have in the next post below here.... trade counter to that system, sell on the breakout rather than buy..... which system preforms better.....h
==============================
10 Day Channel Breakout
Description
The 10-Day Channel Breakout looks for a breakout from a 10 day high or low If a breakout occurs, you enter in the direction of the breakout and hold the position until the first day that the direction changes.
Enter Long
When the high price exceed the highest high value during the previous ten periods.
Close Long
When the high price fails to set a new 10 day high
Enter Short
When the low price fails below the lowest low value during the previous ten periods.
Close Short
When the low price fails to set a new 10 day low.
Results
Click here to see test results
Results using total equity of $100,000
100 shares traded per signal
DJIA 2000 periods prior to 4/4/03
Code for Metastock users:
Long
EL:=H>Ref(HHV(H,10),-1);
CL:=Ref(H>Ref(HHV(H,10),-1),-1);
ES:=L<Ref(LLV(L,10),-1);
CS:=Ref(L<Ref(LLV(L,10),-1),-1);
State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV))));
State=1
Close Long
EL:=H>Ref(HHV(H,10),-1);
CL:=Ref(H>Ref(HHV(H,10),-1),-1);
ES:=L<Ref(LLV(L,10),-1);
CS:=Ref(L<Ref(LLV(L,10),-1),-1);
State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV))));
State=0 OR State=-1
Short
EL:=H>Ref(HHV(H,10),-1);
CL:=Ref(H>Ref(HHV(H,10),-1),-1);
ES:=L<Ref(LLV(L,10),-1);
CS:=Ref(L<Ref(LLV(L,10),-1),-1);
State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV))));
State=-1
Close Short
EL:=H>Ref(HHV(H,10),-1);
CL:=Ref(H>Ref(HHV(H,10),-1),-1);
ES:=L<Ref(LLV(L,10),-1);
CS:=Ref(L<Ref(LLV(L,10),-1),-1);
State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV))));
State=0 OR State=1
=============================