PureBytes Links
Trading Reference Links
|
Coll Im
I have altered the code a bit to simplify and corrected. I assumed you
wanted to close positions 1 bar from when they were opened
EqualOpenLow= Open == Ref(Low,-1);
EqualOpenHigh= Open == Ref(High,-1);
Buy = EqualOpenLow;
Sell = BarsSince(Buy)==1; // alternative would be ref(Buy,-1)
Short = EqualOpenHigh;
Cover = BarsSince(Short)==1; // alternative would be ref(Short,-1)
SetTradeDelays(0,0,0,0);
Cheers,
Graham
http://e-wire.net.au/~eb_kavan/
-----Original Message-----
From: Collectable Images [mailto:telecard@xxxxxxxxxxxxxx]
Sent: Tuesday, June 22, 2004 3:47 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Simple system not producing expected results.
At the risk of being short down in flames. :-)
I discovered a problem in my own code of one of my systems so I decided to
test a very simple idea to see why it was happening.
The Buy rule is buy when todays open is equal to yesterdays low or high
price.
Sell day after entry.
The following code produces open positions that go for months, most that are
only one day and millions entries are never when open opens at low or high.
EqualOpenLow= IIf(Open = Ref(Low,-1),1,0);
EqualOpenHigh= IIf(Open = Ref(High,-1),1,0);
Buy = EqualOpenLow;
Sell = BarsSince(Buy==1);
SetTradeDelays(0,0,0,0);
Short = EqualOpenHigh;
Cover = BarsSince(Short==1);
SetTradeDelays(0,0,0,0);
Result on DD for period 16/01/2001 to 18/6/2004 is;
Entry 4/10/2002 and exit 11/12/2003
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 --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/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/
|