The Most Profitable Trading Pattern You Will Ever Encounter

Thanks for your kind words on this. To clarify however, the Kelly Formulas (as derived, I believe, by Thorp) are applicable to binary outcomes, and satisfy the Kelly Criterion (when the most you can lose is what you put up), but the Kelly Criterion itself is applicable to where there is two or more outcomes.

The failing of the Kelly Criterion is that it uses “returns,” and returns are, de facto, relative to something, absent which, we have nothing but an abstraction. Thus, we see the Kelly Criterion bandied about in the gaming community, where you wager an amount and it is the (maximum) amount you lose. (Yet, in many gaming situations, you can lose more than you put up, blackjack being a prime example with certain rules – so even the gaming community mistakenly applied the Kelly Criterion in the state where it as a mere abstraction).

The problem I faced, in trading, is that what you can lose is not ust what you put up (margin, or, say, the price of a stock when you bought it). Instead, we have short sales, spread trades, forex trades, there are derivatives (e.g. volatility) whose zero-bound is not ever experienced. The Kelly Criterion is not directly applicable to trading (and there are other situations, where, if we play devils advocate and seek to diminish geometric growth, such as reduction of aggregate federal debt) where the abstraction had to be brought to life. Optimal f seeks to do this by scaling the possible outcomes, thus making the "returns"used as input to the Kelly Criterion relative to something. In truth, I would stay away from Kelly’s original formula, in too many situations it will lead you into trouble, and always scale, using the Optimal f formula to, in effect, solve for the Kelly Criterion.

Here’s the other problem – solving for the Kelly Criterion gives you the asymptotic growth optimal fraction to risk. That is, it yields the growth optimal fraction only as the number of trades or periods approach infinity.

By way of an example, suppose you have a system that will profit 51% of the time, and lose the other 49% of the time. Let’s keep it very simple and say that what is the amount you expect to profit by is inverse of the same amount you would expect to lose by. In our case, we are only going to be allowed to make one trade, then we can never trade again.

We calculate the expected growth optimal fraction in this case to be 2%. However, that 2% is if we were to make ever-repeated plays under these possible outcomes. In actuality, we maximize our expected geometric growth if we quit a positive expectation game at one play by risking 100% of our stake. If we quite at 2 plays, the expected growth optimal fraction will be at somewhere between 100% and 2%, and will keep diminishing approaching 2% as the number of plays approaches infinity.

So the Kelly Criterion solution is never the expected growth optimal solution, but rather only its asymptotic value, and absent being made relative to something, it is a mere abstraction at that and one that can lead you into lots of over-exposure situations.

The math for all of this is on my website, which is my name dot com, and on the “Optimal f” tab at the top. I’m not trying to hustle anything here, just trying to contribute to the conversation with like-minded guys. Thanks, Ralph Vince

Ok hold on there champ :smiley:

  1. The optimal f number was revised to 0.22. The biggest loss was revised to $2127.
  2. I’m sure you have done your calculations correctly. However you need to note that the results are in mini lots. So if you divided the balance by $f and got 3.79. That is 0.379 lots. It is better to state it as 3.79 due to point 3 of this post.
  3. Once you have the lot size. You multiply profit/loss by the lotsize and that’s your profit in dollars. You then add that profit to your previous balance and that’s your current balance.

So using your previous example, you lost 278.6 pips. 278.6*3.79= $1055.894
So 10000-1055.894= $8944.106.

By the way this is still a big loss and this is what you will get with optimal f. It has WILD equity volatility. Yet it is the mathematically correct amount to bet. The idea is the system you trade makes more winners than losers and the value of those winners are bigger than the losers so you will go on to make up the amount lost.

But its not something for everyone, it is scary.

  1. The optimal f number was revised to 0.22. The biggest loss was revised to $2127.

Noted.

  1. I’m sure you have done your calculations correctly. However you need to note that the results are in mini lots. So if you divided the balance by $f and got 3.79. That is 0.379 lots. It is better to state it as 3.79 due to point 3 of this post.

Ok, that explains a lot. Quite a difference between 3.7 lots vs/ 0.37 lots.


I was applying this to my stats on a new account opened recently and initially the optimalf gave me a 1.2 lot which felt out of the ordinary.

So it should be 0.12 (or round it to 0.1 lot then).

Also, do you think it would be a good method to run these numbers on a monthly basis which could give the lot size to trade for the month ahead?

On the topic of money management, is there some method/formula that can be used to run the numbers on a monthly basis which could determine what the future trade size should be? This way it could be a very dynamic thing to do as the biggest loss in the more recent month is accounted for in the next month’s risk factor.

With all those backtesting results posted here having red numbers, does that mean the system itself is not profitable? Or did I misinterpret something?

Accounting for the worst loss in the previous month would end up in disaster. As I said earlier, the optimal f fraction (in our case 0.22) is basically the % of your balance you will encounter if you face that worst loss again. So you certainly don’t want that to be last month’s worst loss!. In other words, you will lose 22% of your balance if you lose 2127 pips again.

What you can do is update the value of optimal f every month. I do it after every trade. Let me know if this is something you want to do and I’ll show you how to calculate it. (Heads up: it is very grueling)

Yes, that would be great addition to have. Do you do it manually or is it in excel?

I’ll tell you how to do it on Excel. This is the easiest way I know.

Column A: Balance (is $10000 for example)

Column B: Worst Trade

Column C: Optimal f

Column D: $f (=Column B/Column C)

Column E: Lot Size (=Column A/Column D)

Column F: profit and loss in pips.

Now, you try all optimal f values from 0.01 all the way to 1. The fraction that yielded the highest ending balance is the optimal f. You will notice that the end balance will keep increasing as you increase the optimal f value. Until one time the end balance will decrease after you increase the optimal f value. This means that you have reached optimal f.

Clear?

Ok I get it that investing and speculating are two different activities or different ways of making money. But you are not saying that Buffets risk of ruin has a probability of 0%, are you? All you’re saying is that both activities carry this risk it’s just in your opinion that investing has less of a risk of ruin than speculating. Is that right?

Have spent the last few days catching up on this thread, and have to say that it’s looking really good so far. Well done Phillip for catching such a great signal. Will be interested to see what the EA comes out with on back testing once completed and working with the correct parameters. I have been messing around with some other ideas on the entry signal as well, hoping to get something similar working on one hour charts during the London session. Haven’t had time for a full back test yet, but some of the visual checks are looking promising.

Anyway, I posted the following in the HipChat, but thought I would post it here as well, as I have seen other people have problems with the Stochastic indicator in FXCM/Marketscope…

[B]For anyone having difficulty with FXCM Stochastic indicator…[/B]

  1. Open C:\Program Files (x86)\Candleworks\FXTS2\indicators\Standard in explorer
  2. open Stochastic.lua in notepad (or any other text editor)
  3. Lines 14, 15 and 16 should be the following…

indicator.parameters:addInteger(“K”, resources:get(“param_K_name”), resources:get(“param_K_description”), 5, 2, 1000);
indicator.parameters:addInteger(“SD”, resources:get(“param_SD_name”), resources:get(“param_SD_description”), 3, 2, 1000);
indicator.parameters:addInteger(“D”, resources:get(“param_D_name”), resources:get(“param_D_description”), 3, 2, 1000);

  1. Where the number 2 is on those lines, replace with a 1 (so they should read…

indicator.parameters:addInteger(“K”, resources:get(“param_K_name”), resources:get(“param_K_description”), 5, 1, 1000);
indicator.parameters:addInteger(“SD”, resources:get(“param_SD_name”), resources:get(“param_SD_description”), 3, 1, 1000);
indicator.parameters:addInteger(“D”, resources:get(“param_D_name”), resources:get(“param_D_description”), 3, 1, 1000);

  1. reload FXCM tradestation, and add the indicator in the usual way, it will now allow you to use 14, 3, 1 as the parameters.

Well I’m honored to have you contribute to my thread Mr. Vince. At first I was doubtful it could be you but the writing style confirms it to an extent. The formula you present in the recommended paper is something I will look to incorporate in my project. I just need to read a number of times to fully grasp it.

There is one thing I hope you could answer me Mr. Vince. You discuss in the article how that Kelly or even its optimal fraction is just an asymptotic value; in other words optimal f is an elusive fraction since you can never reach infinity.

However, if optimal f is 1, we can no longer argue its asymptotic, this is something you referred to in my post. So wouldn’t be wiser then based on that to manage a smaller portfolio and “over expose” it with optimal f rather than risk small amounts on a big equity?

For example if my current optimal f is 0.1 and I plan to invest $10,000. Isn’t trading $1,000 at an optimal f 1 a viable option? So rather than focusing on perfecting lot size, it is actually perfecting the equity size that matters to the trader?

Because no matter what happens optimal f can never exceed 1. This means the trader can face his worst loss (in our example) 10 times before losing out, which would be an extremely unlikely scenario given he is trading a positive expectancy scenario. On the other side he is growing that $1,000 at the fastest rate possible without worrying about the possibility that his optimal f is less than its actual value.

Wow. Looks like its been a lot of work. So the conclusion is use of RSI filter and divergence still resulted a net loss of -126.526.80 ? Am I on the right page ?

Not entirely.

Divergence was never considered in the tests. The RSI was mostly used as a filter to pick the best trending pairs. RSI monthly above 66.6 or below 33.3

  1. Only thing clear so far is that there has to be 100 iterations for the losing trade, from 0.01 - 1
  2. Balance remains the same yes? (i.e: current balance)
  3. Worst trade: Would that be in pips or in $ value? (i’m assuming pips, from what I understand so far)
  4. Column F: What do you mean by P/L in pips? (is it lot size determined * worst trade in pips [columnB]+Balance[ColumnA]?)

Example:
Balance is $1000
Worst trade so far is 244pips

*Sorry for being dumb: Probability is not my forte

You are referring to the Gross Loss line item from Losing and BE Trades only. There was a Gross Profit of 140,122.00 from Winning Trades, for an overall positive Net Profit of 13,595.20. This was w/o any real serious money mgmt techniques (I crudely applied 10% balance allocation per trade), and with ONLY Monthly RSI filter applied. Any sort of divergence filter was not applied to my posted simulation. It should be noted (and I didn’t specifiy this), that an RSI Filter of 70/30 had a negligent overall effect on the results, and simulations run without any sort of RSI filtering and any simulations run with Initial Stop Losses set (using recent Swing Hi/Swing Lo) had worse overall net results, than what was posted.

Also account for the fact that all ccy’s were denoted in $ values… While its ok for crosses like EURAUD, NZDCAD etc allowing for a few cents of deviation; for JPY pairs the difference would be lot more

Yes, very good point. Unfortunately, a limitation of the test tool - no native support for FX.

P.S. I will need to review your divergence posts again, and see how I can implement this as a further filter. To automate this I’m guessing that I will have to take an arbitrary price point “N” bars in the past and compare it to current price, and do the same for Stochastics, and then look for divergence between the 2.

Well in terms of pips, the system for 11 years and 27 pairs produced 9,000 pips of profit without money management.

You do not get to choose your what your worst trade is. Your worst trade of this system is 2127 pips. Your optimal f is 0.22. So your $f will be 2127/0.22= $9668.

So your lot size is balance/$f.

So if its 10,000/9668 1.0343. Or just 0.1 lots.

You enter a trade with 0.1 lots lets say you win a 100 pips. You type 100 in column f.
Then your new balance is (Column F*Column E)+old balance (which is 1000).
In this case the answer will be 10100.

Clear?

Philip,
Cases where f == 1 (or, more precisely, where f >= 1) are as follows (it’s pretty simple, though I had a hard time wrapping my head around it for a long time).

First, in the non-asymptotic case (which is the actual optimal value for f, which is always a function of horizon), with a positive expectation, where the horizon is one play, the fraction that maximizes the expected growth is (rather obviously) 1.0.

In the asymptotic case, this only occurs for a one-component portfolio if there is no chance of loss. In the more terrestrial cases where this is at least some chance of loss and individual component’s f value is always < 1, but what I call “Sigma f,” the sum of the f values of all the components (which represents the immediate worst-case drawdown if all individual worst-cases occur simultaneously) will :

Asymptote out at 1.0 as the number of components increases

-unless-

there is one or more components with perfect negative correlation to one or more components, in which case the asymptotic f (as well as the optimal f value for a finite number of plays) is infinite (as there is never a losing period in the aggregate).

This last case is risk-less, i.e. with no chance of loss. So we can say that whenever there is no chance of loss, the f that is expected growth optimal is infinitely high (i.e. we should risk all we can on the proposition to be expected growth optimal, for anywhere from one to an infinite number of trials.

The only other times we see an f value (for one components) or Sigma f (for multiple components) equal to 1 is when we are in a positive expectation with a horizon of 1, or we increase the number of components and approach an f value of 1. These cases DO have risk, and with f (or Sigma f) at or near 1, it is these cases where, to achieve expected geometric growth, we are exposed to near total loss should worst-case manifest, and these particular cases where I suspect your question is germane to.

Here’s the problem, and also evident in my (long-winded) answer here: the solution to expected growth optimality is without respect to risk. Any dilution of this, is a deviation (and diminishment) of expected growth optimality.

Which is where all of this goes down the rabbit hole, and where some new, and what I regard as beautiful answers, some useful applications of all of this emerge.

We are looking so far at expected growth without regard to risk as our criterion for “optimality.” Is that really what we want to pursue?

Generally, we pursue expected growth with respect to some sort of risk measure. Even sports or table-game gamblers generally aren’t pure, expected-growth without regard to risk optimizers.

On the very curve between 0 and 1.0 where the peak (the expected growth optimal maximizing f value) there are other points which are “optimal,” with respect to the trader or gambler’s criteria. For example, there is an inflection point, between 0 and the peak, where the marginal increase in expected growth with respect to marginal increase in risk, is maximized, where this curve goes from concave up to concave down.

Perhaps that is,for many, their optimal point. It IS a point of geometric significance.

Another one which Dr Zhu and I were working on along with the inflection point is the point that maximizes expected growth to expected risk, which would be that point on the curve that is tangent to a line drawn from f=0 , tangent to the expected growth optimal curve. This point is greater than the inflection point, but also less than the expected growth optimal peak.

When more than one component is involved, we have a surface, and these points now are manifolds upon this surface.

And one’s criteria may not involve a single point on this surface, but a moving about the surface with respect to time or equity changes or some other input or feedback. In other words, we end up with a framework for satisfying whatever criterion we seek to satisfy by utilizing the important geometric points, and perhaps moving about them, upon this surface.

I know this is a little more than you asked for. However, in the context of your question, it is evident that expected growth optimality without concern for risk may not, and most likely is not, YOUR criterion here, and before one can decide upon a money management / allocation strategy, a criterion must be articulated.

Again, I’m not trying to hustle anything, not trying to be obtuse either. I’ve spent most of my life studying this and I don;t know everything about it, I’ve only scratched upon the surface. If you are interested in morof this I suggest the paper with co-authored with de Prado and Zhu, which is available freely for download on the home page of my website.

Just a quick follow-up question. Will columns B (maximum loss), C (optimal f), and D ($f) always remain the same in these calculations assuming we don’t suffer a loss greater than 2127 pips at some point?