Developing a profitable system(infrastructure) on a (pseudo-)random data

Quote from TigerBalm:

Mike805, your Excel sheet seems to work only because RANDBETWEEN(-1, 1) results in 2 cases (-1 and 0) where C is still the "High", and only 1 case where R is a High (for 1), i.e., 2/3 = 66.6%.

If you change that to RANDBETWEEN(-2, 2), you get 60% because now, there are 3 cases (-2, -1, and 0) where C = "High".

I'm not sure I see the "very neat property" here? Can you please state the exact property of random walk / distribution / gambling, which you intended to demonstrate? Maybe you can modify the Excel sheet?

To your first point, No - you're not understanding the math... you jumped to an incorrect conclusion...

To your second point, you changed the initial variables, hence the probability will change.

Attached please find a modified sheet that may be clearer.

The link below will shed some light on this for you as well:

http://en.wikipedia.org/wiki/Secretary_problem

What we're looking at is a trivial case of the above problem.

If after this you still don't see the "neat property" then we'll give it another shot.
 

Attachments

Kewl.

Odds Algo. / Optimal Stopping.

This stuff is new to me... I never knew they had an official name of "some" of the stuff I did...

Thanks... Who said, you can't learn something in ET???

Quote from Mike805:

To your first point, No - you're not understanding the math... you jumped to an incorrect conclusion...

To your second point, you changed the initial variables, hence the probability will change.

Attached please find a modified sheet that may be clearer.

The link below will shed some light on this for you as well:

http://en.wikipedia.org/wiki/Secretary_problem

What we're looking at is a trivial case of the above problem.

If after this you still don't see the "neat property" then we'll give it another shot.
 
Mike805, gotcha, thanks. The mathematics is way over my head. Here's a nice American Scientist article on optimal stopping that I had coincidentally saved for later reading.

http://www.americanscientist.org/issues/feature/knowing-when-to-stop/1

Edit : So yes, you were right, and this is certainly a "very neat property"! I believe this is a.k.a. the "Pick the largest number" puzzle. Man, isn't mathematics awesome. Now, if I only understood it!!

Quote from Mike805:

To your first point, No - you're not understanding the math... you jumped to an incorrect conclusion...

To your second point, you changed the initial variables, hence the probability will change.

Attached please find a modified sheet that may be clearer.

The link below will shed some light on this for you as well:

http://en.wikipedia.org/wiki/Secretary_problem

What we're looking at is a trivial case of the above problem.

If after this you still don't see the "neat property" then we'll give it another shot.
 
Quote from Equalizer:

Actually, to be pedantic, Wiener processes or Brownian (geometric or not) motion (Wiener with drift), the Wiener process (component for Brownian motion ) has increments X_t2 - X_t1 that are normally distributed with mean = 0 and variance = t2 - t1, by definition.

Also note that in Brownian motion the variance (and drift) is assumed to be constant, and Xt are iid (no serial correlation).

That's not being pedantic, that's really what this thread is about, although that's not clear from some of the posts.

Re: random, pseudo-random, etc., I think that's a pretty misleading name for what you're doing. I didn't realize that's what you meant at all. Now I think what you're talking about is bootstrapping: taking a given set of data points, drawing one, replacing it, drawing another, etc. It's resampling.

But really what you're doing is studying the distribution itself. If you can resample and get non-stationary, non-iid results, then you've learned something.

If you want to study a backtested strategy rather than the properties of your data, one easy way to learn some things is to take your historical trades, apply a coinflip filter to each entry, run 1000 simulations, and plot all the time series on a single graph. Then look at mean/median/etc.
 
Some of these theories are interesting as it applies to the one touch blues. Many traders stop or take profits on the first touch of a price and feel they miss the meat of the move etc.

The odd's algo fixes the lower bound win rate to .368 if you pass on the first touch and take the next better exit. The upper bound can be as high as 1.00.. ie all perfectly improved trades.

Essentially your betting to improve either your initial stop/profit with minimum 37% odds of improvement. If the improvement is 2x the value of the potential 2nd pass loss in theory you should consistently win.
 
Quote from TigerBalm:

Mike805, gotcha, thanks. The mathematics is way over my head. Here's a nice American Scientist article on optimal stopping that I had coincidentally saved for later reading.

http://www.americanscientist.org/issues/feature/knowing-when-to-stop/1

Edit : So yes, you were right, and this is certainly a "very neat property"! I believe this is a.k.a. the "Pick the largest number" puzzle. Man, isn't mathematics awesome. Now, if I only understood it!!

Good find on that article! It does a great job explaining the problem. Math is one of those interesting abstractions that can explain certain things very well and fail miserably at explaining others. The trick is knowing what is useful and when to apply it, and, at the same time being aware of the inherent pitfalls...

If any of you are into poker, you'll know of Barry Greenstein; a very succesful poker player. He's been quoted several times stating: "Math is idiotic". One time in particular he won a mid-six figure pot (no-limit game) after being a 4-1 underdog pre-flop.

Anyway, as much as I like poker, how do we create an interesting trading rule out of this? I believe MGJ had a very good coding example that, if massaged a bit, might show something interesting... or it may not, I've actually never used pure closing prices in this type of analysis.

The 50% figure is interesting nonetheless.

Mike
 
Quote from Mike805:

So, how do we create a trading rule?

At each step (or turn):

1. Close your position.
2. If expected move = up, open long position.
3. Else open short position (or stay in cash).

This strategy applied on a process with normal distribution has positive expectancy as long as:

fees < |avgGain|*0.66 - |avgLoss|*0.33.

Or in other words, if your process has a constant step size of s (at each step, the cumulative value is the previous one +/- s), then you have positive expectancy when:

s>fees*3.03

Your equity curve is then directly proportional to the trading frequency, which is linked to s by the sqrt() function and Pi.

Your trading fees determine your equity curve.

Quote from Mike805:

Foremost, SP closing prices are not a random process, there is inherent upward drift, dramatic price altering events, and above all, the distribution is not normal. Also, there is the "sampling" element. A closing price is a sample in time, it does not reflect a pure pseudo random stochastic process.

The way around this is ... (I won't give the answer away just yet).

Let me guess...

The way around this is ... to discretize price using a step function and to then normalize it with a volatility measure to eliminate fat tails?

Quote from Mike805:

To go the other way(i.e. real data), one has to create a distribution that most accurately reflects the data. In the case of SP data, a normal Dist. won't work and one will have to account for those non-linear and non-continuous steps. There's an art and some science to that... it essentially becomes an optimization problem where one has to "fit" a distribution to the data using any number of numerical methods.

One could also use the Arcsine law I mentioned earlier to compute the skew in the distribution. ;)

Quote from Mike805:

The link below will shed some light on this for you as well:

http://en.wikipedia.org/wiki/Secretary_problem

What we're looking at is a trivial case of the above problem.

I would also look at the Monty Hall paradox. :)

Ninna
 
Quote from TigerBalm:

Mike805, gotcha, thanks. The mathematics is way over my head. Here's a nice American Scientist article on optimal stopping that I had coincidentally saved for later reading.

http://www.americanscientist.org/issues/feature/knowing-when-to-stop/1

Edit : So yes, you were right, and this is certainly a "very neat property"! I believe this is a.k.a. the "Pick the largest number" puzzle. Man, isn't mathematics awesome. Now, if I only understood it!!

I read this article and my head just asploded.

I have been playing around with hairbrained schemes in NinjaTrader; 37% success kept coming up (and when choosing the opposite direction, 63%) as the number of profitable trades in various strategies. I thought I was seeing a rounding error from one third (or two-thirds) because that somehow seems more natural. Now I know there really is some magic surrounding 37%.

Got any more equally brain warping articles?
 
Back
Top