Join our facebook group for Amibroker afl code discussion https://www.facebook.com/groups/603980776889348

Dotted DMA Crossover System


Dotted DMA Crossover System
Dotted DMA Crossover System


//www.aflcode.com
/***************************************************************************************************
    The DiNapoli 3 x Displaced Moving Averages


     * DMA  3 x 3 - The 3 period simple moving average of close, displaced
forward 3 periods
                    for the short term and is extremely useful in thrusting
markets.

     * DMA  7 x 5 - The 7 period simple moving average of close, displaced
forward 5 periods
                    longer-based DMA that many have found useful in equity
market analysis

     - DMA 25 x 5 - The 25 period simple moving average of close, displaced
forward 5 periods
                    longer term DMA



*************************************************************************************************/


_SECTION_BEGIN("DMA3x3");
Periods = 3;
Displace = 3;
Plot( MA( C, Periods), _DEFAULT_NAME(), ParamColor( "Color", colorRed ),
ParamStyle("Style", styleLine, maskDefault|styleDots), Null, Null, Displace ); 
_SECTION_END();

_SECTION_BEGIN("DMA7x5");
P = C;
Periods = 7;
Displace = 5;
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorBlue ),
ParamStyle("Style", styleDashed, maskDefault|styleDots), Null, Null, Displace );

_SECTION_END();

_SECTION_BEGIN("DMA25x5");
P = C;
Periods = 25;
Displace = 5;
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorGreen ),
ParamStyle("Style", styleDashed, maskDefault|styleDots), Null, Null, Displace );


_SECTION_END();

//*** Remove below portion, so that you can attach to any price chart ***  

_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C=
%g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue(
ROC( C, 1 )) ));
PriceStyle = GetPriceStyle();
PriceStyleOpt = ParamStyle("Style") | PriceStyle;

if (PriceStyle==styleCandle)
   Plot( C, "", colorBlack,  PriceStyleOpt); 
else
   Plot( C, "", IIf( Close >= Ref(C, -1), colorBlue, colorRed ),
PriceStyleOpt);

Previous
Next Post »