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

Re: [amibroker] Re: Complete AFL Code for %K Trading System from 'Active Trader' Mag



PureBytes Links

Trading Reference Links

Im sorry, my first backtest was wrong, I was in a
hurry and didnt look at the equity curve. My results
picked up a trade of AMCC earning 29,000% profit on
3/9/2000

Here is the new backtest from 1/1/2000 - 8/12/2005,
which is realistic:

Statistics 
  All trades Long trades Short trades 
Initial capital 100000.00 100000.00 100000.00 
Ending capital 231875.76 231875.76 100000.00 
Net Profit 131875.76 131875.76 0.00 
Net Profit % 131.88 % 131.88 % 0.00 % 
Exposure % 13.38 % 13.38 % 0.00 % 
Net Risk Adjusted Return % 985.55 % 985.55 % N/A  
Annual Return % 16.17 % 16.17 % 0.00 % 
Risk Adjusted Return % 120.85 % 120.85 % N/A  

--------------------------------------------------------------------------------
 
All trades 802 802 (100.00 %) 0 (0.00 %) 
 Avg. Profit/Loss 164.43 164.43 N/A 
 Avg. Profit/Loss % 0.40 % 0.40 % N/A  
 Avg. Bars Held 1.94 1.94 N/A 

--------------------------------------------------------------------------------
 
Winners 451 (56.23 %) 451 (56.23 %) 0 (0.00 %) 
 Total Profit 417820.06 417820.06 0.00 
 Avg. Profit 926.43 926.43 N/A 
 Avg. Profit % 2.29 % 2.29 % N/A  
 Avg. Bars Held 1.94 1.94 N/A 
 Max. Consecutive 12 12 0 
 Largest win 8759.60 8759.60 0.00 
 # bars in largest win 2 2 0 

--------------------------------------------------------------------------------
 
Losers 351 (43.77 %) 351 (43.77 %) 0 (0.00 %) 
 Total Loss -285944.30 -285944.30 0.00 
 Avg. Loss -814.66 -814.66 N/A 
 Avg. Loss % -2.03 % -2.03 % N/A  
 Avg. Bars Held 1.93 1.93 N/A 
 Max. Consecutive 8 8 0 
 Largest loss -8377.60 -8377.60 0.00 
 # bars in largest loss 2 2 0 

--------------------------------------------------------------------------------
 
Max. trade drawdown -8377.60 -8377.60 0.00 
Max. trade % drawdown -16.33 % -16.33 % 0.00 % 
Max. system drawdown -16853.01 -16853.01 0.00 
Max. system % drawdown -9.27 % -9.27 % 0.00 % 
Recovery Factor 7.83 7.83 N/A 
CAR/MaxDD 1.74 1.74 N/A 
RAR/MaxDD 13.04 13.04 N/A 
Profit Factor 1.46 1.46 N/A 
Payoff Ratio 1.14 1.14 N/A 
Standard Error 9304.80 9304.80 0.00 
Risk-Reward Ratio 2.69 2.69 N/A 
Ulcer Index 2.37 2.37 0.00 
Ulcer Performance Index 4.54 4.54 N/A 
Sharpe Ratio of trades 1.85 1.85 0.00 
K-Ratio 0.12 0.12 N/A 



--- Dickie Paria <babui@xxxxxxxxx> wrote:

> Keith - thanks for the correction.  I, actually,
> never tested the 
> code I wrote.  Just too busy at work.  
> Eric - it does look like 'Active Trader' is on to
> something..thanks 
> for posting the results.
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, eric paradis 
> <thechemistrybetweenus@xxxx> wrote:
> > That code change made the results very promising.
> > -Eric
> > NDX100 1/1/2000-8/12/2005
> > Statistics 
> >   All trades Long trades Short trades 
> > Initial capital 100000.00 100000.00 100000.00 
> > Ending capital 9227957.88 9227957.88 100000.00 
> > Net Profit 9127957.88 9127957.88 0.00 
> > Net Profit % 9127.96 % 9127.96 % 0.00 % 
> > Exposure % 12.87 % 12.87 % 0.00 % 
> > Net Risk Adjusted Return % 70920.07 % 70920.07 %
> N/A  
> > Annual Return % 123.99 % 123.99 % 0.00 % 
> > Risk Adjusted Return % 963.34 % 963.34 % N/A  
> > 
> >
>
--------------------------------------------------------------------
> ------------
> >  
> > All trades 895 895 (100.00 %) 0 (0.00 %) 
> >  Avg. Profit/Loss 10198.84 10198.84 N/A 
> >  Avg. Profit/Loss % 24.90 % 24.90 % N/A  
> >  Avg. Bars Held 1.96 1.96 N/A 
> > 
> >
>
--------------------------------------------------------------------
> ------------
> >  
> > Winners 502 (56.09 %) 502 (56.09 %) 0 (0.00 %) 
> >  Total Profit 19343339.40 19343339.40 0.00 
> >  Avg. Profit 38532.55 38532.55 N/A 
> >  Avg. Profit % 46.00 % 46.00 % N/A  
> >  Avg. Bars Held 1.97 1.97 N/A 
> >  Max. Consecutive 12 12 0 
> >  Largest win 4944739.80 4944739.80 0.00 
> >  # bars in largest win 2 2 0 
> > 
> >
>
--------------------------------------------------------------------
> ------------
> >  
> > Losers 393 (43.91 %) 393 (43.91 %) 0 (0.00 %) 
> >  Total Loss -10215381.53 -10215381.53 0.00 
> >  Avg. Loss -25993.34 -25993.34 N/A 
> >  Avg. Loss % -2.05 % -2.05 % N/A  
> >  Avg. Bars Held 1.94 1.94 N/A 
> >  Max. Consecutive 8 8 0 
> >  Largest loss -273788.84 -273788.84 0.00 
> >  # bars in largest loss 2 2 0 
> > 
> >
>
--------------------------------------------------------------------
> ------------
> >  
> > Max. trade drawdown -273788.84 -273788.84 0.00 
> > Max. trade % drawdown -16.33 % -16.33 % 0.00 % 
> > Max. system drawdown -870355.16 -870355.16 0.00 
> > Max. system % drawdown -13.89 % -13.89 % 0.00 % 
> > Recovery Factor 10.49 10.49 N/A 
> > CAR/MaxDD 8.93 8.93 N/A 
> > RAR/MaxDD 69.35 69.35 N/A 
> > Profit Factor 1.89 1.89 N/A 
> > Payoff Ratio 1.48 1.48 N/A 
> > Standard Error 1097248.00 1097248.00 0.00 
> > Risk-Reward Ratio 0.88 0.88 N/A 
> > Ulcer Index 3.47 3.47 0.00 
> > Ulcer Performance Index 34.16 34.16 N/A 
> > Sharpe Ratio of trades 0.54 0.54 0.00 
> > K-Ratio 0.04 0.04 N/A 
> > 
> > 
> > --- keithmccombs <kmccombs@xxxx> wrote:
> > 
> > > Dickie, your line: "Buy = (Cond1 AND Cond2 AND
> Cond3
> > > AND Cond4 AND 
> > > Cond5) < 5;" is improper.  Cond1, etc. are all
> > > numeric values which 
> > > respond to logic operations, AND, in an
> undefined
> > > manner. The line 
> > > should be "Buy = (Cond1 < 5) AND (Cond2 < 5) AND
> > > (Cond3 < 5) AND 
> > > (Cond4 < 5) AND (Cond5 < 5);"
> > > 
> > > You might try this yourself ( I haven't). 
> However,
> > > I would guess 
> > > that there is an awful lot of whipsawing.
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, eric paradis 
> > > <thechemistrybetweenus@xxxx> wrote:
> > > > Dickie, I get a 41% drawdown testing from
> 1/1/2000
> > > -
> > > > 8/12/2005 , not the 6% you mention.
> > > > 
> > > > --- Dickie Paria <babui@xxxx> wrote:
> > > > 
> > > > > Was leafing through the latest 'Active
> Trader'
> > > mag
> > > > > at a newsstand and 
> > > > > came across the %K trading system which
> seems
> > > pretty
> > > > > robust.  The 
> > > > > theory behind the system is simple.  The
> StochK
> > > > > indicator is a very 
> > > > > popular indicator used by many traders.  The
> > > traders
> > > > > wait till it is 
> > > > > oversold (under 5) and then jump in to buy. 
> > > > > Different traders have 
> > > > > different timeframes.  So, the technique
> > > > > 'piggybacks' on this 
> > > > > inclination.  It takes the StochK for
> various
> > > > > periods and
> > > > > Buys = when all the StochK's are under 5
> > > > > Sells = the next day at the open
> > > > > Active Trader tests the system on its
> 'standard'
> > > > > stock portfolio 
> > > > > which is 18 large cap stocks like Apple,
> > > Caterpillar
> > > > > etc over a 10 yr 
> > > > > (I think) period.  The system is in the
> market
> > > about
> > > > > 10% of the time 
> > > > > and has a very steady equity curve growth. 
> > > Annual %
> > > > > profit is 11.5% 
> > > > > with no margin.  If cash is invested in the
> > > money
> > > > > mkt at other times, 
> > > > > then total annual profit is greater buy and
> > > hold. 
> > > > > Drawdown is (if I 
> > > > > remember correctly) only 6%.  Only 25% was
> > > risked at
> > > > > any one time (I 
> > > > > think) and Active Trader took about $8 or $9
> as
> > > > > commission.
> > > > > Overall - they say that it is very robust
> > > > > system.....
> > > > > 
> > > > > Here's the code
> > > > > ***************************
> > > > > 
> > > > > /* %K Trading System as written in Active
> Trader
> > > > > ** Sept 2005
> > > > > ** Coded by Dickie Paria for AB Group
> > > Discussion, 
> > > > > */
> > > > > 
> > > > > 
> > > > > Cond1 = StochK (10);
> > > > > Cond2 = StochK (15);
> > > > > Cond3 = StochK (20);
> > > > > Cond4 = StochK (25);
> > > > > Cond5 = StochK (30);
> > > > > 
> > > > > Plot( Cond1 , "StochK10", colorRed,
> styleThick
> > > );
> > > > > Plot( Cond2 , "StochK15", colorGreen,
> styleThick
> > > );
> > > > > Plot( Cond3 , "StochK20", colorBlack,
> styleThick
> > > );
> > > > > Plot( Cond4 , "StochK25", colorYellow,
> > > styleThick );
> > > > > Plot( Cond5 , "StochK30", colorBrightGreen,
> > > > > styleThick );
> > > > > 
> > > > > Plot (5,"",colorBlue,styleNoLabel);
> > > > > 
> > > > > 
> > > > > Buy = (Cond1 AND Cond2 AND Cond3 AND Cond4
> AND
> > > > > Cond5) < 5;
> > > > > Sell = 0;
> > > > > SellPrice = Open;
> > > > > ApplyStop(3,1,1);
> > > > > 
> 
=== message truncated ===



		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h49dlal/M=362131.6882500.7825259.1493532/D=groups/S=1705632198:TM/Y=YAHOO/EXP=1124149039/A=2889190/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Put more honey in your pocket. (money matters made easy) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/