PureBytes Links
Trading Reference Links
|
Micmus,
Thanks that worked. I came up with a more convulted way of getting it going,
but your suggestion is much better.
Yes, I am on ihub with same nick? You?
-----Original Message-----
From: micmus2002 [mailto:micmus2002@xxxxxxxxx]
Sent: Thursday, February 03, 2005 12:55 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Exploration problem
Dimension,
I think the following might work.
buyCond = ( Month( ) == 2 ) and (ref(month(),-1) ==1)
sellCond=BarsSince(BuyCond)==14;
BTW are you on iHub with the same nick ?
--- In amibroker@xxxxxxxxxxxxxxx, dimension <dimension@xxxx> wrote:
> Hmmm.I think I may know what it is. I believe it is the "Day() ==
1". That
> may fall on a non-trading day, such as the weekend.
>
>
>
> How can I say "Buy the first trading day of February, and sell On
February
> 14 or the first trading day after BEFORE that"?
>
>
>
> _____
>
> From: dimension [mailto:dimension@x...]
> Sent: Wednesday, February 02, 2005 11:35 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Exploration problem
>
>
>
> I am trying to write an exploration/backtest that Buys on Feb 1st,
and sells
> 14 days later. The code below works, but only seems to show results
for 2000
> and 2001. The ticker I am using is FLWS. I have daily data for it
from 1999
> to today. Range is set to "All Quotations". Anyone see any flaws?
>
>
>
> DAYSTOHOLD = 14;
>
> DAYB4BUY = DAYSTOHOLD + 1;
>
>
>
> buyCond = ( Month( ) == 2 ) && ( Day( )== 1 );
>
> sellCond = BarsSince( buyCond ) == DAYSTOHOLD ;
>
>
>
> BuyPrice = Ref( C, -( DAYSTOHOLD ) );
>
> priceB4BUY = Ref( C, -( DAYB4BUY ) );
>
>
>
> Buy=buyCond; Sell = sellCond;
>
>
>
> AddColumn( priceB4BUY, "P B4 Buy");
>
> AddColumn( BuyPrice, "Buy");
>
> AddColumn( C, "Sell");
>
> AddColumn ( C - BuyPrice , "G/L", 1.2);
>
> AddColumn ( ( ( C - BuyPrice ) / C ) * 100, "%G/L", 1.2);
>
>
>
> Filter = Sell;
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> 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
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo!
> <http://docs.yahoo.com/info/terms/> Terms of Service.
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
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/
|