I am trying to code up a simple system on daily bars where the exit
condition is only activated if there was no entry on that day.  As an
example, I want to buy the open if it is > yesterday's close.  A long
position is kept until the exit condition is true, which is sell
today's open if it is > yesterday's close.  Once the sell is
activated, we can get a new buy signal tomorrow.

This is what I've done but it doesn't work:

Buy=O>Ref(C,-1);
BuyPrice=O;
Sell= Buy==0 AND O>Ref(C,-1);
Buy=ExRem(Buy,Sell);
SellPrice=O;

It only generates 1 long entry at the beginning of the series which is
never closed.  When I do an exploration it appears to be doing the
right thing (the buy vector goes to zero after the initial signal),
but the sell vector never returns true even though the condition is met.

Any suggestions as I am stumped.

Thanks





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:
    [EMAIL PROTECTED]

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


Reply via email to