Please Add buy & Sell Arrow

#1
Dear Experts

Kindly add buy signal when Fast DMA for 3 period corss over EMA5
& Sell signal When Fast DMA for 3 period cross below EMA 15

--------------------------------------------------------------

_SECTION_BEGIN("Background_Setting");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
ParamColor("BgBottom", colorBlack),ParamColor("titleblock",colorGrey40));
_SECTION_END();


_SECTION_BEGIN("Three Shift Indicator");

EMAPeriod = Param("Fast EMA",3,1,25,1);
DisplacementPeriod = Param("Shift",-3,-25,25,1);

//Plot the Lines
Plot(Ref(EMA(Close,EMAPeriod),-DisplacementPeriod),"DEMA1",colorYellow,styleLine);
Plot(EMA(Close, 5 ), "5 Wk EMA", colorGreen, styleLine);
Plot(EMA(Close, 15 ), "15 Wk EMA", colorRed, styleLine);
Title = Name() + " " + Date() + EncodeColor(colorIndigo) + " " + C + WriteVal(ROC( Close, 1) ) + "%" + EncodeColor(colorBlack) + " Three Shift Indicator ";
_SECTION_END();
 
#2
Try This ;)


_SECTION_BEGIN("Background_Setting");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
ParamColor("BgBottom", colorWhite),ParamColor("titleblock",colorGrey40));
_SECTION_END();


_SECTION_BEGIN("Three Shift Indicator");

EMAPeriod = Param("Fast EMA",3,1,25,1);
DisplacementPeriod = Param("Shift",-3,-25,25,1);
kalin= (Ref(EMA(Close,EMAPeriod),-DisplacementPeriod));
ince1= (EMA(Close,5));
ince2= (EMA(Close,15));
//Plot the Lines
Plot(Ref(EMA(Close,EMAPeriod),-DisplacementPeriod),"DEMA1",colorYellow,styleLine) ;
Plot(EMA(Close, 5 ), "5 Wk EMA", colorGreen, styleLine);
Plot(EMA(Close, 15 ), "15 Wk EMA", colorRed, styleLine);
Title = Name() + " " + Date() + EncodeColor(colorIndigo) + " " + C + WriteVal(ROC( Close, 1) ) + "%" + EncodeColor(colorBlack) + " Three Shift Indicator ";
_SECTION_END();


Buy= Ref (kalin,-1)<Ref(ince1,-1) AND Ref (kalin,-1)<Ref(ince2,-1) AND kalin>ince1 AND kalin>ince2 ;
Sell= Ref (kalin,-1)>Ref(ince1,-1) AND Ref (kalin,-1)>Ref(ince2,-1)AND kalin<ince1 AND kalin<ince2;

dist = 1.5*ATR(21);

for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "BUY\n@" + C[ i ], i, L[ i ]-dist, colorBlue );
if( Sell ) PlotText( "SELL\n@" + C[ i ], i, H[ i ]+dist, colorBlack);
}
 

vu22rps

Active Member
#3
Can I have an exploration scan for Buy when the Yellow cuts the Green from bottom and a Sell when the yellow cuts the Red from top. Thanks.
 

Similar threads