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

RE: [amibroker] Re: Holy Grail? NOT!



PureBytes Links

Trading Reference Links

Jim: sure you can, just with a tiny bit more risk.

Set up your signal in RT, set the interval to Daily, monitor it starting
at 3:30 and when you see the indicator give its signal just before
4:00pm, click on your buy or sell order button.  Some symbols trade in
after hours so you could execute your signal then if you did not get it
filled before 4pm.  There may be some circumstances when you can not
tell, at say 3:55 whether the signal will fire...take the risk and take
the trade or stand aside and take the risk that the signal fires in the
last minute or two, but this should be a minority of times.  Thus you
get the benefits of trading with zero delay....

Just MHO.

Ken

-----Original Message-----
From: Jim Hutchison [mailto:phutch@xxxxxxxxxxx] 
Sent: Monday, February 10, 2003 1:59 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Re: Holy Grail? NOT!

Your system will get a high return on account because there is no trade
delay set “SetTradeDelays(0, 0, 0, 0);”. You are buying or selling at
the close on the same day the trading signal is generated. Which would
not be possible in real life. You can not trade at the close after the
close.

Jim Hutchison


-----Original Message-----
From: tchan95014 <tchan95014@xxxxxxxxx> [mailto:tchan95014@xxxxxxxxx] 
Sent: Monday, February 10, 2003 1:01 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Holy Grail? NOT!

Hi, All,

Apparently some explanation is in order. Please check below along the 
AFL code.

BTW, not all tickers have excellent results, there are many also 
suffer bad losses.

Any comments are welcome. Thanks.

Thomas

----------------------------------------------------------------------
-------
Hi, All,

When I ran the attached AFL file below on CIEN (daily), it generated
RAR% > 1900 (from 2000-1-1 to today), which is incredible, look like a
holy grail found. I ran more tickers and more ridiculous profit.

However, when I ran the 'explore', I just could not match up my code
with the output, nor the ARROWS. I do not even understand why the
'explore' output was presented the way it was.

Any kind sould please help, I just could not see what I did wrong.
If there is any use of future data, I could find it nor AB.
Please run 'backtest', then compare it with the output of 'explore'

Thanks.


Thomas


// -------------------------------------------------------------------
------------------------------------
// ATR range breakout system, run on daily bars
//
// This is a very simple volatility breakout system.
// It keys off YESTERDAY's close +/- some multiple of ATR(n), n = 10. 
multiple = 0.6 here.
// Hence, if TODAY's high > long breakout price determined by 
yesterday close (priceB), we go long
// if TODAY's low < short breakout price determined by yesterday's 
close (priceS), we go short
// Because of this nature, we have to use SetTradeDelays() on 
BUY/SHORT to 0, you set a STOP
// price and enter your order before OPEN and wait for execution.
// Since we always WAIT 20 days AFTER entry, and we exit our position 
on OPEN, there is not much
// difference in setting SetTradeDelays() on SELL/CLOSE to 0 or 1.
//
// If you check, you will see priceB and priceS is YESTERDAY's 
breakout prices to be used today.
// I like to use TODAY as the base, if any signal occurs today, I can 
set the STOP price for tomorrow.
// Also, if there is any execution TODAY.
//
// -------------------------------------------------------------------
-------------------------------------
// System defines
// -------------------------------------------------------------------
-------------------------------------

SetTradeDelays(0, 0, 0, 0);

// -------------------------------------------------------------------
-------------------------------------
// System Parameters
// -------------------------------------------------------------------
-------------------------------------

smoothB = 10;           // 10-bar ATR() is used
multipleB = 0.6;        // with 0.6 * ATR(10) as the volatility 
breakout range
wait = 20;              // wait  20 bars after entry then exit
smoothS = smoothB;      // make sure LONG and SHORT uses same 
parameters
multipleS = multipleB;

entryB = C + multipleB * ATR(smoothB);  // BUY breakout price for 
NEXT bar
entryS = C - multipleS * ATR(smoothS);  // SHORT breakout price for 
NEXT bar
priceB = Ref(entryB, -1);               // make sure we are using 
PREVIOUS bar for our decision making
priceS = Ref(entryS, -1);               // make sure we are using 
PREVIOUS bar for our decision making

// if TODAY's high > YESTERDAY's Close +/- breakout range, we want to 
act on.
// Because we are using yesterday price, we are pretty much setting 
up a STOP price
// to act, from yesterday's price, on today's price.

CondBuy = IIf(H > priceB, 1, 0);        // priceB is previous bar 
price
CondShort = IIf(L < priceS, 1, 0);      // priceS is previous bar 
price

// -------------------------------------------------------------------
-------------------------------------
// Trading System Rules
// -------------------------------------------------------------------
-------------------------------------

Buy = CondBuy;                          // CondBuy was created for 
debug only
Sell = Ref(Buy, -wait);                 // supposedly a 20 day wait 
before SELL
Short = CondShort;
Cover = Ref(Short, -wait);
ExRemSpan(Buy, wait);                   // I thought I don't need 
this, because
ExRemSpan(Short, wait);                 // equity(1) is used below 
(makes no difference though)

BuyPrice = IIf(Open > priceB, Open, priceB);    // Make sure entry 
price is realistic
ShortPrice = IIf(Open < priceS, Open, priceS);
SellPrice = Open;                       // Since we set a 20-day 
wait, I assume Sell will onlu
CoverPrice = Open;                      // be set to TRUE, 20 bars 
after 'Buy' is triggered

// -------------------------------------------------------------------
-------------------------------------
// Equity info
// -------------------------------------------------------------------
-------------------------------------

Eq = Equity(1);

// -------------------------------------------------------------------
-------------------------------------
// Exploration
// -------------------------------------------------------------------
-------------------------------------

Filter = 1;

AddColumn(O, "Open");
AddColumn(H, "High");
AddColumn(L, "Low");
AddColumn(C, "Close");
AddColumn(V, "Volume", 1.0);

AddColumn(CondBuy, "CondBuy");
AddColumn(Buy, "Buy", 1.0);
AddColumn(Sell, "Sell", 1.0);
AddColumn(entryB, "entryB");

AddColumn(CondShort, "CondShort");
AddColumn(Short, "Short", 1.0);
AddColumn(Cover, "Cover", 1.0);
AddColumn(entryS, "entryS");




Yahoo! Groups Sponsor
ADVERTISEMENT




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 

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



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 

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/ 





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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/