31.07.2021 Views

Ultimate Algorithmic Trading System

Using automated systems for trading in stock markets

Using automated systems for trading in stock markets

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Pause the Battle—Let’s Talk Risk of Ruin Risk of ruin is a very useful tool

in determining the likelihood of a trader losing his entire bankroll or reducing it to

a level that trading cannot continue. Calculating this risk (RoR) is quite simple; all

you need is the amount of capital to be risked on any given trade and the probability

of success, also known as the algorithm’s trading advantage:

RoR =((1 − A)∕(1 + A))ˆC

where A is the algorithm’s trading advantage and C is the number of units in your

account. To calculate A, subtract the percent chance of loss from percent chance of

win. So, if you expect to win 54% of your trades, the trading advantage would be

8% (54% − 46% = 8%). To calculate C, simply divide 1 by the percent of capital

you are willing to risk on each trade. So, if you are willing to risk 5% of any given

trade, then you have 20 units. Plugging A and C into the formula you come up with

((1 − 0.08) / (1 + 0.08)) ˆ 20. The result turns out to be around 4%. The RoR for

risking 5% of your capital on each trade with an algorithm that wins 54% of time is

a relatively low 4%. If the percent of wins is 50% or less, the RoR is 100%. The

base number that is being raised by unit size C decreases as the trading advantage

increases. As long as the percent wins are greater than 50%, the base number will

always be less than one. Unit size C decreases as risk per trade increases. Raising a

number less than one by higher values decreases the result or in this case the RoR.

In other words, the RoR is indirectly proportional to the risk.

This simple formula only works with algorithms that win more often than

they lose and each win and loss is identical. If you plug in a winning percentage

of 50% or less, the RoR is guaranteed. If you applied this very simple formula

to the vast majority of trend-following systems, you would never take the first

trade. When determining RoR you must look beyond percent wins and risk. Most

trend-following systems win less than 40% of their trades. The key performance

metrics in this case are the average win and average loss in dollars. You can still

win with a sub-50% winning system as long as your average trade (average win

/ average loss) is sufficiently high enough. The formula for RoR for when wins

and losses are not identical is unfortunately much more complex. I refer you to

Ralph Vince’s excellent book, Portfolio Management Formulas (Wiley, New York,

1990) if you want to see the derivation of this formula. The formula is complicated

but the algorithm is quite simple if you have the correct performance metrics of

your algorithm. An Excel spreadsheet that utilizes this formula is available from

this book’s companion website. Here is an example of the worksheet and its

computed RoR using performance metrics from a typical trend-following algorithm

(see figure 3-2.).

87

COMPLETE TRADING ALGORITHMS

www.rasabourse.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!