prob function combining continuous and discrete

Discussion in 'Strategy Development' started by zedDoubleNaught, Mar 23, 2012.

  1. Here's a screenshot when I plot out some trades from a strategy. With no stop or limit, it looks like some kind of bell curve. When I add a stop, it has a tall count at the stop, and the rest looks like some kind of bell curve.

    For the probability density function, I suppose the no-stop case would be:

    pdf = someContinuousDistribution ( central parameter, deviation parameter )

    But what would it be for the stop case? I think it would combine a discrete probability for the stop, and a distribution for the rest. This is my guess for how it would look:

    pdf = p(stopped) + [ p(notStopped) * someContinuousDistribution(central parameter, deviation parameter) ]

    This would say, if 40% got stopped out, then multiply the distribution function for the non-stopped by 60%; that would preserve the formula summing to 1. It seems to make sense to me, but I don't know much, it could be too simplistic.

    thanks for any help or suggestions
  2. here is screenshot:
  3. I wouldn't really approach it by expressing it as a continuous function (or combination comprised of such). Using the guassian (or any known cont. function) PDF will not likely match your curve (particularly in tails and various moments). Finding a continuous function for these types of densities often results in erroneous conclusions, (for ex. in donnel 'optimal portfolio modeling,' he draws the conlusion that a stop-loss has zero effect, other than commisions loss because of assumed path symmetry and normal distribution bounding).

    I would approach it by binning and normalizing discretely. I.e. if you sum all of the occurrences, that sum is the normalizing factor, such that your total area =1. Then if the big stop was in say -41 to -40, you could take the count of values occurring in that bin stop and divide by the normalizing factor to get prob(x|-41 < x < -40). You'd also have empirical probabilities for all of the other values of x to the right.

    If you simply wanted to express it as a combination for academic reasons, you could say something like:

    P(x) = { p(x) if x <= stop
    { pdf.cont(x)-p(x) if x> stop
    where pdf.cont(x) is normalized to 1, and the p(x) is normalized over sum of all the counts.

  4. Thank you dtrader98, that sounds like a more sensible and productive approach than my guess. Also that answers a second question I've been trying to figure out, which is how to smooth out the histogram -- I think binning would do that.
  5. Binning will filter original histogram somewhat, but if you want to actually smooth it, you can look into kernel density estimation or knn smoothing for non-parametric distributions.

    Several free implementations are listed at the bottom of this wiki entry:

  6. Perhaps this will give you some insight:
  7. I've only just looked through it a couple seconds, very interesting this line:

    "... the fraction of winning trades is in fact a measure of the ratio of the holding periods of winning trades to that of losing trades: ..."

    In my own research, I've found a way of estimating the win ratio with fixed stops and losses, this is an interesting alternative way of looking at it as "holding periods". It could be a similar concept if the average holding period were related to the average distance traveled, as I've seen the case made in another thread. Not a firm opinion, just guessing out loud.

    Thanks for the link, I learn a lot from these sort of papers. I am always interested in seeing how the math applies, I study math on my own as a hobby in my spare time. When I'm fortunate, it even helps in designing a strategy.
  8. So is the following a correct understanding of some of the implications of the above paper?

    Following occurrence of a valid mean reverting trade entry signal, the most likely eventual direction of price action is back in the desired mean reverting direction, even if just by a small amount. Not surprising …

    However, following occurrence of a valid trend following trade entry signal on the other hand, the most likely eventual direction of price action is in the unfavorable mean reverting direction, rather than in the direction of the trend. But on the minority of occasions when price action does continue in the trend direction, a bigger move is more likely.
  9. The paper is an example of typical circular proof. First they asusme that:

    "Since asset prices are very close to being pure random walks, any statistical signal exploited by systematic traders has
    an extremely small signal to noise ratio."

    If one assumes the above, there is no need to show anything else. The fact is that asset prices are not random walks for long periods of time.

    Obviously they do not understand trend-following bcause they say:

    "For example, a 40% fraction of winning trades merely indicates that (unless the manager is really lousy) the typical
    holding period of winning trades is ¡« 2 times that of losing trades. This, in turn, means that the manager is probably
    mostly trend following, since by definition a trend following strategy stays in position when the move is favorable, but
    closes it in case of adverse moves."

    Typical trend-following systems hold winners 10, 20, 30 or maybe 50 times longer than losers.
  10. Thanks.

    I don’t see any inconsistency between the two statements, yours that “asset prices are not random for long periods of time”, and the authors’ that “asset prices are very close to being pure random walks”.

    The authors’ point (as I understand it) is that since asset prices are very close to being pure random walks, some useful concepts and insights can be gained by assuming that they are, and then reasoning through to the implications of this assumption. As you’ll know, this is a common step in “knowledge advancement”; the High Energy Physicists working at CERN in Geneva probably consider Classical/Newtonian Mechanics, Atomic Theory, Fluid Dynamics, etc as imperfect approximations to the “Truth” they are grappling with, but I doubt any would deny that each of these imperfect theoretical frameworks (“circular proofs”?) has been useful.

    Where the author’s state that a trend following system has a holding period for winning trades that is approx twice (2.25 X) that of losing trades, they refer to a trend following system with 40 % winning trades. Are the trend following systems you refer to (i.e. with average winning trade holding periods of 10x, 20x, 30x or maybe 50x average losing trade holding periods) also of 40% win rate?
    #10     Apr 13, 2012