PureBytes Links
Trading Reference Links
|
If the date referred to does not actually occur (eg weekend or non traded
day) then it is better to use the before and after sequence to nominate the
next traded bar.
I would prob prefer to use this
Ref(timenum(),-1)<880104 and timenum()>=880104
Cheers,
Graham
http://groups.msn.com/asxsharetrading
http://groups.msn.com/fmsaustralia
-----Original Message-----
From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@xxxxxxxxx]
Sent: Friday, 9 January 2004 7:06 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Moon Trades
Just one technical note:
Dt<=880104 and DtNext>880104 ;
is equivalen to
Dt==880104 ;
And another one :
Avoid using ref(XXX,1), it looks into the future and has always a
problem at the last bar [when the future is unknown...]
As for the moon phases, I have no idea, I still keep the romantic
point of view...
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "qqqqq_99999_qqqqq"
<qqqqq_99999_qqqqq@xxxx> wrote:
> I just wanted to backtest a simple "lunar cycles" of buying "Full
> Moon" and shorting "New Moon" but could not find a reasonably
accurate
> formula to generate the full-moon and new-moon dates.
>
> So I web-searched and found the calendar and hard-coded them as
> follows:
>
> Dt = DateNum();
> DtNext = Ref( DateNum(), 1 );
>
> Buy = Cover =
> (Dt<=880104 and DtNext>880104) or
> (Dt<=880203 and DtNext>880203) or
> ...
> (Dt<=1040307 and DtNext>1040307) or
> (Dt<=1040405 and DtNext>1040405);
>
> Short = Sell =
> (Dt<=880119 and DtNext>880119) or
> (Dt<=880218 and DtNext>880218) or
> ...
> (Dt<=1040321 and DtNext>1040321) or
> (Dt<=1040419 and DtNext>1040419);
>
> The above code works OK for the short history but eats up too much
> memory to be usable when the history is long.
>
> Could anyone suggest the memory-efficient way of hard-coding them,
or
> "simple and elegant" solution?
>
> ysk
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 Sponsor ---------------------~--> Buy
Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer
at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
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/
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/
|