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

[amibroker] It could be



PureBytes Links

Trading Reference Links

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/