PureBytes Links
Trading Reference Links
|
Good day,
still learning the ropes of AB. Here are 2 simple BUY conditions I
would like to test on a portfolio:
BUY, if
1. Close is the highest in 10 days and
2. Close is 3% higher than yesterday's Close
Exit at the Close after 5 days.
This is what I tried:
------------------------------------
Close10 = HHV ( Close,10); //defining a variable here
Cond1 = C > (1.03 * Ref(Close,-1)); // this is the first condition
Cond2 = C > Close10; // this is the 2nd condition
Buy = (Cond1 AND Cond2);
-----------------------------------------
For EXIT (or SELL) I have defined an EXIT after 5 days under
SETTINGS, STOPS and put down 5 BARS.
Obviously there is something wrong. I get an error message:
"Define BUY / SELL".
Thanks for helping a greenhorn.
Werner
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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/
|