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

Re: [amibroker] Holy Grail? NOT!



PureBytes Links

Trading Reference Links

Hello,

I don't understand why you are doing this hard way.

Just use v4.28.1 and add

ApplyStop( 3, 1, 20, True ); // automatic N-bar stop, here N is set to 20 bars.

As for getting incredible results - it is easy to explain.
Your formula uses indicators like ATR (which use close, high and low)
while trading on open without delay.

This is looking into the future. Add delay of one bar and the incredible results
will disappear. As a general rule: if you are trading on OPEN you should
add delay of one bar (if you are using indicators that reference either H,L,C of
current bar)


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: <tchan95014@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, February 10, 2003 7:44 AM
Subject: [amibroker] Holy Grail? NOT!


> 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
> 
> 
> //
> 
> 
> // 
> ----------------------------------------------------------------------
> ----------------------------------
> 
> 
> // System defines
> 
> 
> // 
> ----------------------------------------------------------------------
> ----------------------------------
> 
> 
> SetTradeDelays(0, 0, 0, 0);
> 
> 
> 
> 
> // 
> ----------------------------------------------------------------------
> ----------------------------------
> 
> 
> // System Parameters
> 
> 
> // 
> ----------------------------------------------------------------------
> ---------------------------------- 
> 
> 
> smoothB = 10; 
> 
> 
> multipleB = 0.6;
> 
> 
> wait = 20;
> 
> 
> smoothS = smoothB; 
> 
> 
> multipleS = multipleB; 
> 
> 
> 
> 
> entryB = C + multipleB * ATR(smoothB);
> 
> 
> entryS = C - multipleS * ATR(smoothS); 
> 
> 
> priceB = Ref(entryB, -1);
> 
> 
> priceS = Ref(entryS, -1);
> 
> 
> 
> 
> CondBuy = IIf(H > priceB, 1, 0);   // priceB is previous bar price
> 
> 
> CondShort = IIf(L < priceS, 1, 0);
> 
> 
> 
> 
> // 
> ----------------------------------------------------------------------
> ----------------------------------
> 
> 
> // 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'e need this, because
> 
> 
> ExRemSpan(Short, wait);    // equity(1) is used below
> 
> 
> 
> 
> BuyPrice   = IIf(Open > priceB, Open, priceB);
> 
> 
> ShortPrice = IIf(Open < priceS, Open, priceS);
> 
> 
> SellPrice  = Open;
> 
> 
> CoverPrice = Open;
> 
> 
> 
> 
> // 
> ----------------------------------------------------------------------
> ----------------------------------
> 
> 
> // 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");
> 
> 
> 
> 
> 
> 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/