# TradeSim Results - How does this rate?



## Sugar Dunkaton (31 March 2009)

Good Arvo, been doing a little work on tradesim with some system ideas.

On initial inspection the results look fairly good, however, i am sure there are some experts out there who can A) identify the positives and negatives of this system and B) Offer some suggestions on basic criteria for trading a mechanical system.

Thanks, Would be interested in hearing everyones opinions. Here is the system. It is a basic breakout system if that makes a difference to anyone.

Here are the stats.

Simulation Summary                                          
Simulation Date:                                            31/03/2009                    
Simulation Time:                                            5:57:56 PM                    
Simulation Duration:                                        0.23 seconds                  

Trade Summary                                               
Earliest Entry Date in the Trade Database:                  28/11/2005                    
Latest Entry Date in the Trade Database:                    16/02/2009                    
Earliest Exit Date in the Trade Database:                   28/12/2005                    
Latest Exit Date in the Trade Database:                     16/03/2009                    

Start Trade Entry Date:                                     28/11/2005                    
Stop Trade Entry Date:                                      16/02/2009                    
First Entry Date:                                           28/11/2005                    
Last Entry Date:                                            16/02/2009                    
First Exit Date:                                            28/12/2005                    
Last Exit Date:                                             16/03/2009                    

Total Trading duration:                                     1204 days                     

Profit Summary                                              
Profit Status:                                              PROFITABLE                    
Starting Capital:                                           $250,000.00                   
Finishing Capital:                                          $382,899.60                   
Maximum Equity/(Date):                                      $144,182.45 (25/06/2008)      
Minimum Equity/(Date):                                      -$3,778.92 (4/05/2006)        
Gross Trade Profit:                                         $158,405.52 (63.36%)          
Gross Trade Loss:                                           -$25,505.92 (-10.20%)         
Total Net Profit:                                           $132,899.60 (53.16%)          
Average Profit per Trade:                                   $3,322.49                     
Profit Factor:                                              6.2105                        
Profit Index:                                               83.90%                        
Total Transaction Cost:                                     $800.00                       
Total Slippage:                                             $0.00                         
Total Trade Interest:                                       $0.00                         
Daily Compound Interest Rate:                               0.0354%                       
Annualized Compound Interest Rate:                          13.7962%                      

Trade Statistics                                            
Trades Processed:                                           40                            
Trades Taken:                                               40                            
Partial Trades Taken:                                       0                             
Trades Rejected:                                            0                             
Winning Trades:                                             16 (40.00%)                   
Losing Trades:                                              24 (60.00%)                   
Breakeven Trades:                                           0 (0.00%)                     

Largest Winning Trade/(Date):                               $86,742.45 (25/06/2008)       
Largest Losing Trade/(Date):                                -$2,450.22 (10/07/2008)       
Average Winning Trade:                                      $9,900.34                     
Average Losing Trade:                                       -$1,062.75                    
Average Win/Average Loss:                                   9.3158                        

Trade Breakdown                                             Long and Short Trades         Long Trades                   Short Trades                  
Normal Exit:                                                30 (75.00%)                   30 (75.00%)                   0 (0.00%)                     
Protective Stop:                                            10 (25.00%)                   10 (25.00%)                   0 (0.00%)                     

Total Trades:                                               40 (100.00%)                  40 (100.00%)                  0 (0.00%)                     

Trade Duration Statistics                                   Winning and Losing Trades     Winning Trades                Losing Trades                 
Maximum Trade Duration:                                     119 (days)                    119 (days)                    43 (days)                     
Minimum Trade Duration:                                     0 (days)                      22 (days)                     0 (days)                      
Average Trade Duration:                                     31.85 (days)                  56.81 (days)                  15.21 (days)                  

Consecutive Trade Statistics                                
Maximum consecutive winning trades:                         4                             
Maximum consecutive losing trades:                          10                            
Average consecutive winning trades:                         2.29                          
Average consecutive losing trades:                          3.43                          

Trade Expectation Statistics                                
Normalized Expectation per dollar risked:                   $1.32                         
Maximum Reward/Risk ratio:                                  34.56                         
Minimum Reward/Risk ratio:                                  -0.98                         
Average Positive Reward/Risk ratio:                         $3.95                         
Average Negative Reward/Risk ratio:                         -$0.42                        

Relative Drawdown                                           
Maximum Dollar Drawdown/(Date):                             $10,760.19 (12/02/2009)       
Maximum Percentage Drawdown/(Date):                         2.7300% (12/02/2009)          

Absolute (Peak-to-Valley) Dollar Drawdown                   
Maximum Dollar Drawdown:                                    $11,262.85 (2.8570%)          
Capital Peak/(Date):                                        $394,162.45 (25/06/2008)      
Capital Valley/(Date):                                      $382,899.60 (16/03/2009)      

Absolute (Peak-to-Valley) Percent Drawdown                  
Maximum Percentage Drawdown:                                2.8570% ($11,262.85)          
Capital Peak/(Date):                                        $394,162.45 (25/06/2008)      
Capital Valley/(Date):                                      $382,899.60 (16/03/2009)


----------



## MS+Tradesim (31 March 2009)

Have you double and triple checked your code to ensure there is no forward-looking data included? 

How did it perform over 08? Have you tested it year by year for the period you're looking at?

Also check it over 01 and 02 as that may be more indicative of the market over the next year or two as compared with 06 and 07 which had strong bullish returns.

Are your trade sizes realistic to the stocks you are trading? eg. if the entry volume on the trigger day is 500,000 and the back test takes a 200,000 position on that day, it may not be realistic.

Are you accounting for slippage somehow?

How does the system perform when you use the "worst-case" entry and exit parameters on the "Preferences" tab?

Is your commission the same as the broker you'll use?


----------



## Boggo (31 March 2009)

Just a thought, if it is daily end of day data have you delayed your entry and exit by one day after your entry/exit signal or condition is met ?


----------



## Sugar Dunkaton (31 March 2009)

I have not delayed the enteries by one day. But, i have set up the coding so that all the signals - which are price and volume based - are for REF(C,-1), the day before entry.

I have apparently purchased the full ASX history data from premium data, however, have not figured out how in tradesim to trade before DEC 2005. Any help here?

That set of statistics is for the full block between Dec 2005 - march 2009. I have not test it in individual yearly blocks yet.

The system did not have many signals over the 06,07 period, and the equity curve was fairly flat over that time period. Interestingly, The system picks up during later 2007 to late 2008, however 2009 has not had many positive trades so far.

I have Limited the psoition size to a maximum of 5% of the days trading volume. (Which may be a little much given that I am buying on open). The universe is limited to the stocks that comprise the XJO.

I have not yet accounted for slippage - my entries are based on the next days open - so am I wrong in thinking that if the Entries and Exits are based on Opening prices, slippage will not matter, as The signal is based on the EOD data from the previous day, not on a break of a price intraday, where the price may move further before the order is placed?

I have used a flat commission of $10, which is more than what i pay at the moment (due to a deal), however i would like to change it to actual price that we pay which is .1% - which i still have not quite figured out yet how to code into tradesim.

Cheers


----------



## tech/a (31 March 2009)

Perhaps something to aim for and this is not the best I have.


----------



## beamstas (1 April 2009)

Backtesting isn't everything -- especially when you are fine tuning your system to data mine.. (not saying you are doing this)

You could design a system that turns $1000 into one hundred gazillion dollars in 2 years but as soon as you start to forward test it, it will fail!

When you make a system, make sure you it is *ROBUST and SIMPLE.* 

Design it for years 2003-2006 (example)
Then test it for 1999-2002 and from 2007-2009.

If you keep getting good results by doing things like this then your system is probably viable in the real world.

There is one major problem with data mining - the market will never exactly repeat itself! 

Brad


----------



## tech/a (1 April 2009)

beamstas said:


> Backtesting isn't everything -- especially when you are fine tuning your system to data mine.. (not saying you are doing this)
> 
> You could design a system that turns $1000 into one hundred gazillion dollars in 2 years but as soon as you start to forward test it, it will fail!




Then you have not correctly tested your system.



> When you make a system, make sure you it is *ROBUST and SIMPLE.*




Yes



> Design it for years 2003-2006 (example)
> Then test it for 1999-2002 and from 2007-2009.




Dont agree.
Designing a bullish system and expecting it to perform in a bearish market is poor design.



> If you keep getting good results by doing things like this then your system is probably viable in the real world.




Or you have designed a system which performs equally in both bull and bear markets and as such would be a short and long system.



> There is one major problem with data mining - the market will never exactly repeat itself!
> 
> Brad




Not never in my view.
It repeats itself on a daily basis.(Well aspects of it)
Data mining is a topic on its own along with survivourship.


----------



## rnr (1 April 2009)

Your Protective Stop exits may be a bit high at 25%.

What are your Initial Stop and Trailing Stop parameters?

To alter the commission rate to 0.1% open the Preferences tab in the Trade Parameters window and change the method for calculating transaction costs to % (RHS of Preferences widow from memory).


----------



## Sugar Dunkaton (1 April 2009)

These are the stops I am using.

ExitTrigger:= Cross(REF(L,-1), Mov(C,40,E));

InitialStop:=Ref(LLV(L,5),-1);

Thanks RE: the commissions.


----------



## Plan_Trader (1 April 2009)

40 trades is probably not statistically significant.


----------



## beamstas (1 April 2009)

tech/a said:


> Dont agree.
> Designing a bullish system and expecting it to perform in a bearish market is poor design.




My mistake -- a coincidence i picked years with bullmarkets and bearmarkets.
My point was - design a system - be able to backtest it (a set of previous years), forward test it (years ahead of when it was designed) and test at the current time stage. You could do a system for 2005 and then backtest it over 2004 and forward test it over 2006. (this would have to be a swing trading or very short holding system though)



tech/a said:


> Or you have designed a system which performs equally in both bull and bear markets and as such would be a short and long system.




Read above post. Didn't mean the years to fall into bull/bear markets 



tech/a said:


> Not never in my view.
> It repeats itself on a daily basis.(Well aspects of it)
> Data mining is a topic on its own along with survivourship.




Very true. The whole basis of pattern probability trading is the fact that you can expect with reasonable probability the market will repeat the same pattern.
What i am suggesting, and im sure you know also is, you could design a great system on paper that fails when put into the real market. This is what i am trying to say! 

Brad


----------



## Sugar Dunkaton (1 April 2009)

Just a quick question:

I my systems i have selected a fixed percentage risk (Currently 1%). However, I still return single trades that loose greater than 1% (some close to 2%). Is this purely slippage or am I doing something wrong with my initial stop. Does anyone know how to code the Low of the day as the initial stop?

And does the initial stop stay in place as long as the trade is on? So if i am using a trailing and the initial stop, and due to the price action the trailing stop falls below the level of the initial stop - the exit trigger will still be the initial stop right?


----------



## MS+Tradesim (1 April 2009)

Sugar Dunkaton said:


> And does the initial stop stay in place as long as the trade is on? So if i am using a trailing and the initial stop, and due to the price action the trailing stop falls below the level of the initial stop - the exit trigger will still be the initial stop right?




A trailing stop should only ever move up or sideways for long positions. Once a trail goes above the initial stop it shouldn't go lower...that's the whole point of it.



> In my systems i have selected a fixed percentage risk (Currently 1%). However, I still return single trades that loose greater than 1% (some close to 2%). Is this purely slippage or am I doing something wrong with my initial stop.




Price can gap below your initial stop. There's nothing you can do about that. 



> Does anyone know how to code the Low of the day as the initial stop?




InitialStop := ValueWhen(1,EntryTrigger,L);

**That tells Tradesim to use the Low of the day on the last occurrence of a valid entry signal as the initial stop.

At some point after this line:

ExtFml( "TradeSim.Initialize"); 

...you will need to add these lines:

ExtFml("TradeSim.EnableProtectiveStop",1);
ExtFml("TradeSim.SetExitPriceToInitialStop");

** This tells Tradesim to turn on the initial stop after one bar and exit the trade at a price equal to the Low of the entry trigger day. Remember that if it gaps below this you will get a different exit price.


----------



## MS+Tradesim (1 April 2009)

Sugar,

I'm just curious. What are you trying to achieve with your exit trigger?
Your current coding tells Tradesim to exit if yesterday's Low crosses *above* the MA. That's fine if you are deliberately trying to achieve that.

But I was wondering if you accidentally have it back to front and you mean:

Ref(Cross(Mov(C,40,E),L),-1)

That will tell Tradesim to exit if yesterday the Low crossed below the MA.


----------



## Sicilian Trader (2 April 2009)

Sugar Dunkaton said:


> First Entry Date:                                           28/11/2005
> Last Exit Date:                                             16/03/2009
> Starting Capital:                                           $250,000.00
> Finishing Capital:                                          $382,899.60
> ...




Hi SD, 

Can I just chime in with my 2c worth.

You wanted an opinion on the results and it doesnt seem like anyone has addressed the obvious aside from tech/a.

I wouldnt trade the system. I would make that call based solely on its ROE, which is before interest (assuming there is an interest component) and also before tax.

I wouldnt bother reading the rest of the stats (dont mean for that to sound arrogant btw). Just too much effort to trade the system.

On such a large capital outlay, it seems like you are taking uneccessary risk relative to your return. 

Over that ~3.5 year period it works out to be about 11-12% annual return (compounded) Again, before interest and tax. And after time & effort in designing the system and executing your trades, not to mention the time spent thinking / worrying / analysing your system and its inherent risk.

Why bother?

I would simply put the 250K in an index fund, leave it to the pros, and hopefully get a 11-12% p.a (with the expection of the past 12 months of course), then forget about it, carry on with your daily activities then go on-line 3.5 years from now and view your balance.

Based on my limited knowledge and experience in active trading, I would say there are far better systems / results out there. Run a search in ASF and type 'results' and select 'search titles only' in the first drop down list.

You will get a gauge as to the type of risk adjusted annual rate of return (compounded) that ASF members are discussing and striving to achieve, and in many cases, achieving them (post their results).

Your system:

Based on the amount of active trading, albeit a minimal amount (40 trades over 3.5 yrs) and the effort required in building the system, also taking into account paying for platform, brokerage, data feeds, etc, I would be aiming for a compounded rate of return of say 20-30% p.a minimum. (This based on what I have seen on this forum alone but also based on my results in the past 12 months during this market climate)

20% p.a compounded (ending capital 475,000, net profit 225,000, 90% ROE)
30% p.a compounded (ending capital 630,000, net profit 380,000, 150% ROE)


I think you would also need to assess the psycological aspect of your trading this system:

hypothetical
ie. y1 = 3%; yr2 = 4%; yr3 = 20%; yr4 = 19%
(works out to be 53% total compounded return, same as your system)

Question is, would you be happy with your aggregate return after yr 2 having 250K 'at risk'? What is the likelihood of your pulling out your capital after yr 2 and buying another asset, say an investment property, thereby missing out on yr3 and yr4's return?

Yep, i am verbose (its in my genes), but hopefully you understand my point.

Apologies if I have come across abrupt

Anyone is welcome to correct me if I wrong or if I have missed the point of this thread, but this is how I read it.

ST


----------



## Sicilian Trader (2 April 2009)

tech/a said:


> Perhaps something to aim for and this is not the best I have.






hi tech (sorry SD, dont mean to step on your toes in your thread)

when you say _'this isnt the best i have' do you mean 'this isnt the best back-tested system results I have produced' _or _'this isnt the best system I am currently trading, i have better ones'_

bloody incredible results mate. 

Are you trading this system?
If yes, how is it tracking? If not, WHY NOT? 
How many systems do you trade?
Do you let every system you have tested, which eventually went live, run its full course or do you tweek / adjust / stop them after a time period? 

Amazing stuff


----------



## MS+Tradesim (2 April 2009)

Sicilian,

To be honest, there is no point commenting on hypothetical results if the coding isn't predicated from reality. Get the system logic right and the trading parameters realistic, then worry about assessing backtest results.

*Assuming* the above issues are sorted, then I would agree with some of your comments. Given this seems to be a starting point for Sugar, I will be surprised if he doesn't end up with some very tradeable ideas.

Having said that, from Sugar's results:

Annualized Compound Interest Rate: 13.7962%
Maximum Percentage Drawdown: 2.8570%

...that's not a bad effort given that 2008 was the single worst calendar year in the history of the Aus. markets, IIRC.


----------



## tech/a (2 April 2009)

Sicilian Trader said:


> hi tech (sorry SD, dont mean to step on your toes in your thread)
> 
> when you say _'this isnt the best i have' do you mean 'this isnt the best back-tested system results I have produced' _or _'this isnt the best system I am currently trading, i have better ones'_




Not the best results I have produced from a developed system.More to a system than profit believe it or not. Smooth equity curve is very enticing.



> Are you trading this system?




Did so for many years but not now.



> If yes, how is it tracking? If not, WHY NOT?




Its a long term long trading method all of the systems I developed are,I stopped trading 2 systems in July 2007 as they both had too much open equity in them to risk given my other analysis warned ahead of time this plummet---. I only trade in a discretionary manner now as the average hold time for these systems is a little short of a year.I wish I had more time to develop short and short long methods.



> How many systems do you trade?




Currently none but have traded 2



> Do you let every system you have tested, which eventually went live, run its full course or do you tweek / adjust / stop them after a time period?




By let do you mean make public---if so no.
Those I have traded I have let go but in the end stopped them.
Funnily and un expectedly all positions were closed out by the system a few months later.Had I waited till then I would have only been a little worse off.



> Amazing stuff




Not really the best I have seen is 132%---not mine.
No I dont have it.


----------



## Sicilian Trader (2 April 2009)

MS+Tradesim said:


> ...that's not a bad effort given that 2008 was the single worst calendar year in the history of the Aus. markets, IIRC.




very valid point, 



tech/a said:


> By let do you mean make public---if so no.
> Those I have traded I have let go but in the end stopped them.
> .




'let' as in allow, not make public



tech/a said:


> Not really the best I have seen is 132%---not mine.
> No I dont have it.




damn, was that year on year and for how long?
can you shed light on what he/she was trading and their brief strat?


----------



## Sicilian Trader (2 April 2009)

btw tech, thanks for the through reply


----------

