Expectation Value Spread Sheet to Estimate the Performance Requirements of an EA

 

For the benefit of the forum members I have attached a spread sheet that will give you a ballpark idea if your EA will make money or not even before you code it.

The spread sheet determines the expectation value or the change in equity of your account after a given number of trades have occurred.

Here is how you use the spreadsheet. Every green square in the spreadsheet is a data entry square. You input data here and only in the green squares. The first one in the upper left is the beginning equity of your account. The second is the amount of risk you make as a per cent of your equity for every trade you make. The next is the payoff which will be explained shortly. Next, you have the per cent win probability of every trade. Finally, you have the number of trades. The fixed $ risk square shows you how much you risk if you kept that risk the same for every trade. The fixed $ gain shows how much you would make for every winning trade for a fixed amount of risk. Note, the gain is simply the risk times the payoff. The yellow squares show that when you hit cntl c, the spreadsheet will generate a new sequence of trades. The figures directly above the graph show the number of wins and losses, the change in equity, and the return on investment of your initial equity balance.

For the default values in the spread sheet, you can see that if your EA gave you the results shown, your account would grow very quickly. Experiment around with different values and you can see how the equity curve changes. What you see on this spread sheet is a graphically representation of the expectation value. (It's essentially what you get when you use the strategy tester with a lot more detailed information.)

Now, here's a concrete example, using the spread sheet. Suppose you are ready to write a scalping EA. Lets assume you have a beginning account of 10,000 as shown. Also assume you will only risk one percent of your equity on every trade. (Highly recommended by many successful traders.) Assume you use 1 lot of the EUR/USD which has a spread of 2 pips. Now, if you are going to scalp you want to get in and out very quickly. If you want to get out when your account draws down 100.00 then you must get out when the trade has moved 8 pips against you. (8 x 1 lot x 10.00 per lot plus 2 x 1 lot x 10.00 per lot = 100.00). Since you are scalping you want to take a profit very quickly. Many scalpers exit when the trade makes about 10 pips. Thats a profit of 100.00. (10 x 1 lot x 10.00). Now whats the payoff? It's simply the amount you can make divided by the risk or your reward/risk ratio. In this case it's 1.

Now put this one in the spread sheet under payoff. With a 50 per cent chance of winning, the graph shows unimpressive results. In fact, if your win rate dropped below 50 per cent, such as 40 per cent, the laws of probability dictate you will drain your account. You can see this by the down-sloping equity curve.

Your EA with the given pip values, risk and payoff would have to win at least 60 per cent of your trades in order to increase your equity over time.

Files:
 

Nice one :-)

Another interesting game you can play is to set the expectation to be negative by say setting the risk/reward to unity and the win rate as 49% for 100 trades and then clicking Cntl+C and seeing that the result can be positive quite often.

 
dabbler:

Nice one :-)

Another interesting game you can play is to set the expectation to be negative by say setting the risk/reward to unity and the win rate as 49% for 100 trades and then clicking Cntl+C and seeing that the result can be positive quite often.


Yes, but this is the game that Vegas plays and the graph shows your chances are losing. Lets say you had 10 people who agreed to gamble at the casinos. The casinos have the advantage, about a 51% chance of winning. Now lets see what happens if each person gambled 100 times. Hit cntl c 10 times and this represents 100 gambles for each individual. Note what the ending expectation value for each sequence. Yes, there are a few individuals who will win at the end of 100 gambles.

But now set the number to 1450 (about the maximum this spreadsheet can handle) and hit the sequence ten times. Note what the ending expectation value for each person is. More people lose this time.

The casinos know this. They know in the long run if people keep gambling, the house will win.

 
forestmyopia:


Yes, but this is the game that Vegas plays and the graph shows your chances are losing. Lets say you had 10 people who agreed to gamble at the casinos. The casinos have the advantage, about a 51% chance of winning. Now lets see what happens if each person gambled 100 times. Hit cntl c 10 times and this represents 100 gambles for each individual. Note what the ending expectation value for each sequence. Yes, there are a few individuals who will win at the end of 100 gambles.

But now set the number to 1450 (about the maximum this spreadsheet can handle) and hit the sequence ten times. Note what the ending expectation value for each person is. More people lose this time.

The casinos know this. They know in the long run if people keep gambling, the house will win.

Sure, I made my point badly. What I was trying to say is that a short run can seem to be a winning strategy, even when it is actually losing in the long term .
 
dabbler:
Sure, I made my point badly. What I was trying to say is that a short run can seem to be a winning strategy, even when it is actually losing in the long term .

Good point. Traders should beware that they celebrate too early on an EA's performance. Only a long term back test and forward test will yield the true picture.
Reason: