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

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



PureBytes Links

Trading Reference Links



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








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/