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

Calculating max # of consecutive losing trades


  • To: omega-list@xxxxxxxxxx
  • Subject: Calculating max # of consecutive losing trades
  • From: Mark Johnson <janitor@xxxxxxxxxxxx>
  • Date: Mon, 22 Apr 2002 09:06:48 -0700
  • In-reply-to: <200204221549.IAA09055@xxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

Suppose a trading method produces winning trades with
probability P and losing trades with probability (1-P).
Suppose we want to know, what is the maximum number of
consecutive losing trades we can expect "on the average",
if we take N trades from this system.  For many traders,
the max # of consecutive losses is a good measurement
of the "pain" a trading system can inflict, and so
most backtesting software (System Writer Plus, Tradestation,
Behold, Metastock, etc) prints out this statistic.

(Recently I posted about a Monte Carlo simulation method
for calculating this expected value.)  But last night,
reading Richard Ahrens' article in the May '02 issue
of TASC, I got an idea for a way to calculate this number
directly.  I'll spare you the derivation; the formula is

DEFINITIONS
   P = probability of a winning trade
   N = number of trades
   Q = largest number of consecutive losing trades in a sequence of N trades
   EV(Q) = expected value of Q = average value of Q across many many sequences

FORMULA
   EV(Q) ~approx~= (log(2/N)) / log(1-P)

I tested the formula against Monte Carlo simulation and
found it matched quite well, in the region where traders
are likely to actually trade (i.e. P(win) > 20%):

                  largest # of
                  consec.losses
  #trds  P(win)   MCsim  Formula
================================
  1000   0.050    87.04  121.16
  1000   0.100    48.65   58.98
  1000   0.200    25.80   27.85
  1000   0.300    17.09   17.42
  1000   0.400    12.36   12.17
  1000   0.450    10.68   10.40
  1000   0.500     9.29    8.97
  1000   0.550     8.12    7.78
  1000   0.600     7.11    6.78
  1000   0.700     5.43    5.16
  1000   0.800     4.01    3.86
  1000   0.900     2.69    2.70
  1000   0.950     2.03    2.07

As you can see, it isn't perfect.  But it gets a
pretty darn close approximation and you don't need
to simulate one million trials, where each trial
contains 1000 trades, to get the result.

Best wishes,
--
    Mark Johnson     Silicon Valley, California     mark@xxxxxxxxxxxx

    "... The world will little note, nor long remember, what we
     say here..."   -Abraham Lincoln, "The Gettysburg Address"