[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Delaying A Buy or Sell



PureBytes Links

Trading Reference Links

Here is my code I am working on just to try and understand AFL.
Nothing big just a cross of a 13 and 5 day ema. How Can I delay the 
buys and sells for a given number of bars or days? I have tried 
barssince function without any luck. I am sure I am doing something 
wrong but getting frustrated and thought someone here could help me a 
bit.

Thanks
Rusty
MaxGraph = 18;
Plot ( Close, "Close", colorBlack, styleBar);
Graph3Style = 1;
Graph3Color = 43;
Graph3 = EMA (Close, 5);
Graph4Style = 1;
Graph4Color = 42;
Graph4 = EMA (Close, 13);
Graph5Style = 1;
Graph5Color = 32;
Graph5 = (EMA (Close, 200));
Graph6Style = 1;
Graph6Color = 21;
Graph6 = ((EMA (Close, 200))- (EMA (Close, 200))*.13) ;

//Buy = Cross( EMA( Close, 5), EMA( Close, 13 ) ) AND Close > EMA
(Close,200);
//Buy = Cross( EMA( Close, 5), EMA( Close, 13 ) ) AND Close < EMA
(Close,200);
Buy = (EMA( Close, 5)> (EMA(Close, 13)))  AND Cross( (EMA( Close, 
5)), EMA( Close, 13 ) );

//Sell = Cross( EMA( Close, 200 ), Close );
Sell = (Cross( EMA( Close, 13), EMA( Close, 5 ) ));

PlotShapes( shapeUpArrow*Buy, colorGreen,0, L, -20); 

PlotShapes( shapeDownArrow*Sell, colorRed,0,H, -20) ;





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Help tsunami villages rebuild at GlobalGiving. The real work starts now.
http://us.click.yahoo.com/njNroD/KbOLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/