#### wheresthejelly

##### Newbie

**Major tenets and beliefs:**

1. Human traders or discretionary traders lose trades because of fear and greed.

2. Human traders or discretionary traders cannot maintain the necessary discipline to trade consistently forever.

3. Market movements of all kinds (price, volume, volatility) are 99.99% determined by human factors rather than mechanical systems.

4. Every profitable trade in history will be repeated in the future.

These are beliefs, which I feel are very close to reality because I have tried discretionary trading, and I also design mechanical systems. I have been lurking on T2W for about a year, and I've designed two mechanical trading systems. Full disclosure: I have not made any real money with these systems yet, but I feel that I will in the next few months once I move away from paper trading. I am not fully qualified to tell you what works in a real-money system. However, I am qualified to tell this forum how to design a system that backtests very successfully.

Just starting out last year with backtesting software, I could barely get an upward sloping equity curve in simulation. Now, I've got an upward sloping equity curve with very low drawdown over a span of 20 years. Some simple stats I can give you are my backtested cummulative annual return (53%), and the maximum system drawdown (28%). Both of these stats are over the time period from January 1, 1992 to June 29, 2012. I've learned so much in how to design a successful system in backtesting software over the past year. So, I am qualified to tell this forum how to design a successful system in backtesting software.

**Key Success Factors in designing a successful mechanical trading system in backtesting software:**

1. Performance goals

2. Accurate and comprehensive data

3. Positive expectation

4. Risk management

5. Time frame

6. Optimization

If you can understand and do well at each of these areas, you will design a profitable mechanical trading system in simulation. Here's more elaboration on each of these key success factors:

1.

**Performance goals:**Decide for yourself BEFORE backtesting anything what

*drawdown*you can handle. Imagine you had a working, real-money system. Then imagine that next week your system lost 25% of your money. Would you break down and cry? Would you stop trading out of fear? If you feel a cringe at losing that much money, try 20% or 15%. If you're okay with 25%, what about 30% or 35%? Another stat you should define is

*time in a drawdown*. Let's say you recently had a good month of trading, and your account value is the highest it has every been. Feeling good! Then, let's say your system loses 10% next week and doesn't recover for 6 months. Could you handle that? If you trade for clients, could your clients handle that? What about 5 months? The last stat to define is your desired

*cumulative annual return*. Would you be happy with 25% per year? If so, what about 20%? Keep going down until you find a number that sounds unacceptable to you. These three statistics are your performance goals. Design your system to achieve them. Change your system if you feel it doesn't meet these goals. Be serious and realistic about this! Don't be silly and choose a 5% drawdown, 2-week time in drawdown, and a 300% cumulative annual return.

2.

**Accurate and comprehensive data:**Your data source should provide data for all the stocks you want to trade. Also, it must provide data for all de-listed stocks you would have traded. Make sure you go through some stocks to make sure that stock splits were handled correctly. Some backtesting software and data sources do not account for dividends. It is up to you to decide whether that invalidates your backtest results or not. A system that has an average trade length of a few days should be fine with not accounting for dividends. A system that holds positions for weeks or months should somehow account for dividends. Remember that short positions pay out dividends rather than receive them.

3.

**Positive expectation:**It is very very important that your trading rules have a positive expected value. Mathematically, this means (win rate)*(win amount percentage) - (loss rate)*(loss amount percentage) > 0. For example, let's say you design a fictitious system that buys on a moving average crossover and sells 4 days later. Your system wins 58% of the time and loses 42% of the time. Your winning trades make 3.5% on average and your losing trades lose 3.7% on average. Your expectation is 0.58*0.035 - 0.42*0.037 = 0.00476, which is greater than zero. This means that you can expect to make 0.476% on average on every trade you enter in the future (Tenet 4 above). It is very difficult to design a profitable trading system with a negative expectation.

4.

**Risk Management:**Risk is the potential that a particular trade you enter will results in a loss. Every trade you enter has a chance of losing. Some trades have a bigger potential loss than others. You can find out some factors that produce bigger winners and smaller losers. Perhaps stocks with a very high average true range win big with your system? If so, bet more on those positions and less on others. Also, consider how big your stop losses and profit targets are if you use them. There are many position sizing methods to use here, but the main ones are "fixed risk" and "fixed fractional" position sizing. The Kelly formula will give you a decent starting point for position sizing. Google that.

5.

**Time frame:**Just about every random mechanical system ever created is very successful over a short time frame like a month or a year. However, you have to know when to start trading that system and when to stop. A short-only, trend-following system would have been great during the time frame of September 2008 to March 2009! How do you know when to stop trading the system? It's very hard to predict turning points in the market like March 9, 2009. It's much simpler if you design a system that performs well or at least okay during up, down, volatile, and quiet markets. It's okay if you can get your system to make hordes of money in some types of markets and just limit losses other types of markets. The key statistic is your expectation over a long period of time (like 10-20 years). Hopefully, it is positive. If you have positive expectation, you can adjust your risk management to achieve your performance goals.

6.

**Optimization:**Run your backtest over your selected time frame with a range of different parameters. For example, going back to our moving average crossover system, test over different periods for the moving average. You can test a range of values for the periods of any indicator, the stop loss amount, the fixed risk amount, the number of days to stay in a position, etc. Any parameter that is numeric can be optimized. In your optimization, you want to make sure that your system makes money over a wide range of values for each of these parameters so that your simulation results are robust. Once you confirm that, choose the parameter values that produce the best performance (e.g. highest annual return, lowest drawdown, highest win rate, etc.).

I hope this helps some people and stirs some discussion. Thanks for reading!