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

Re: [amibroker] Exit on specific date.



PureBytes Links

Trading Reference Links

try this
Sell= Ref(EMA(C,30),-1) > EMA(C,30) or cross(datenum(),1041201);

you could also have cross for the first buy/sell conditions
Sell= cross(ref(EMA(C,30),-1), EMA(C,30)) or cross(datenum(),1041201);
which will cut down on the number of extraneous signals


On Tue, 07 Dec 2004 22:32:36 -0000, traderkeith2000
<kosborn3@xxxxxxxxxxxxxx> wrote:
> 
> 
> Hi, the following is a simple crossover system. I would like to add to
> the sell line a condition that not only sells on the EMA cross but
> also on a specific date such as 1-dec-2004.
> 
> I want to do this so there is no open positions at the end of the
> backtest period.
> 
> Regards and thanks......Keith
> 
> Plot(C,"Close Price", colorRed,styleBar);
> Plot(EMA(C,30),"EMA - 30 Period",colorYellow,styleLine);
> 
> Buy = EMA(C,30) > Ref(EMA(C,30),-1);
> Sell= Ref(EMA(C,30),-1) > EMA(C,30);
> 
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
> 
> PlotShapes(shapeUpArrow*Buy+shapeDownArrow*Sell,
> IIf(Buy,colorBrightGreen,colorYellow));
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
> 
> 
> 
> 
> 


-- 
Cheers
Graham
http://e-wire.net.au/~eb_kavan/


------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/