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

[amibroker] Re: CXO article



PureBytes Links

Trading Reference Links

I used a trade cost of 0.25%.  All stops disabled. I had a delay buy and sell at open of 1 day but changing this to zero didnt change anything - it must be overruled by the code.  I used the ticker SPY instead of GPSC for the market index (wouldn't think this makes much difference).

--- In amibroker@xxxxxxxxxxxxxxx, Robert Chevallier <robert.chevallier@xxx> wrote:
>
> I've tried to reproduce using your script, but I don't get your results.
> What are your settings ?
> 
>  Statistics    All trades Long trades Short trades Initial capital 10000.00
> 10000.00 10000.00 Ending capital 28837.53 28837.53 10000.00 Net Profit
> 18837.53 18837.53 0.00 Net Profit % 188.38 % 188.38 % 0.00 % Exposure % 54.50
> % 54.50 % 0.00 % Net Risk Adjusted Return % 345.67 % 345.67 % N/A  Annual
> Return % 10.06 % 10.06 % 0.00 % Risk Adjusted Return % 18.46 % 18.46 % N/A
> ------------------------------
>  *All trades* 24 24 (100.00 %) 0 (0.00 %)  Avg. Profit/Loss 784.90 784.90
> N/A  Avg. Profit/Loss % 4.76 % 4.76 % N/A   Avg. Bars Held 64.25 64.25 N/A
> ------------------------------
>  *Winners* 17 (70.83 %) 17 (70.83 %) 0 (0.00 %)  Total Profit 24052.20
> 24052.20 0.00  Avg. Profit 1414.84 1414.84 N/A  Avg. Profit % 8.11 % 8.11 % N/A
>   Avg. Bars Held 78.24 78.24 N/A  Max. Consecutive 7 7 0  Largest win
> 2665.44 2665.44 0.00  # bars in largest win 148 148 0
> ------------------------------
>  *Losers* 7 (29.17 %) 7 (29.17 %) 0 (0.00 %)  Total Loss -5214.67 -5214.67
> 0.00  Avg. Loss -744.95 -744.95 N/A  Avg. Loss % -3.35 % -3.35 % N/A   Avg.
> Bars Held 30.29 30.29 N/A  Max. Consecutive 2 2 0  Largest loss -1805.32
> -1805.32 0.00  # bars in largest loss 43 43 0
> ------------------------------
>  Max. trade drawdown -4360.64 -4360.64 0.00 Max. trade % drawdown
> -28.69 % -28.69
> % 0.00 % Max. system drawdown -4745.95 -4745.95 0.00 Max. system %
> drawdown -28.69
> % -28.69 % 0.00 % Recovery Factor 3.97 3.97 N/A CAR/MaxDD 0.35 0.35 N/A
> RAR/MaxDD 0.64 0.64 N/A Profit Factor 4.61 4.61 N/A Payoff Ratio 1.90 1.90
> N/A Standard Error 1196.83 1196.83 0.00  Risk-Reward Ratio 1.43 1.43 N/A Ulcer
> Index 7.81 7.81 0.00 Ulcer Performance Index 1.10 1.10 N/A Sharpe Ratio of
> trades 1.19 1.19 0.00 K-Ratio 0.0862 0.0862 -1.#IND
> 
> 
> 2010/1/5 droskill <droskill@xxx>
> 
> >
> >
> > Yes, fairly similar.
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx <amibroker%40yahoogroups.com>,
> > "donald_brown_48367" <donald_brown_48367@> wrote:
> > >
> > > So I made those changes and this simulates not buying any ETFs when the
> > S&P is below the 200 day moving average which is the blue line on the CXO
> > chart. I ended with a 205% profit which is close to the CXO blue line
> > performance. Are you getting the same results?
> > >
> > > Statistics
> > > All trades Long trades Short trades
> > > Initial capital 10000.00 10000.00 10000.00
> > > Ending capital 30573.87 30573.87 10000.00
> > > Net Profit 20573.87 20573.87 0.00
> > > Net Profit % 205.74 % 205.74 % 0.00 %
> > > Exposure % 59.68 % 59.68 % 0.00 %
> > > Net Risk Adjusted Return % 344.73 % 344.73 % N/A
> > > Annual Return % 11.28 % 11.28 % 0.00 %
> > > Risk Adjusted Return % 18.91 % 18.91 % N/A
> > >
> > > ----------------------------------------------------------
> > >
> > > All trades 22 22 (100.00 %) 0 (0.00 %)
> > > Avg. Profit/Loss 935.18 935.18 N/A
> > > Avg. Profit/Loss % 5.54 % 5.54 % N/A
> > > Avg. Bars Held 72.55 72.55 N/A
> > >
> > > ----------------------------------------------------------
> > >
> > > Winners 17 (77.27 %) 17 (77.27 %) 0 (0.00 %)
> > > Total Profit 26212.78 26212.78 0.00
> > > Avg. Profit 1541.93 1541.93 N/A
> > > Avg. Profit % 8.67 % 8.67 % N/A
> > > Avg. Bars Held 85.35 85.35 N/A
> > > Max. Consecutive 7 7 0
> > > Largest win 3812.87 3812.87 0.00
> > > # bars in largest win 107 107 0
> > >
> > > ----------------------------------------------------------
> > >
> > > Losers 5 (22.73 %) 5 (22.73 %) 0 (0.00 %)
> > > Total Loss -5638.91 -5638.91 0.00
> > > Avg. Loss -1127.78 -1127.78 N/A
> > > Avg. Loss % -5.09 % -5.09 % N/A
> > > Avg. Bars Held 29.00 29.00 N/A
> > > Max. Consecutive 2 2 0
> > > Largest loss -1957.75 -1957.75 0.00
> > > # bars in largest loss 43 43 0
> > >
> > > ----------------------------------------------------------
> > >
> > >
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx <amibroker%40yahoogroups.com>,
> > "droskill" <droskill@> wrote:
> > > >
> > > > 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 <amibroker%40yahoogroups.com>,
> > "donald_brown_48367" <donald_brown_48367@> 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 <amibroker%40yahoogroups.com>, 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 <amibroker%40yahoogroups.com>
> > > > > > 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/