Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Trend breakout momentum for Amibroker (AFL)

Rating:
2 / 5 (Votes 4)
Tags:
amibroker, trend, darvas

Take Darvas breakouts with the trend.

Often a problem with Darvas breakouts is that one can’t be sure if it is with trend.

Stay away from the green.

Here we look for a Darvas breakout of the blue line. But only if the price is within the orange. Ride it with a tight stop.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();


Plot(EMA(C, 3), _DEFAULT_NAME(), IIf(C > EMA( Close,3),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C,4), _DEFAULT_NAME(), IIf(C > EMA( Close,4),colorlightorange, colorseagreen) ,styleLine);
Plot(EMA(C, 5), _DEFAULT_NAME(), IIf(C > EMA( Close,4),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 6), _DEFAULT_NAME(), IIf(C > EMA( Close,6),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 7), _DEFAULT_NAME(), IIf(C > EMA( Close,7),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 8), _DEFAULT_NAME(), IIf(C > EMA( Close,8),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 9), _DEFAULT_NAME(), IIf(C > EMA( Close,9),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 10), _DEFAULT_NAME(), IIf(C > EMA( Close,10),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 11), _DEFAULT_NAME(), IIf(C > EMA( Close,11),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 12), _DEFAULT_NAME(), IIf(C > EMA( Close,12),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 13), _DEFAULT_NAME(), IIf(C > EMA( Close,13),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 14), _DEFAULT_NAME(), IIf(C > EMA( Close,14),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C,15), _DEFAULT_NAME(), IIf(C > EMA( Close,15),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 16), _DEFAULT_NAME(), IIf(C > EMA( Close,16),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 17), _DEFAULT_NAME(), IIf(C > EMA( Close,17),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 18), _DEFAULT_NAME(), IIf(C > EMA( Close,18),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 19), _DEFAULT_NAME(), IIf(C > EMA( Close,19),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 20), _DEFAULT_NAME(), IIf(C > EMA( Close,20),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 21), _DEFAULT_NAME(), IIf(C > EMA( Close,21),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C,22), _DEFAULT_NAME(), IIf(C > EMA( Close,22),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 23), _DEFAULT_NAME(), IIf(C > EMA( Close,23),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C,24), _DEFAULT_NAME(), IIf(C > EMA( Close,24),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 25), _DEFAULT_NAME(), IIf(C > EMA( Close,25),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 26), _DEFAULT_NAME(), IIf(C > EMA( Close,26),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 27), _DEFAULT_NAME(), IIf(C > EMA( Close,27),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 28), _DEFAULT_NAME(), IIf(C > EMA( Close,28),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C,29), _DEFAULT_NAME(), IIf(C > EMA( Close,29),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 30), _DEFAULT_NAME(), IIf(C > EMA( Close,30),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 31), _DEFAULT_NAME(), IIf(C > EMA( Close,31),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 32), _DEFAULT_NAME(), IIf(C > EMA( Close,32),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 33), _DEFAULT_NAME(), IIf(C > EMA( Close,33),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 34), _DEFAULT_NAME(), IIf(C > EMA( Close,34),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 35), _DEFAULT_NAME(), IIf(C > EMA( Close,35),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C,36), _DEFAULT_NAME(), IIf(C > EMA( Close,36),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 37), _DEFAULT_NAME(), IIf(C > EMA( Close,37),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 38), _DEFAULT_NAME(), IIf(C > EMA( Close,38),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 39), _DEFAULT_NAME(), IIf(C > EMA( Close,39),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 40), _DEFAULT_NAME(), IIf(C > EMA( Close,40),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 41), _DEFAULT_NAME(), IIf(C > EMA( Close,41),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 42), _DEFAULT_NAME(), IIf(C > EMA( Close,42),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 43), _DEFAULT_NAME(), IIf(C > EMA( Close,43),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 44), _DEFAULT_NAME(), IIf(C > EMA( Close,44),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 45), _DEFAULT_NAME(), IIf(C > EMA( Close,45),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 46), _DEFAULT_NAME(), IIf(C > EMA( Close,46),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 47), _DEFAULT_NAME(), IIf(C > EMA( Close,47),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 48), _DEFAULT_NAME(), IIf(C > EMA( Close,48),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 49), _DEFAULT_NAME(), IIf(C > EMA( Close,49),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 50), _DEFAULT_NAME(), IIf(C > EMA( Close,50),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 51), _DEFAULT_NAME(), IIf(C > EMA( Close,51),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 52), _DEFAULT_NAME(), IIf(C > EMA( Close,52),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 53), _DEFAULT_NAME(), IIf(C > EMA( Close,53),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 54), _DEFAULT_NAME(), IIf(C > EMA( Close,54),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 55), _DEFAULT_NAME(), IIf(C > EMA( Close,55),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 56), _DEFAULT_NAME(), IIf(C > EMA( Close,56),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 57), _DEFAULT_NAME(), IIf(C > EMA( Close,57),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 58), _DEFAULT_NAME(), IIf(C > EMA( Close,58),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 59), _DEFAULT_NAME(), IIf(C > EMA( Close,59),colorlightorange, colorseagreen), styleLine);
Plot(EMA(C, 60), _DEFAULT_NAME(), IIf(C > EMA( Close,60),coloryellow, coloryellow), styleLine);



Periods= Param("Darvas Periods",3,3,260); 
Periods1= Param("Darvas Periods",14,14,260); 

boxHigh = Ref(H,-3)>=Ref(HHV(H,periods),-4) AND 
                  Ref(H,-3)>Ref(H,-2) AND Ref(H,-3)>Ref(H,-1) AND Ref(H,-3)>H;
                  
 boxHigh1 = Ref(H,-3)>=Ref(HHV(H,20),-4) AND 
                   Ref(H,-3)>Ref(H,-2) AND Ref(H,-3)>Ref(H,-1) AND Ref(H,-3)>H;

Topbox=ValueWhen(boxHigh, Ref(H,-3)); 
Botbox=ValueWhen(boxHigh,LLV(L,4)); 

Topbox1=ValueWhen(boxHigh1, Ref(H,-3)); 
Botbox1=ValueWhen(boxHigh1,LLV(L,4)); 
 

/*=========================
  - Allow color change
  - Style change 
 ==========================*/
Plot(TopBox, "Top",  colorBlue);
Plot(Botbox, "Bot", colorBlue);

//Plot(TopBox1, "Top",  colorred);
//Plot(Botbox1, "Bot", colorred);

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.

Back