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

[amibroker] Re: CXO article


  • Date: Mon, 04 Jan 2010 15:11:57 -0000
  • From: "droskill" <droskill@xxxxxxxxx>
  • Subject: [amibroker] Re: CXO article

PureBytes Links

Trading Reference Links

There are also a couple of errors in my original code:

- SetTradeDelays should be (1,1,1,1)
- MAFilter = C > MA(C,200) should be MAFilter = Foreign("^GSPC","C") > MA(Foreign("^GSPC","C"),200);

The final point was that I found this code did not work for anyone using TC2005 data but worked fine with Yahoo data.  That suggests that splits and/or dividends affect the results.  Given that splits are less common in these ETFs (at least as far as I know - someone correct me if I'm wrong), I think it is a dividend adjustment issue.

That last point indicates to me that using Telechart data for backtesting is not viable.

Thoughts appreciated.

--- In amibroker@xxxxxxxxxxxxxxx, "donald_brown_48367" <donald_brown_48367@xxx> wrote:
>
> 
> 1. Copied put the SPDRs into a watchlist.
> 
> 2. I copied the Droskill's code into the formula editor and saved it.
> 
> 3. I ran a backtest filtering it just for the SPDR watchlist with the a
> start date of July 1, 1999 and an end date of Dec 23 2009.
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Bob Waits <bobwaits2@> wrote:
> >
> > Thanks Donald. Could you walk us through (steps) so that we can
> understand how you got these returns?
> >
> >
> >
> >
> > ________________________________
> > From: donald_brown_48367 donald_brown_48367@
> > To: amibroker@xxxxxxxxxxxxxxx
> > Sent: Sat, January 2, 2010 12:15:07 PM
> > Subject: [amibroker] Re: CXO article
> >
> >
> > As I understand it your code would be duplicating the red line on the
> CXO chart. I used your code with a start date of July 1, 1999 and an end
> date of Dec 23, 2009 and I got a 53.9% profit over the whole period
> which is close to (slightly higher) than the red line on their chart as
> this increases from $10,000 to almost $15,000 over the same period. I
> used a .25% trading cost.
> >
> > The results aren't exactly the same for some reason. My results show a
> balance drawdown from April 2001 until March 2004. The red line on the
> chart appears to be underwater only from July 2002 until September 2003.
> >
> > --- In amibroker@xxxxxxxxx ps.com, "droskill" droskill@ .> wrote:
> > >
> > > I've been trying to duplicate the results in this CXO article:
> > >
> > > http://www.cxoadvisory.com/blog/internal/blog12-22-09/
> > >
> > > It's a rotational system that trades the top fund from the SPDR
> Select series based on a 6 month return as long as it is above the 10
> month SMA.
> > >
> > > I'm not testing it monthly, but here's the daily code I've come up
> with:
> > >
> > > SetBacktestMode( backtestRotation al);
> > > SetTradeDelays( 0,0,0,0); // everything delayed 1 day
> > > SetOption("UsePrevB arEquityForPosSi zing", True);
> > > SetOption("MinShare s", 10);
> > > SetOption("AllowPos itionShrinking" ,True);
> > > SetOption("AccountM argin",100) ;
> > >
> > > Totalpositions = 1;
> > >
> > > MAFilter = C > MA(C,200);
> > > PositionScore = MAFilter * ROC(C,120);
> > > PositionSize = -100/Totalpositions ;
> > >
> > > SetOption("WorstRan kHeld", Totalpositions + 1);
> > > SetOption("MaxOpenP ositions" , Totalpositions );
> > >
> > > m = Month();
> > > newMonth = m != Ref( m, -1);
> > > PositionScore = IIf(PositionScore < 0, 0, PositionScore) ; // Long
> only
> > > PositionScore = IIf(newMonth, PositionScore, scoreNoRotate) ;
> > >
> > > My portfolio consists of the nine SPDRs - XLF,XLE,XLP, XLY,XLI,XLK,
> XLV,XLB,XLU
> > >
> > > I've been unable to duplicate anything close to their results -
> anybody have any idea of what, if anything, I'm doing wrong?
> > >
> >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/