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

Re: [amibroker] Re: Amazing backtest ==> Automatic/program trading



PureBytes Links

Trading Reference Links

Well, Claud, having been there before, I've often had to bite my tongue 
after getting truly amazing results from backtesting only to be 
disappointed with something I had set wrong. So, I hate to burst your 
bubble, but your backtest is not correct. I copied your code into the AA 
window, set the date period as you suggested, used YHOO as the test 
symbol, and set the initial equity at $10 K. I got a net profit of $4.3 
million (you reported $5 M, but I won't quibble over a mere million!). 
The equity curve was truly beautiful. So, whenever I get an equity curve 
that is that beautiful with hardly any DD, I begin to ask questions. I 
checked the delays and found that I had mistakenly set the trade delays 
to 0 (left over from previous testing). If you use the function 
SetTradeDelays(1,1,1,1) at the beginning of your code, the system 
collapses completely. The equity curve becomes ugly, the short side 
losing money big time. Setting trade delays to 0 means that the buy 
occurs on the same day the signal is generated, and in real life you'll 
never know whether to buy until you download the data at the end of the 
day in order to see if the cross occurred. So, check your equity curve 
and do detailed explorations to try to diagnose where your possible 
problems are. Whenever you get a truly amazing equity curve, something's 
hugely amiss. Been there, done that a lot.

Regards,

Al Venosa

Claud Hou wrote:

>
> Actually the program is not mine. I just got it yesterday from this
> board. I only did some simple parameter tuning. My own program does
> not perform as good as this one. So I did not mention it.
>
> Maybe there is some thing wrong with the way I ran backtests?
>
> 1) Set all trading price at Open.
> 2) No stop loss.
> 3) No optimizations
>
> here's the program:(you can run the same testing)
> ===================================================
> WildPer = Param("Wilder Time Periods", 9, 5, 100, 1 );
>
> Value = Param("RSI value", 50, 1, 100, 0.1 );
>
> Field = Param("Price Field (0-close, 1-high, 2-low)", 0, 0, 2, 1 );
>
> Mode = Param("Mode (0-RSI, 1-ReverseRSI)", 1, 0, 1, 1 );
>
> function RevRSI( value, array, periods )
>
> {
>
> AU = Wilders( Max( array - Ref( array, -1 ), 0 ), periods );
>
> AD = Wilders( Max( Ref( array, -1 ) - array, 0 ), periods );
>
> x = ( periods - 1 ) * ( AD * value / (100 - value) - AU);
>
> return IIf( x >= 0, array+x, array + x * (100 - value)/value );
>
> }
>
> array = IIf( Field == 0, Close, IIf( Field == 1, High, Low ) );
>
> aname = WriteIf( Field == 0, "Close", WriteIf( Field == 1, "High",
> "Low" ) );
>
> if( Mode == 0 ) /* RSI */
>
> {
>
> Plot( RSIa( array, WildPer ), "RSI( " + aname + ", " + WildPer + ")",
> colorRed );
>
> }
>
> else
>
> {
>
> Plot( array, aname, colorBlack );
>
> Plot( RevRSI( value, array, WildPer ), "ReverseRSI( " + aname + ", " +
> WildPer + ")", colorBlue, styleThick );
>
> }
>
> Buy=Cross( array, RevRSI( value, array, WildPer ));
>
> Sell=Cross(RevRSI( value, array, WildPer ), array);
>
> short = sell;
> cover = buy;
>
> Buy=ExRem(Buy,Sell);
>
> Sell=ExRem(Sell,Buy);
>
> PlotShapes(Buy*shapeUpArrow,colorAqua);
>
> PlotShapes(Sell*shapeDownArrow,colorYellow);
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> > well, I guess you'll just have to send me a copy privately so that
> I can see
> > what's wrong.  8-)
> > 
> > Listen to your wife.  its in your signal detection.
> > 
> > d
> >
> >
> >   _____ 
> >
> > From: Claud Hou [mailto:hclaud_98@x...]
> > Sent: Thursday, November 04, 2004 4:59 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: Amazing backtest ==> Automatic/program
> trading
> >
> >
> >
> > Indeed it is too good. My wife says I am dreaming. But that's what
> > backtest reports. It's not me. It's the program.
> >
> > As any trading system does, you always get a signal first.
> > So the program works like this (daily based):
> > 1) Detect a buy signal
> > 2) Buy at Open next day. (and/or cover)
> > .... hold till ...
> > 3) Detect a sell siganl
> > 4) Sell at open next day, immediately go short
> > 5) loops back to 1)
> >
> > simple as that.
> >
> > BTW, I don't like Porche GT. So don't worry about that.
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> > > have you heard what "they" say when something sounds too good to
> be
> > true?
> > > Doesn't yours sound a little too good to be true?
> > > 
> > > Suggest you click the "Check" button in the AA window. If that
> says
> > you're
> > > ok then are you testing for high and low values using EOD data in
> > your
> > > system for buying and selling?
> > > 
> > > I'd advise you not to get too excited just yet and certainly
> don't
> > go out
> > > and buy that Porche GT just yet.
> > > 
> > > d
> > >
> > >
> > >   _____ 
> > >
> > > From: Claud Hou [mailto:hclaud_98@x...]
> > > Sent: Thursday, November 04, 2004 4:41 PM
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: [amibroker] Amazing backtest ==> Automatic/program
> trading
> > >
> > >
> > >
> > > Last night I ran some backtests with some simple trading systems.
> > > The results are amazing:
> > > For example,
> > > In 3 years from 11/03/2001 to 11/03/2004, with 10K initial
> account
> > > value, you'll get 5.3M trading only YHOO. (long/short).
> > > The result will be even astonishing if you use margin and trade
> > > options.
> > >
> > > So come some questions:
> > > 1) How reliable are these backtest results?
> > > 2) How's the progress for AB's feature of automatic trading with
> IB?
> > > 3) Better yet, is there a broker that accepts a trading system
> from
> > > customer and does program trading?
> > >
> > > Basically, open an account with 10K and let the program run every
> > > trading day, then forget it. Three year later, you check your
> > account
> > > finding out you are a multi-millionaire.
> > > How sweet is that? :-)
> > >
> > >
> > >
> > >
> > >
> > > Check AmiBroker web page at:
> > > http://www.amibroker.com/
> > >
> > > Check group FAQ at:
> > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > >
> > >
> > >
> > > Yahoo! Groups Sponsor     
> > > 
> > >
> >
> <http://us.ard.yahoo.com/SIG=129qcvopb/M=281955.5530326.6602771.300117
> > 6/D=gr
> > >
> >
> oups/S=1705632198:HM/EXP=1099690875/A=2343726/R=0/SIG=12i4sm98a/*http:
> > //clk.
> > >
> >
> atdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1099604475845983>
> > >
> >
> <http://us.ard.yahoo.com/SIG=129qcvopb/M=281955.5530326.6602771.300117
> > 6/D=gr
> > >
> >
> oups/S=1705632198:HM/EXP=1099690875/A=2343726/R=1/SIG=12i4sm98a/*http:
> > //clk.
> > >
> >
> atdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1099604475845983>
> >
> > >
> > >
> > > Get unlimited calls to
> > >
> > > U.S./Canada
> > >
> > > 
> > >
> > <http://view.atdmt.com/VON/view/yhxxxvon01900091von/direct/01/
> >
> <http://view.atdmt.com/VON/view/yhxxxvon01900091von/direct/01/&time=10 
> <http://view.atdmt.com/VON/view/yhxxxvon01900091von/direct/01/&time=10>
> >
> > &time=10
> > 996044
> > > 75845983>
> > > 
> > > <http://us.adserver.yahoo.com/l?
> > M=281955.5530326.6602771.3001176/D=groups/S=
> > > :HM/A=2343726/rand=609210912>      
> > >
> > >
> > >   _____ 
> > >
> > > 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! Terms
> of
> > Service
> > > <http://docs.yahoo.com/info/terms/> .
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> >
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> >
> >
> >
> > Yahoo! Groups Sponsor     
> >
> > ADVERTISEMENT
> > 
> >
> <http://us.ard.yahoo.com/SIG=129m8eu4e/M=315388.5529724.6602080.300117
> 6/D=gr
> >
> oups/S=1705632198:HM/EXP=1099691989/A=2372354/R=0/SIG=12id813k2/*https
> ://www
> > .orchardbank.com/hcs/hcsapplication?
> pf=PLApply&media=EMYHNL40F21004SS> click
> > here     
> > 
> > <http://us.adserver.yahoo.com/l?
> M=315388.5529724.6602080.3001176/D=groups/S=
> > :HM/A=2372354/rand=119838639>      
> >
> >
> >   _____ 
> >
> > 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! Terms of
> Service
> > <http://docs.yahoo.com/info/terms/> .
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
> *Yahoo! Groups Sponsor*
> <http://us.ard.yahoo.com/SIG=1293gonoi/M=281955.5530326.6602771.3001176/D=groups/S=1705632198:HM/EXP=1099694074/A=2343726/R=0/SIG=12isd4oce/*http://clk.atdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1099607674751452> 
>
>
> Get unlimited calls to
>
> U.S./Canada
>
> <http://us.ard.yahoo.com/SIG=1293gonoi/M=281955.5530326.6602771.3001176/D=groups/S=1705632198:HM/EXP=1099694074/A=2343726/R=1/SIG=12isd4oce/*http://clk.atdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1099607674751452> 
>
>
>
> ------------------------------------------------------------------------
> *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! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/