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

Re: [amibroker] RUTVOL 800 bars test/TC2000



PureBytes Links

Trading Reference Links


Dalengo,
 
I hope Tomasz reads this as my response below will prove that I actually paid attention and read his posts on the AmiBroker Beta board : )))))))))))))
 
I'm glad that you took the time to ask these questions as they are critical to understand, and as in prior posts those not familiar with portfolio tester open up your ears and listen in as this is basic stuff elaborated in the read-me and if you ask Tomasz he will find you and club you over the head for not reading the read-me : )  Lemme save you the headache, and hopefully save Tomasz the time.
 
Let's tackle your e-mail in three parts:
 
1.  Why you are not getting results when using old backtester and RUTVOL on cash Russell 2K index.
 
2.  Why are arrows showing up in the equity graph for the old backtester.
 
3.  Your basket testing returns compared to mine.
 
Okay #1:
 
The reason you are not getting results is driven by settings in the code governing initial equity, position size, min size, and round lot size.
 
Let's go through each of these in the order they occur in the code.
 

SetOption("InitialEquity", 100000);
Straightforward.  This is cash we start with.  Why code it versus using the GUI?  Because different systems require different captial requirements.  This allows you to customize.
RoundLotSize = 100;
All trades must occur in blocks of 100 shares.  I think this is fair.  It you wanna try odd lots, good for you.  I don't.
SetOption("MinShares",100);
Minimum size must be 100 shares.  You'll see how this is important in a sec.
 
MaxPos = Optimize("Max Positions",5,1,15,1);
SetOption("MaxOpenPositions",MaxPos);
Allow 5 open positions at one time if cash is avail.  I've given you the ability to optimize this via MaxPos variable.
 
PositionSize = -100/MaxPos;
If there is a " -" in from of the number that means we are designating percent.  In this case positon size for one position can not exceed 20% of total portfolio equity.
 
Okay, here's the punchline:  Trading the RUT cash index around 400 or so
400 x 100 min share size = $40,000 position which is bigger than $20,000 position size limit.  So the position never gets put on.
If you want to run this in the old backtest, comment out the positionsize line, and it will run.  You'll want to increase initial equity, too.  Run it on the IWM to be realistic.
 
2.  Regarding why you are getting arrows in the old backtester equity curve is that the equity curve for the old backtester is taking all the code from the aa window and including in the equity line code.  This means the indicator code at the bottom of the system code actually plots buy sell arrows which makes the equityline indicator hard to read.  If you are going to run this in the old backteser, comment out the indicator code.  Be careful not to comment out anything important : )
3.  Okay now the  meat and potatoes.  The returns.  Don't get worried about the returns, because I'm going to show you how to make them better.
1/01 - 11/03 trading IWM (no portfolio trading):
CAR:  7.27
MaxDD: -8.23%
 
Same Period basket trading with BB selection:
CAR:  5.25%
MaxDD = -28.9%
Now for some detail.  We must keep in mind that this is a long only system over what was primarily a bearish period.  The basket trading return was horrible.  The important message is the Bollinger Band selection method is not the best.  It was an example to get you going, but in the spirit of more code and less talk (an idea which I hope all of our more verbose contributors will espouse...you know who you are) let's show you the ncAlpha selection method:
Same Period basket trading with ncAlpha selection:
CAR:  49%
MaxDD = -22.79
Woah.  Not bad, eh?  CAR went way up and we reduced maxdd.  At least we are in >2 MAR country which Fred has taught me is a good place to be.  Again this was an all long system over a lot of bear market moves.  There are better signals out there, but RUTVOL isn't a bad place to start.
Here's the code for ncAlpha to play with (early X-Mas present so be nice till Jan 1 ; )
//GLOBAL SYMBOLS
INDEXSYM = ParamStr("INDEX SYM","!RUT");
RAWINDEX = Foreign(INDEXSYM,"C"); //CLOSING PRICE OF INDEX
RAWFUND = C; //CLOSING PRICE OF FUND
LB = Param("LOOKBACK PERIOD",126,0,1008,10);
//NC ALPHA
//COMPUTE DAILY STDEV & APPLY MONTHLY CONVERSION FACTOR
SDF = StDev(ROC(RAWFUND,1),LB) * sqrt(22);
SDI = StDev(ROC(RAWINDEX,1),LB) * sqrt(22);
RELSD = SDF / SDI; //RATIO IS SAME REGARDLESS OF WHETHER WE USE DAILY OR MONTHLY SD VALUES
NCALPHA = MA(ROC(RAWFUND,1),LB) - RELSD * MA(ROC(RAWINDEX,1),LB); //DAILY ncALPHA
I need to get back to work so I'll spare you a definition of ncAlpha, but go to Werner's site, and you'll get a better definition than I can ever give.
Also, I'd strongly encourage you to get out to Clearwater because there will be a good presentation by Bruce Robinson on blending a signals like RUTVOL with simple to complex filters to create better long signals, and tradeable short signals.  I'll also be running through a lot of these signals in terms of analyzing them through the portfolio backtester with various baskets of stocks as well as optimization analysis. www.ftmonitor.com has details.
Hopefully I've left enough for you to play with.
Hope this helps,
Gary
 
 
 
Do you Yahoo!?
Free Pop-Up Blocker - Get it now






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
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 the Yahoo! Terms of Service.