Mathematical Expectation for a trading system

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Mathematical Expectation for a trading system

Mark Breman-3
Hello,
In "The mathematics of money management" by Ralph Vince there is a formula
for calculating the Mathematical Expectation of a game (in R pseudo code):

ME  =  for(i in 1:N) { Pi * Ai}

where
P = Probability of winning or losing
A = Amount won or lost
N = Number of possible outcomes.

Or in text: "Mathematical expectation is the amount you expect to make or
lose, on average, each bet".

Now suppose I want to know the Mathematical expectation of a trading system.

I have a series of trade returns:

> trades$PnL
 [1]  -5.75  10.00  -1.25  96.00 -16.00 -35.00  29.00 -18.25  -2.25 -10.25
-21.75  -5.50   8.50 -20.50  -6.00  14.25  18.00
[18]   3.75  -4.25  24.00  17.75  -9.50  11.25 -33.75   6.25 -28.00   1.00
 36.75  14.00 -30.75  -0.50   6.75  19.25   5.25
[35] -10.00 -23.25   9.25  11.00 -33.00 -19.00 -17.50  -5.50  -5.75  -8.50
-24.50 -24.00   2.25  -1.00   0.75  -1.75  -2.25
[52]   9.25  15.00  -2.25  -6.75   5.25  -4.75 -10.00  -2.00  63.50 -18.00
-18.00  58.00  -8.75   1.00 -36.75 -23.50 -64.00
[69] -15.75 -10.00 -34.75  27.75 -57.00 204.75 -45.00 -71.00 133.75

So I have A = trades$PnL and N=77, but how do I calculate P?

-Mark-

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Patrick Burns-2
You might get different answers, but
I think you are essentially asking
the impossible.  You might be able
to estimate P, but estimates will be
very noisy.  With any strategy sometimes
the market agrees with the strategy
and sometimes it doesn't.

A friend told me about hearing a talk
on a strategy that did very well over
the last 60 or 70 years.  My friend
raised his hand and pointed out that
the strategy lost money for about
40 years, so the speaker may not have
been in business any more to take
advantage of the big gains later.

What you care about is P in the immediate
future.  That's a hard problem.



Patrick Burns
[hidden email]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")

Mark Breman wrote:

> Hello,
> In "The mathematics of money management" by Ralph Vince there is a formula
> for calculating the Mathematical Expectation of a game (in R pseudo code):
>
> ME  =  for(i in 1:N) { Pi * Ai}
>
> where
> P = Probability of winning or losing
> A = Amount won or lost
> N = Number of possible outcomes.
>
> Or in text: "Mathematical expectation is the amount you expect to make or
> lose, on average, each bet".
>
> Now suppose I want to know the Mathematical expectation of a trading system.
>
> I have a series of trade returns:
>
>> trades$PnL
>  [1]  -5.75  10.00  -1.25  96.00 -16.00 -35.00  29.00 -18.25  -2.25 -10.25
> -21.75  -5.50   8.50 -20.50  -6.00  14.25  18.00
> [18]   3.75  -4.25  24.00  17.75  -9.50  11.25 -33.75   6.25 -28.00   1.00
>  36.75  14.00 -30.75  -0.50   6.75  19.25   5.25
> [35] -10.00 -23.25   9.25  11.00 -33.00 -19.00 -17.50  -5.50  -5.75  -8.50
> -24.50 -24.00   2.25  -1.00   0.75  -1.75  -2.25
> [52]   9.25  15.00  -2.25  -6.75   5.25  -4.75 -10.00  -2.00  63.50 -18.00
> -18.00  58.00  -8.75   1.00 -36.75 -23.50 -64.00
> [69] -15.75 -10.00 -34.75  27.75 -57.00 204.75 -45.00 -71.00 133.75
>
> So I have A = trades$PnL and N=77, but how do I calculate P?
>
> -Mark-
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Knecht
In reply to this post by Mark Breman-3
On Wed, Oct 14, 2009 at 1:39 AM, Mark Breman <[hidden email]> wrote:

> Hello,
> In "The mathematics of money management" by Ralph Vince there is a formula
> for calculating the Mathematical Expectation of a game (in R pseudo code):
>
> ME  =  for(i in 1:N) { Pi * Ai}
>
> where
> P = Probability of winning or losing
> A = Amount won or lost
> N = Number of possible outcomes.
>
> Or in text: "Mathematical expectation is the amount you expect to make or
> lose, on average, each bet".
>
> Now suppose I want to know the Mathematical expectation of a trading system.
>
> I have a series of trade returns:
>
>> trades$PnL
>  [1]  -5.75  10.00  -1.25  96.00 -16.00 -35.00  29.00 -18.25  -2.25 -10.25
> -21.75  -5.50   8.50 -20.50  -6.00  14.25  18.00
> [18]   3.75  -4.25  24.00  17.75  -9.50  11.25 -33.75   6.25 -28.00   1.00
>  36.75  14.00 -30.75  -0.50   6.75  19.25   5.25
> [35] -10.00 -23.25   9.25  11.00 -33.00 -19.00 -17.50  -5.50  -5.75  -8.50
> -24.50 -24.00   2.25  -1.00   0.75  -1.75  -2.25
> [52]   9.25  15.00  -2.25  -6.75   5.25  -4.75 -10.00  -2.00  63.50 -18.00
> -18.00  58.00  -8.75   1.00 -36.75 -23.50 -64.00
> [69] -15.75 -10.00 -34.75  27.75 -57.00 204.75 -45.00 -71.00 133.75
>
> So I have A = trades$PnL and N=77, but how do I calculate P?
>
> -Mark-

Hi Mark,
   The simple answer would be:

1) Look at all the data you have today. How many trades won? How many
trades total? P = Total wins/ total trades

2) Start trading. After some fixed number of trades - say 30 more
trades - how did the win/loss ratio compare?

   Don't think only of the probability, but also how much does the
probability vary? I have systems that trade 4000 times in 6 months. I
constantly track win/loss ratios as a rolling calculation just to
watch how the system might be doing in a new market type. My system
might have a probability of winning 82% of the time over 4000 trades
but goes up and down by 5% when looking at any 100 consecutive trades.
(So 77%-87% wins) I consider that 'normal'. If it gets outside of 5% I
might stop trading it until it's back in the 'normal' range.

   Note that I do this also for what you call 'A' since the product
represents the potential for making money if everything works out
'normally'. ;-)

HTH,
Mark

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
markknecht@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Breman-3
Hhmmm, this is all very strange.
The subject of "Mathematics of money management" is about optimizing trade
size under reinvestment of profits (optimizing the Growth function G(f),
i.e. finding the optimal f)
Ralph Vince warns the reader that the trade system to start with should have
a positive Mathematical expectation to start with, because the optimal f can
not turn a losing system into a winning system.

>From the reactions here I conclude that it's impossible to calculate a
reliable Mathematical expectation for the system to start with, so what's
the value of optimal f if you can never be confident that the system is
profitable to start with?

Some reactions on this thread referred to the validity of historical data to
future performance of the system.
I think it's clear that there are no guarantees for the future whatsoever if
we formulate expectations solely based on data from the past. I think
this uncertainty is part of trading. But is it not possible to calculate a
Mathematical expectation for a system based on historical results which only
says something about the validity/performance of the system in the past?

Would the following approach be sensible/possible:
Take the historical profits and loses from the system and look at the
distribution of these results. If the distribution looks like a normal
distribution (as expected for stock market returns, at least in theory), use
the normal distribution to calculate the P (probability of winning or
losing) and calculate the Mathematical expectation?

-Mark-

2009/10/14 Mark Knecht <[hidden email]>

> On Wed, Oct 14, 2009 at 1:39 AM, Mark Breman <[hidden email]>
> wrote:
> > Hello,
> > In "The mathematics of money management" by Ralph Vince there is a
> formula
> > for calculating the Mathematical Expectation of a game (in R pseudo
> code):
> >
> > ME  =  for(i in 1:N) { Pi * Ai}
> >
> > where
> > P = Probability of winning or losing
> > A = Amount won or lost
> > N = Number of possible outcomes.
> >
> > Or in text: "Mathematical expectation is the amount you expect to make or
> > lose, on average, each bet".
> >
> > Now suppose I want to know the Mathematical expectation of a trading
> system.
> >
> > I have a series of trade returns:
> >
> >> trades$PnL
> >  [1]  -5.75  10.00  -1.25  96.00 -16.00 -35.00  29.00 -18.25  -2.25
> -10.25
> > -21.75  -5.50   8.50 -20.50  -6.00  14.25  18.00
> > [18]   3.75  -4.25  24.00  17.75  -9.50  11.25 -33.75   6.25 -28.00
> 1.00
> >  36.75  14.00 -30.75  -0.50   6.75  19.25   5.25
> > [35] -10.00 -23.25   9.25  11.00 -33.00 -19.00 -17.50  -5.50  -5.75
>  -8.50
> > -24.50 -24.00   2.25  -1.00   0.75  -1.75  -2.25
> > [52]   9.25  15.00  -2.25  -6.75   5.25  -4.75 -10.00  -2.00  63.50
> -18.00
> > -18.00  58.00  -8.75   1.00 -36.75 -23.50 -64.00
> > [69] -15.75 -10.00 -34.75  27.75 -57.00 204.75 -45.00 -71.00 133.75
> >
> > So I have A = trades$PnL and N=77, but how do I calculate P?
> >
> > -Mark-
>
> Hi Mark,
>   The simple answer would be:
>
> 1) Look at all the data you have today. How many trades won? How many
> trades total? P = Total wins/ total trades
>
> 2) Start trading. After some fixed number of trades - say 30 more
> trades - how did the win/loss ratio compare?
>
>   Don't think only of the probability, but also how much does the
> probability vary? I have systems that trade 4000 times in 6 months. I
> constantly track win/loss ratios as a rolling calculation just to
> watch how the system might be doing in a new market type. My system
> might have a probability of winning 82% of the time over 4000 trades
> but goes up and down by 5% when looking at any 100 consecutive trades.
> (So 77%-87% wins) I consider that 'normal'. If it gets outside of 5% I
> might stop trading it until it's back in the 'normal' range.
>
>   Note that I do this also for what you call 'A' since the product
> represents the potential for making money if everything works out
> 'normally'. ;-)
>
> HTH,
> Mark
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Knecht
Hi Mark,

On Thu, Oct 15, 2009 at 1:28 AM, Mark Breman <[hidden email]> wrote:
> Hhmmm, this is all very strange.
> The subject of "Mathematics of money management" is about optimizing trade
> size under reinvestment of profits (optimizing the Growth function G(f),
> i.e. finding the optimal f)

To be clear but somewhat off topic - Optimal f is only one of many
ways to size a position. Optimal f itself might not be appropriate for
your risk tolerances as it can cause large drawdowns.

> Ralph Vince warns the reader that the trade system to start with should have
> a positive Mathematical expectation to start with, because the optimal f can
> not turn a losing system into a winning system.

Independent of the calculations did your system make money
historically? If it did then it has a positive expectation.

> From the reactions here I conclude that it's impossible to calculate a
> reliable Mathematical expectation for the system to start with,

I do not understand this conclusion unless you are keying on the word
'reliable' and have some specific idea in mind about what that means.

> so what's
> the value of optimal f if you can never be confident that the system is
> profitable to start with?

The results of any sizing algorithm operating into the future is only
as valid as the idea that the system will continue to perform in a
similar manner. There is no guarantee trade by trade of anything, but
if the system's average return per trade was $1 over the past 1000
trades then we should expect that over the next 100 trades it will
also return $1 per trade. Further we should expect that we'll see
similar win/loss ratios and the largest winner and loser will
hopefully be smaller than the similar trades in the history of the
system. If that turns out to be true then we say the system is
continuing to operate as it did in the past.

However there are NO guarantees.


> Some reactions on this thread referred to the validity of historical data to
> future performance of the system.
> I think it's clear that there are no guarantees for the future whatsoever if
> we formulate expectations solely based on data from the past. I think
> this uncertainty is part of trading. But is it not possible to calculate a
> Mathematical expectation for a system based on historical results which only
> says something about the validity/performance of the system in the past?

I believe it is and that's what I do.

> Would the following approach be sensible/possible:
> Take the historical profits and loses from the system and look at the
> distribution of these results. If the distribution looks like a normal
> distribution (as expected for stock market returns, at least in theory), use
> the normal distribution to calculate the P (probability of winning or
> losing) and calculate the Mathematical expectation?

I don't know about this, but I'm not clear why it's needed unless you
have a requirement to trade systems that have 'normal' distributions
of trade-by-trade returns.

Hope this helps,
Mark

> -Mark-
> 2009/10/14 Mark Knecht <[hidden email]>
>>
>> On Wed, Oct 14, 2009 at 1:39 AM, Mark Breman <[hidden email]>
>> wrote:
>> > Hello,
>> > In "The mathematics of money management" by Ralph Vince there is a
>> > formula
>> > for calculating the Mathematical Expectation of a game (in R pseudo
>> > code):
>> >
>> > ME  =  for(i in 1:N) { Pi * Ai}
>> >
>> > where
>> > P = Probability of winning or losing
>> > A = Amount won or lost
>> > N = Number of possible outcomes.
>> >
>> > Or in text: "Mathematical expectation is the amount you expect to make
>> > or
>> > lose, on average, each bet".
>> >
>> > Now suppose I want to know the Mathematical expectation of a trading
>> > system.
>> >
>> > I have a series of trade returns:
>> >
>> >> trades$PnL
>> >  [1]  -5.75  10.00  -1.25  96.00 -16.00 -35.00  29.00 -18.25  -2.25
>> > -10.25
>> > -21.75  -5.50   8.50 -20.50  -6.00  14.25  18.00
>> > [18]   3.75  -4.25  24.00  17.75  -9.50  11.25 -33.75   6.25 -28.00
>> > 1.00
>> >  36.75  14.00 -30.75  -0.50   6.75  19.25   5.25
>> > [35] -10.00 -23.25   9.25  11.00 -33.00 -19.00 -17.50  -5.50  -5.75
>> >  -8.50
>> > -24.50 -24.00   2.25  -1.00   0.75  -1.75  -2.25
>> > [52]   9.25  15.00  -2.25  -6.75   5.25  -4.75 -10.00  -2.00  63.50
>> > -18.00
>> > -18.00  58.00  -8.75   1.00 -36.75 -23.50 -64.00
>> > [69] -15.75 -10.00 -34.75  27.75 -57.00 204.75 -45.00 -71.00 133.75
>> >
>> > So I have A = trades$PnL and N=77, but how do I calculate P?
>> >
>> > -Mark-
>>
>> Hi Mark,
>>   The simple answer would be:
>>
>> 1) Look at all the data you have today. How many trades won? How many
>> trades total? P = Total wins/ total trades
>>
>> 2) Start trading. After some fixed number of trades - say 30 more
>> trades - how did the win/loss ratio compare?
>>
>>   Don't think only of the probability, but also how much does the
>> probability vary? I have systems that trade 4000 times in 6 months. I
>> constantly track win/loss ratios as a rolling calculation just to
>> watch how the system might be doing in a new market type. My system
>> might have a probability of winning 82% of the time over 4000 trades
>> but goes up and down by 5% when looking at any 100 consecutive trades.
>> (So 77%-87% wins) I consider that 'normal'. If it gets outside of 5% I
>> might stop trading it until it's back in the 'normal' range.
>>
>>   Note that I do this also for what you call 'A' since the product
>> represents the potential for making money if everything works out
>> 'normally'. ;-)
>>
>> HTH,
>> Mark
>
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
markknecht@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Patrick Burns-2
Mark Knecht wrote:
> Hi Mark,
>
> On Thu, Oct 15, 2009 at 1:28 AM, Mark Breman <[hidden email]> wrote:

[...]

>
>> Ralph Vince warns the reader that the trade system to start with should have
>> a positive Mathematical expectation to start with, because the optimal f can
>> not turn a losing system into a winning system.
>
> Independent of the calculations did your system make money
> historically? If it did then it has a positive expectation.
>

The truth of that assertion depends on at
least two assumptions:

* Selection bias is not very strong.

* The market will behave in the future like
it did over the historical period.




Patrick Burns
[hidden email]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Breman-3
I think I found the answer for calculating the Mathematical Expectation (as
intended by Ralph Vince):
P = #winners / # losers

So the ME for my System would be:

> P = length(subset(trades$PnL, trades$PnL > 0)) / length(subset(trades$PnL,
trades$PnL < 0))
> P
[1] 0.6382979
> sum(P * trades$PnL)
[1] 6.223404

For what it's worth...

Regards,

-Mark-

2009/10/16 Patrick Burns <[hidden email]>

> Mark Knecht wrote:
>
>> Hi Mark,
>>
>> On Thu, Oct 15, 2009 at 1:28 AM, Mark Breman <[hidden email]>
>> wrote:
>>
>
> [...]
>
>
>>  Ralph Vince warns the reader that the trade system to start with should
>>> have
>>> a positive Mathematical expectation to start with, because the optimal f
>>> can
>>> not turn a losing system into a winning system.
>>>
>>
>> Independent of the calculations did your system make money
>> historically? If it did then it has a positive expectation.
>>
>>
> The truth of that assertion depends on at
> least two assumptions:
>
> * Selection bias is not very strong.
>
> * The market will behave in the future like
> it did over the historical period.
>
>
>
>
>
> Patrick Burns
> [hidden email]
> +44 (0)20 8525 0696
> http://www.burns-stat.com
> (home of "The R Inferno" and "A Guide for the Unwilling S User")
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Knecht
On Fri, Oct 16, 2009 at 2:46 AM, Mark Breman <[hidden email]> wrote:
> I think I found the answer for calculating the Mathematical Expectation (as
> intended by Ralph Vince):
> P = #winners / # losers

Is it #winner/#losers or is it #winner/#trades ?

Either can be true but I think the latter is more common in my
experience as it yields a value between 0 and 1.

good luck,
Mark

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
markknecht@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Breman-3
Hi Mark,
You are right: it is P = #winners / #trades

Thank you,

-Mark-

2009/10/16 Mark Knecht <[hidden email]>

> On Fri, Oct 16, 2009 at 2:46 AM, Mark Breman <[hidden email]>
> wrote:
> > I think I found the answer for calculating the Mathematical Expectation
> (as
> > intended by Ralph Vince):
> > P = #winners / # losers
>
> Is it #winner/#losers or is it #winner/#trades ?
>
> Either can be true but I think the latter is more common in my
> experience as it yields a value between 0 and 1.
>
> good luck,
> Mark
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Ulrich Staudinger-2
Hi,

out of curiosity,
how would you define this statistic with a ramp up and ramp down trade
system ?
Trades could look like this:

Buy 1 @ 100
Buy 1 @ 101
Buy 1 @ 102
Buy 1 @ 103
Sell 2 @ 102
Sell 2 @ 101
Sell 2 @ 99
Sell 1 @ 98

?

Thanks,
kind regards,
Ulrich

On Fri, Oct 16, 2009 at 3:36 PM, Mark Breman <[hidden email]> wrote:

> Hi Mark,
> You are right: it is P = #winners / #trades
>
> Thank you,
>
> -Mark-
>
> 2009/10/16 Mark Knecht <[hidden email]>
>
> > On Fri, Oct 16, 2009 at 2:46 AM, Mark Breman <[hidden email]>
> > wrote:
> > > I think I found the answer for calculating the Mathematical Expectation
> > (as
> > > intended by Ralph Vince):
> > > P = #winners / # losers
> >
> > Is it #winner/#losers or is it #winner/#trades ?
> >
> > Either can be true but I think the latter is more common in my
> > experience as it yields a value between 0 and 1.
> >
> > good luck,
> > Mark
> >
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



--
Ulrich B. Staudinger

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Knecht
In reply to this post by Mark Breman-3
Please see the first response I made to this thread.

Cheers,
Mark

On Fri, Oct 16, 2009 at 6:36 AM, Mark Breman <[hidden email]> wrote:

> Hi Mark,
> You are right: it is P = #winners / #trades
> Thank you,
> -Mark-
>
> 2009/10/16 Mark Knecht <[hidden email]>
>>
>> On Fri, Oct 16, 2009 at 2:46 AM, Mark Breman <[hidden email]>
>> wrote:
>> > I think I found the answer for calculating the Mathematical Expectation
>> > (as
>> > intended by Ralph Vince):
>> > P = #winners / # losers
>>
>> Is it #winner/#losers or is it #winner/#trades ?
>>
>> Either can be true but I think the latter is more common in my
>> experience as it yields a value between 0 and 1.
>>
>> good luck,
>> Mark
>
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
markknecht@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Knecht
In reply to this post by Ulrich Staudinger-2
Not enough information. Is this a long-only system? If it is then you
bought 4 and sold 7.

Is this a system that goes long and short? If so then I cannot tell
what completes a trade?

Most likely I'd start with some sort of LIFO (Last in first out) and
then try FIFO. (First in first out)

LIFO:
Buy 103 & 102, sell 2@102 - currently long 2
Buy 101 & 100, sell 2@101 - currently flat
Sell 2@99
Sell 98 - currently short 3

I'm not sure this is what you mean though. After matching them up it's
just winners/trades to me.

Other ideas?

- Mark

On Fri, Oct 16, 2009 at 7:17 AM, Ulrich Staudinger
<[hidden email]> wrote:

> Hi,
>
> out of curiosity,
> how would you define this statistic with a ramp up and ramp down trade
> system ?
> Trades could look like this:
>
> Buy 1 @ 100
> Buy 1 @ 101
> Buy 1 @ 102
> Buy 1 @ 103
> Sell 2 @ 102
> Sell 2 @ 101
> Sell 2 @ 99
> Sell 1 @ 98
>
> ?
>
> Thanks,
> kind regards,
> Ulrich
>
> On Fri, Oct 16, 2009 at 3:36 PM, Mark Breman <[hidden email]> wrote:
>>
>> Hi Mark,
>> You are right: it is P = #winners / #trades
>>
>> Thank you,
>>
>> -Mark-
>>
>> 2009/10/16 Mark Knecht <[hidden email]>
>>
>> > On Fri, Oct 16, 2009 at 2:46 AM, Mark Breman <[hidden email]>
>> > wrote:
>> > > I think I found the answer for calculating the Mathematical
>> > > Expectation
>> > (as
>> > > intended by Ralph Vince):
>> > > P = #winners / # losers
>> >
>> > Is it #winner/#losers or is it #winner/#trades ?
>> >
>> > Either can be true but I think the latter is more common in my
>> > experience as it yields a value between 0 and 1.
>> >
>> > good luck,
>> > Mark
>> >
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>
>
>
> --
> Ulrich B. Staudinger
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
markknecht@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Ulrich Staudinger-2
Hi,

On Fri, Oct 16, 2009 at 4:34 PM, Mark Knecht <[hidden email]> wrote:

> Not enough information. Is this a long-only system? If it is then you
> bought 4 and sold 7.
>
> Is this a system that goes long and short? If so then I cannot tell
> what completes a trade?
>

the trade system in this case could have been any long/short trade system.
I think the winners/loosers ratio is only applicable to a limited amount  of
trade systems and does therefore provide only limited confidence about the
expectation of trade systems.

Other ratios like LiquidationPnl / Trades make more sense, or for example, a
curve marked-to-market values of the position once a trade occurs.

Another aspect is also the definition of a trade, i define, and i think
that's also the mainstream definition a trade as a transaction. What you
call a trade completion is something i know as a roundturn (buy and sell).
The term round turns is  not applicable to pyramidizing systems, i think.


Kind regards,
Ulrich




--
Ulrich B. Staudinger

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Knecht
On Fri, Oct 16, 2009 at 8:00 AM, Ulrich Staudinger
<[hidden email]> wrote:

> Hi,
>
> On Fri, Oct 16, 2009 at 4:34 PM, Mark Knecht <[hidden email]> wrote:
>>
>> Not enough information. Is this a long-only system? If it is then you
>> bought 4 and sold 7.
>>
>> Is this a system that goes long and short? If so then I cannot tell
>> what completes a trade?
>
> the trade system in this case could have been any long/short trade system.
> I think the winners/loosers ratio is only applicable to a limited amount  of
> trade systems and does therefore provide only limited confidence about the
> expectation of trade systems.

Higher math - you
Lower math - me


>
> Other ratios like LiquidationPnl / Trades make more sense, or for example, a
> curve marked-to-market values of the position once a trade occurs.

Possibly. I don't disagree. Can't when my level of understanding is so low.

One comment I'd make is that I wouldn't include trades that are in
process as they aren't historical. Personally I look only at closed
trades when evaluating my systems historically.

>
> Another aspect is also the definition of a trade, i define, and i think
> that's also the mainstream definition a trade as a transaction. What you
> call a trade completion is something i know as a roundturn (buy and sell).
> The term round turns is  not applicable to pyramidizing systems, i think.
>

I don't disagree, but once we've matched buys to sells and thrown away
everything that's in process maybe the overall average expectation ($
Made/#trades) isn't any different but the largest winner, largest
losers are?

I do a lot of modeling on paper where I use what I call the 6 Tharp
numbers and generate trade sequences automatically to study things
like drawdowns, risk or ruin, etc. I think they are applicable to
pyramiding systems but as I said originally

Higher math - you
Lower math - me

;-)

>
> Kind regards,
> Ulrich
>
>
>
>
> --
> Ulrich B. Staudinger
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
markknecht@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Mathematical Expectation for a trading system

Mark Breman-3
In reply to this post by Ulrich Staudinger-2
Hi Ulrich,
Interesting question Ulrich. I had a look in Ralph Vince's book but I could
not find anything about calculating optimal f for these kind of systems. I
have not finished the book yet, so maybe it is somewhere hidden in the
text...

I know Ralph is monitoring this list so maybe he could share his light on
this?

Regards,

-Mark-

2009/10/16 Ulrich Staudinger <[hidden email]>

> Hi,
>
> out of curiosity,
> how would you define this statistic with a ramp up and ramp down trade
> system ?
> Trades could look like this:
>
> Buy 1 @ 100
> Buy 1 @ 101
> Buy 1 @ 102
> Buy 1 @ 103
> Sell 2 @ 102
> Sell 2 @ 101
> Sell 2 @ 99
> Sell 1 @ 98
>
> ?
>
> Thanks,
> kind regards,
> Ulrich
>
> On Fri, Oct 16, 2009 at 3:36 PM, Mark Breman <[hidden email]>wrote:
>
>> Hi Mark,
>> You are right: it is P = #winners / #trades
>>
>> Thank you,
>>
>> -Mark-
>>
>> 2009/10/16 Mark Knecht <[hidden email]>
>>
>> > On Fri, Oct 16, 2009 at 2:46 AM, Mark Breman <[hidden email]>
>> > wrote:
>> > > I think I found the answer for calculating the Mathematical
>> Expectation
>> > (as
>> > > intended by Ralph Vince):
>> > > P = #winners / # losers
>> >
>> > Is it #winner/#losers or is it #winner/#trades ?
>> >
>> > Either can be true but I think the latter is more common in my
>> > experience as it yields a value between 0 and 1.
>> >
>> > good luck,
>> > Mark
>> >
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>>
>
>
>
> --
> Ulrich B. Staudinger
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Enough, please (Was: Mathematical Expectation for a trading system)

Dirk Eddelbuettel

Greetings from your listmaster!

Could you fellows please move this discussion somewhere else?  

I believe I speak for the readership at large when I say that its usefulness
in the context of using R in Finance has long declined beyond the point of
general measurability.  So please take it elsewhere.

Readers disagreeing with me are kindly invited to contact me off-list.

In related news, I also unsubscribed Elise J for her repeated spamming of the
list with unrelated conference commercials.  However, that may not protect us
from her re-subscribing.

Back to our regularly scheduled R / Finance geekyness,   Dirk

--
Three out of two people have difficulties with fractions.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.