I have an AFL for Impulse system as stated by Dr. Alexander Elder
------------------------------
_SECTION_BEGIN("Impulse System");
//Description:
//When the MACD Histogram is up AND EMA(21) is up Price bars are green.
// When MACD Histogram is down AND EMA(21) is down price bars are red.
// if the MACD Histogram AND EMA(21) are moving in two different directions the price bars are blue.
//"When the impulse system is Green you may go long or stand aside.
//When the impulse system is red you may go Short OR stand aside.
//I wait for the impulse system to go off green before shorting AND off red before going long" - Dr. Elder
//Formula:
/*--------------------------------------------------------------------
MTR Investors Group - www.MTRIG.com
Color price bars with MACD Histogram Bars changes. Use on weekly chart
to determine market trend. See Elder "Come into my trading room"
----------------------------------------------------------------------*/
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 ) ) ));
TimeFrameSet( inDaily) ;
//MACD
r1 = Param( "Impulse Fast avg", 12, 2, 200, 1 );
r2 = Param( "Impulse Slow avg", 26, 2, 200, 1 );
r3 = Param( "Impulse Signal avg", 9, 2, 200, 1 );
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hist = ml-sl;
MACUP = Hist > Ref(Hist,-1);
MACDN = Hist < Ref(Hist,-1);
MA1 = Param( "Impluse MA", 21, 21, 200, 1 );
MAUP = EMA(C,MA1) > Ref(EMA(C,MA1),-1);
MADN = EMA(C,MA1) < Ref(EMA(C,MA1),-1);
BarColor = IIf(Close == Open,
colorBlack,IIf(Close>Open,colorGreen,colorRed));
BarColor = IIf(MACUP AND MAUP,colorGreen,IIf(MACDN AND
MADN,colorRed,colorBlue));
Plot( C, "Close", BarColor, styleNoTitle | ParamStyle("Style") | GetPriceStyle()
);
_SECTION_END();
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g, OI (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
--------------------------------------
Can seniors help me in getting the exploration from this afl having the following condition:
give exploration of the cases, where the candle is blue, ie where MACD and RSI are not having the same trend line.
Thanks in advance...
------------------------------
_SECTION_BEGIN("Impulse System");
//Description:
//When the MACD Histogram is up AND EMA(21) is up Price bars are green.
// When MACD Histogram is down AND EMA(21) is down price bars are red.
// if the MACD Histogram AND EMA(21) are moving in two different directions the price bars are blue.
//"When the impulse system is Green you may go long or stand aside.
//When the impulse system is red you may go Short OR stand aside.
//I wait for the impulse system to go off green before shorting AND off red before going long" - Dr. Elder
//Formula:
/*--------------------------------------------------------------------
MTR Investors Group - www.MTRIG.com
Color price bars with MACD Histogram Bars changes. Use on weekly chart
to determine market trend. See Elder "Come into my trading room"
----------------------------------------------------------------------*/
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 ) ) ));
TimeFrameSet( inDaily) ;
//MACD
r1 = Param( "Impulse Fast avg", 12, 2, 200, 1 );
r2 = Param( "Impulse Slow avg", 26, 2, 200, 1 );
r3 = Param( "Impulse Signal avg", 9, 2, 200, 1 );
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hist = ml-sl;
MACUP = Hist > Ref(Hist,-1);
MACDN = Hist < Ref(Hist,-1);
MA1 = Param( "Impluse MA", 21, 21, 200, 1 );
MAUP = EMA(C,MA1) > Ref(EMA(C,MA1),-1);
MADN = EMA(C,MA1) < Ref(EMA(C,MA1),-1);
BarColor = IIf(Close == Open,
colorBlack,IIf(Close>Open,colorGreen,colorRed));
BarColor = IIf(MACUP AND MAUP,colorGreen,IIf(MACDN AND
MADN,colorRed,colorBlue));
Plot( C, "Close", BarColor, styleNoTitle | ParamStyle("Style") | GetPriceStyle()
);
_SECTION_END();
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g, OI (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
--------------------------------------
Can seniors help me in getting the exploration from this afl having the following condition:
give exploration of the cases, where the candle is blue, ie where MACD and RSI are not having the same trend line.
Thanks in advance...