Need Help - Buy Sell Arrows not coming in this code

#1
Dear Senior Members,
Requesting help to find what is wrong in my code...
I'm not getting the Buy / Sell Arrows on screen.
Here is the code:

_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();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), ParamColor("Color", colorBlueGrey ), ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick, maskHistogram ), 2 );
_SECTION_END();

Cross_5_8_B=Cross(EMA(Close,5), EMA(Close,8));
Cross_8_13_B=Cross(EMA(Close,8), EMA(Close,13));
Cross_8_5_S=Cross(EMA(Close,8), EMA(Close,5));
Cross_13_8_S=Cross(EMA(Close,13), EMA(Close,8));


Buy = Close > Cross_5_8_B AND Cross_8_13_B;
Sell = Close < Cross_13_8_S and Cross_8_5_S;


Short = Sell;
Cover = Buy;

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(shape, IIf(Buy, colorGreen, colorRed), 0, IIf(Buy, Low, High));
 
#3
Dear Prostitutos,

Thanks for the reply.
However, that did not work.
Can u pls recheck the code and help for signals arrows to be generated.
warm regards...rbhapkar
 
#4
hi prostitutos,
do u know how to write any afl? i need a help in writing a condition. can u pls help me? let me know ..thanks in advance..
 
#5
hi,
do you think that this line will be true for any day?
Buy = Close > Cross_5_8_B AND Cross_8_13_B;
Sell = Close < Cross_13_8_S and Cross_8_5_S;

Cross function gives an array of 1's or 0's
Close is the close price.

buy will be always true if close price is more than 1, so sell will be always false for (e.g. Reliance) .

Give the conditions specifically like.
I would like to buy when ema5_8 < ema _8_13 and close is more than the value when the cross took place (specify how many days in history should one look for cross) or something like that..
regards
ashutosh