Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: TrendingRibbonArrowsADX
Author/Uploader: Viorel CRISTEA - spintariscop [at] yahoo.com
Date/Time added: 2009-07-04 15:05:20
Origin: TrendingRibbon
Keywords: isrg
Level: basic
Flags: system

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:

Buy (sell) signals exhaustive(!?) trading system, with elementary, but strong rules.

Formula:

// Paste the code below to your price chart somewhere and green ribbon means
both
// both MACD and ADX trending up so if the red ribbon shows up the MACD and the
ADX 
// are both trending down.

_SECTION_BEGIN("trending ribbon");
uptrend=PDI()>MDI() AND MACD()>Signal() AND (ADX()>20);
downtrend=MDI()>PDI() AND Signal()>MACD();
_SECTION_END();

_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", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();
Buy=Cross(StochK(),StochD()) AND uptrend OR Cross(PDI(),MDI()) AND uptrend OR
Cross(ADX(),MDI()) AND (PDI()>MDI()) OR Cross(MACD(),Signal()) AND (ADX()>20)
AND (StochK()>StochD());    
Sell=Cross(Signal(),MACD());

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Low,Offset=-15);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,High,Offset=-15);

Comments:

Evelyn

2009-07-05 09:15:07
I believe the following code is needed in order to plot the ribbon:

Plot( 2, /* defines the height of the ribbon in percent of pane width */\\\"ribbon\\\",
IIf( uptrend, colorBrightGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
Viorel CRISTEA
spintariscop [at] yahoo.com
2009-07-05 09:47:56
Now, with Ribbon:

// Paste the code below to your price chart somewhere and green ribbon means both
// both MACD and ADX trending up so if the red ribbon shows up the MACD and the ADX
// are both trending down.

_SECTION_BEGIN(\\\"trending ribbon\\\");
uptrend=PDI()>MDI() AND MACD()>Signal() AND (ADX()>20);
downtrend=MDI()>PDI() AND Signal()>MACD();
_SECTION_END();

_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\\\", colorBlack ), styleNoTitle | ParamStyle(\\\"Style\\\") | GetPriceStyle() );
_SECTION_END();
Buy=Cross(StochK(),StochD()) AND uptrend OR Cross(PDI(),MDI()) AND uptrend OR Cross(ADX(),MDI()) AND (PDI()>MDI()) OR Cross(MACD(),Signal()) AND (ADX()>20) AND (StochK()>StochD());
Sell=Cross(Signal(),MACD());

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Low,Offset=-15);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,High,Offset=-15);

Plot( 2, /* defines the height of the ribbon in percent of pane width */\\\"ribbon\\\",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM