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

RE: [amibroker] Switching two securities!



PureBytes Links

Trading Reference Links

Buy = cross(macd(),0);
Buy = ExRemSpan( Buy, 10 );
Sell = Ref( Buy, -10 );

ExRemSpan:

Removes excessive signals that span numbars bars since initial signal.
(In other words first non-zero bar passes through, then all subsequent
non-zero bars are ignored (zero is returned) until numbars bars have passed
since initial signal. From then on a new signal may pass through)

This function makes easy writing exits after a fixed number of bars, for
example if you want to sell always 5 bars after the buy you should now use
combination of ExRemSpan and Ref(). It will work even if initial buy array
has lots of redundant signals:

Anthony
----- Original Message -----
From: "jazzman960" <treeiii@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, January 15, 2004 12:13 AM
Subject: [amibroker] Bars Since Entry?


> Hello.  I simply want to exit my position X days after going long or
> short.  How can I code this in amibroker? For example, go long when
> macd crosses 0, exit long 10 days later. I tried using the barssince
> function but have had no luck.  Thanks.
>
> Jazz
>
>
>
> 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/
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 1/9/2004


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/