Popup Syntax Coding Help required

#1
Hello,
I'm a novice to Amibroker and have got the 5.2 ver installed. I found one of the AFL's on the net which I'm trying to incorporate .

Following is the Code - "FibboGatto" (modified it a bit, as per my basic knowledge):
*******************************************************
_SECTION_BEGIN("FibboGatto");

FG = ((C+Ref(C,-1)+Ref(C,-2)+Ref(C,-3)+Ref(C,-5)+Ref(C,-8)+Ref(C,-13)+Ref(C,-21)+Ref(C,-34)+Ref(C,-55)+Ref(C,-89)+Ref(C,-144))/C)*-1;

Plot(FG, "FibboGatto", colorRed);
Plot(EMA(FG,38), "", colorLightBlue);

Buy = Cross(FG,EMA(FG,38));
PlotShapes( IIf( Buy, shapeDownArrow + shapePositionAbove, shapeNone ), colorGreen );

Sell = Cross(EMA(FG,38),FG);
PlotShapes( IIf( Sell, shapeUpArrow + shapePositionAbove, shapeNone ), colorRed );

Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
Shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(shape, IIf(Buy, colorGreen, colorRed),0, IIf(Buy,Low,High));

if (LastValue(Buy))
{
PopupWindow("Buy : " + FullName(),"Alert", 5, 640*mtRandom(), 480*mtRandom());
};
if (LastValue(Sell))
{
PopupWindow("Sell : " + FullName(),"Alert", 5, 640*mtRandom(), 480*mtRandom());
}

_SECTION_END();
************ ********* ********* ********* ***
With the above code, I get 2 dialog boxes at the same time :confused: which gives a BUY and a SELL for a particular scrip.

I tried coding the Popup option, which I wanted as follows:
SHOULD POP-UP A WINDOW (5SECS DELAY). SAY FOR EXAMPLE, IF THE CROSSOVER HAPPENS FOR SELL, IT SHOULD GENERATE A WINDOW INDICATING THE NAME OF THE SCRIP AND THE SELL DIALOG - "AFTER THE CLOSE OF THE CANDLE WHEN THE CROSSOVER HAPPENED ".
THE NEXT DIALOG BOX OF THAT SCRIP SHOULD OCCUR WHEN THE SIGNAL CHANGES TO BUY....

I would be grateful to the experts of the group who can code the same for me.

Thanks....RB

PS : Attaching the snapshot of the screen capture of the buy/sell arrows
 

Attachments

Similar threads