[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Basic breakout code ?



PureBytes Links

Trading Reference Links

Here is one coded by Dimitris Tsokakis who posted many formulas years 
ago.  If you want to follow the thread,
search the group messages.


// For Indicator Window NAME: Break Outs - DT
// An Indicator Plots a high and low bar and color codes the price line 
for bullish breaks

H0=H;
L0=L;
C0=C;
O0=O;
Lookback=50; // orig=50 100 used in the Rebels Contest-looks #days back 
in time
shift=5; // orig=30 60 used in the Rebels Contest--discards # closest to 
current bar
x0=LastValue(Cum(1));
x1=x0-shift;
H=Ref(H,-shift+1);
L=Ref(L,-shift+1);
H1=LastValue(Ref(HHV(H,Lookback),-1));
L1=LastValue(Ref(LLV(L,Lookback),-1));

GraphXSpace=1;

Plot(H1,"Breakouts  H1",colorYellow);
Plot(L1,"L1",colorYellow);
Title= "Breakouts "+Name()+" "+Date()+EncodeColor(colorBlack) +" 
H1="+WriteVal
(H1)+" Date Hi="+ Date();
H=H0;L=L0;C=C0;O=O0;
Buy=up=Cross(H,H1) AND Cum(1)>x1;
Sell=dn=Cross(L1,L) AND Cum(1)>x1;
//PlotShapes(IIf(Hibar,shapeUpArrow,shapeNone) 
,colorBrightGreen,0,Graph0,-15);

Plot(C,"Close",IIf(Cum(1)>x1-Lookback AND Cum(1)<=x1,colorBlue,IIf
(Up,colorBrightGreen,IIf( Dn,colorRed,colorBlack))),64);

PlotShapes(shapeDownArrow*(Cum(1)==x1+1),colorBlue);

hth, ron



Richard Jay wrote:
> I was browsing the AFL library trying to find something that will
> highlight a breakout but couldn't find anything. Is this too vague a


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/