PureBytes Links
Trading Reference Links
|
Hi,
Some questions:
1) Is this equivalent to Stephane's Exit suggestion:
Sell=0; // to exit via a stop condition instead of 'normally'
ApplyStop(stopTypeNBar,stopModeBars,5,0);//to exit after 5 bars
?
2) If so, are these the correct Settings, when using EOD data:
ActivateStopsImmediately turned OFF
Trade delays set to zero
Trade price set to Close
?
thanks,
-john
----- Original Message -----
From: "Stephane Carrasset" <s.carrasset@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, March 10, 2004 7:42 AM
Subject: [amibroker] Re: Help with 2 simple BUY conditions
Hello,
Buy1= C> HHV(ref(c,-1),10);
Buy2=C>ref(c,-1)*1.03;
Buy=Buy1 and Buy2;
sell=ref(exremspan(Buy,5),-5);
>
> 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
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/
|