PureBytes Links
Trading Reference Links
|
I didn't receive a reply to my last post, so maybe what I wrote was
confusing. I'll try to make this simpler. any help is much appreciated.
the following should, I believe, enter a trade and hold for 5
days. then it should always enter a new trade on the day following the
exit day of the last trade. the problem is, that the code below does
not accomplish that and I really don't know why? anyone have any ideas?
thanks
SetTradeDelays(0,0,0,0);
SetPositionSize( 25, spsPercentOfEquity );
SetOption("AllowSameBarExit", False);
SetOption("ReverseSignalForcesExit", False);
BuyPrice = ShortPrice = O;
SellPrice = CoverPrice = C;
numdays= 4;
// enter long positions
Cond1= O > C;
Buy = Ref(Cond1,-1);
// exit long
Buy = ExRemSpan( Buy, (numdays) );
Sell = Ref( Buy, -(numdays) );
// enter short positions
Cond2= O <= C;
Short = Ref(Cond2,-1);
// exit short
Short = ExRemSpan( Short, (numdays) );
Cover = Ref( Short, -(numdays) );
------------------------------------
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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|