PureBytes Links
Trading Reference Links
|
Hi, TJ,
Thanks for the info. I do know I can use the ApplyStop() as I do use
the 4.28.1 version.
However, while I am developing a system, I use a template and adding
variations to it, I happened to use other SELL condition and just
thought how if I just make it into a N-bar SELL. (I suppose, I would
get the same test results, wouldn't I ? Please correct me if there is
anything wrong with my code.) There are many ways to skin a cat, but
the end results and IF the procedure performed correctly, the end
results should be the same skinless cat, right? ;-)
As for the looking into future, I have tried to explain a couple of
times, including the explanation in the code, since I have delayed
the exit for so many bars, I do not see using trade delay of 0 is a
concern at all. Run it on any ticker and use 'explore' and you will
see the unexplainable results I saw.
In one of the reply message I sent, I also mentioned that you can
also get some horrible results, I just picked up CIEN as an example.
There are too many examples that go in extreme, unrealistic results,
good or bad. If I looked into the future, most of the test results
should be pretty good, right?
Thomas
--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
wrote:
> 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@xxxx>
> 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/
|