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

RE: [amibroker] Newbie here at backtesting buys under the sells not needed.



PureBytes Links

Trading Reference Links

Hi,

you need to take the 200day condition to your buy rule.

Buy = Cross( EMA( Close, 5), EMA( Close, 13 ) ) and close > ema(close,200);
Sell = Cross( EMA( Close, 200 ), Close );



Best regards

Thomas Zmuck
www.tradingbasis.com



-----Original Message-----
From: kandrstocks [mailto:kandrstocks@xxxxxxxxx] 
Sent: Monday, February 14, 2005 5:02 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Newbie here at backtesting buys under the sells not
needed.




I have probably a very easy problem here. I have a couple lines of 
code for a very simple backtest. I am just starting out in the AFL 
language and I do know if I asked tech support that they would come 
to my rescue (Thomasz is Great) but I would rather get aquainted with 
this board and hopefully help out someday. Anyway here is my code.

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

As you can see I want to buy when the EMA 5 crosses the EMA 13 and 
sell when the close crosses the EMA 200. The problem I have is the 
fact that after the close crosses the EMA 200 of course it still has 
the buys when the EMA 5 crosses the EMA 13, but since it is already 
below my sell point I certainly don't want to buy again.

Basically I am looking for if below the EMA 200 no buy is generated. 

Thanks









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



 






------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/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/