Silly Math

Fair enough - I’ll certainly plead guilty to having a mathematical/statistical approach and acknowledge that not everyone does (although I believe, myself, that almost everyone [I]profitable in the long term[/I] does - whether they actually call it that or not).

I’d say they all do. All the serious ones, anyway? As far as I know?

We might disagree there: I don’t believe there are [B][U]any[/U][/B] long-term profitable ones that [U]increase[/U] the position-sizes when [U]losing[/U]!

If you can show me one, then I’ll happily and openly admit to being mistaken … but really, that would make [I]no[/I] sense, at all, so please excuse my mentioning that I’m not exactly holding my breath. :wink:

With apologies, you lost me, there. Either the system/method has an overall edge at level stakes or it doesn’t. If it doesn’t, you can’t import one into it by increasing the position-size during a losing run. This is simply factual. It’s objective and mathematically provable. However complicated the method is, one has to test it and know confidently that it has an edge - nobody should be trading with real money (non-demo) a system that doesn’t have a proven edge? But if it does, then its appropriate position-sizing can be worked out fairly easily?

The “gambler’s fallacy” has absolutely nothing to do with Markov chains at all.

An understanding of Markov chains is [I][U]not[/U][/I] needed to work out whether a system has an edge or to derive its appropriate position-sizing according to one’s own risk comfort-level/aversion-level.

I wish you well with it.

Thank you for your reply. And I don’t mean to be rude but doing basic math to determine net expectation on a trading system is not what i would consider having a “mathematical/statistical approach” that is just common sense computing that forms a basic part of building any trading approach.

And no not trading philosophy either unfortunately. There are hundreds and thousands of funds and investors with different approaches “Philosophies” to trading e.g. George Soros only takes short positions and has built his career around that unique approach, for whatever reason he decided upon it in the first place; in which case you could go to him with the most brilliant long trading idea and he would decline because it was not in line with the philosophy of his fund.

You seem to come with the impression that there is one way to trade, your way and that everybody else is stupid.

Position sizing losing trades if you read my earlier comment is not a good idea, because you’re doubling down on a strategy not appropriate for the market conditions; wrong headed, that is the whole point of randomizing the process and even that doesn’t give you complete independence as I have noticed a cluster of fails around particular periods - so what is the level of independence and how can you build that into your calculations and the model: complexity.

Apples and oranges. You simply can’t see beyond your own style of trading. And gamblers fallacy can absolutely fit within the framework of a markov chain stochastic process (and I was trying to be kind to your other reply also in giving that any weight). Thank you for lecturing the Actuarial Science major on basic stochastic processes.

Thanks for the wishes of luck in investigating a new trading technique. We’ll see how it goes.

I could really use your help. Based on the information I have provided so far, would you be able to tell me what the basic net expectations are as a starting point, for clarity:

65 trading days
10 ~ 13 currency pairs (say 13 )
2 % average blowout rate if selecting a day and pair at random
1:20 reward risk

if you need any more data i’ll provide it

Not easy to forsee that someone asking about a Martingale-based system is going to be an Actuarial Science major, but we live and learn. For the record, I apologise for not knowing and/or misreading your mathematical awareness level. I have Asperger’s syndrome and am probably [I]particularly[/I] poor at estimating things like that (and other stuff, too) about people, from what they post; sorry.

I struggled to offer it (and stay tactful) here, here, here, here, and here, and in several other threads, too … but you dismissed some of it with observations like “That’s silly”.

I won’t dignify that one with a reply.

Sorry - evidently we don’t really speak the same language, and I think you’ll get more useful help from someone who does. You’re obviously way out of my league. :8:

I wrote a Martingale simulator. The odds are the odds. Using incremental increases on the next position will tune you more quickly to the odds. Not using incremental increases causes a distortion in the gain of the account. You can see the difference in the two pics…


The first pic uses a 10 level 125% increase… for 5000 rounds

The second turns off the increases so your next bet is 1.00 and you can see the wave in the gain of the account, but the odds are still the odds.


Anyone who wants to play with the simulator email me I can send it to you.

I didn’t mean to lash out at you, thank you for the opinion, it is what i asked for, it is just a raw idea and may prove not to have any legs.

My system survived long periods in testing up to 2 years making good profit But I couldnt find a way to get out of the last trade with a profit.

I found this article about the subject:

Statistical Verification of the Labouchere Money Management System - MQL4 Articles

I didn’t have time to read it but maybe you find some answers

Thanks for the feedback, I read through the article and the research was very informative and provides a good format for doing my own more thoroughly. The results he mentioned are largely what I have noticed on my strategy tests, although the Expected Value varies quite substantially depending on currency pair and the number of levels you choose.

USDCHF is the best so far. It has the lowest blowout prob, highest and consistently positive EV with multiple 10k test simulations in excel.

  • 65 day test run
  • 1% profit target per day = 1 successful trade
  • 30% Average strike rate = Ave. 4 trades per day

I can blow out zero, once, twice or three times and still remain profitable at the end of the 65 day period with 65%, 44%, 23% and 2% return respectively (where a blowout = 20% loss). The probability of that happening from the Excel simulation is roughly 95% so far. assuming no computing errors.

Anyway I’m inpatient so started testing it real time in the demo and the results so far is 8% return in 6 active trading days.

The only problem is the inevitable blowout, and managing the risk around that event.

  • How can I identify when it is coming and get out at lower losses
  • What market types are most suitable for the program to run smoothly etc…

I like the idea of using the system because 98% of the time i can comfortably trade each day hassle free and be sure to achieve circa 1% return (the blowout rate is a 20% loss). I would like to see how I could hybridize this to play a more active role in managing the risk when the 2% events occur.

From the anecdotal evidence avoiding high volatility periods including the news release on USD & CHF and ranging markets with a low ATR seem to improve the odds further (higher EV) but I haven’t researched it extensively enough to formalize a trading plan around that.

Why do you test in excel and not on MT4? You can also live trade on a demo.

How is your system performing without the martingale? Does it have an edge? Did you consider to scale in on a winning position like reverse martingale?

Thanks for the post. It has positive EV for USDCHF without a martingale, but mostly negative with other pairs. I used excel to replicate the conditions when I was trying to work out/improve the probabilities.

I haven’t tried a reverse martingale yet no, but I have introduce a trailing stop which disproportionately cut out down my losing positions and increased my overall strike rate to circa 45% (from 30%) the net effect of this on MT4 strategy test was to increase the time to blowout to roughly 2000 trades (13 steps) across all currency pairs.

Brief update.

Three options to improve the EA to achieve +ve on all pairs.

1 - Improve the strike rate to be consistently above the equilibrium value of 28.57%

2 - Improve the probability of wining after having lost in some way

3 - Make the transitions through the levels up and down so I increase and decrease the risk according to the performance of each trade e.g. go from level 5 back down to level 3 before continuing.

Possible Solutions:

1 - (Indicators): Indicators are generally useless when trying to identify entry and exit points on the price action because they simply confirm or re-organise and represent what is happening in the price action.

However, they can add some value in the EA for telling me what is happening in the performance of the EA, information That I would otherwise not have access to. Example, if I place multiple sequential random trades and take the average strike rate in the last 20 trades as equivalent to the current currency price; I would be able to monitor the relative strike rate performance.

With a binary set of -1 (lose) and +1 (wins) trading data from randomly generated trades I can use that information to work out the strike rate over the last 20 trades and feed that information into the formula for a Stochastic Oscillator to give me the equivalent of buy signal (Price Action to Performance) get in/Switch On or sell signal (Price Action to Performance) go short/Switch Off.

Preliminary tests have benn feedback: recording 4000 random trade outcomes on USDCHF as (-1,1), using this approach I have been able to consistently select buy/good periods (average 50% strike rate) and sell/bad periods (average 10% strike rate).

Still more work to be done but i’m sure this will work. I would subsequently be able to run the EA on multiple pairs simultaneously (trade 0.01 lot size and record/no martingale) and cream off the good periods on each to switch on the EA at the normal lotsize and with a martingale.

2 - Reduce TP distance: the martingale currently tries to recover all losses on the previous trades whilst making the equivalent profit of one successful trade at level one. The reason for the circa 28% strike rate is because the RR is configured at 1:2.5, if my RR was 1:1 my strike rate would be roughly 50% and so if I reduce the TP:SL ratio moving up the levels the probability of wining on each level increases marginally. I would have to find a way to gradually reduce the TP effectively which might even mean ultimately losing something at the final level i.e. a 10 level martingale where winning at the last level doesn’t quite recover all my previous losses.

I’m not so sure about this one, but will look at it further.

3 - Taking advantage of marginal victories (Trailing stop): the first version of the EA provided a binary win lose outcome. Among the losing trades however there were many occasions when the trade went substantially into profit before reversing to close me out at a loss.

I repeated the trades above but also decided to record the highest +ve PnL on each one to see if a trailing stop would give me any advantages. The results were quite favorable and I noticed that i introducing a trailing stop would disproportionately reduce my losing trades more than my winning ones.

I tried a simple event @ when PnL = Risk i.e RR 1:1 bring the stop loss to breakeven and this improved the EA massively. The strike rate Increased to 48% on each run in the strategy tester (which makes sense since small profits around breakeven count as wins) and increased the time to blowout massively, making GBPUSD & USDJPY & AUDUSD now more consistently profitable over the 6 month period.

What I would like to do is take it further and start trailing from breakeven as a trade moves further into profit. Locking in more profit in this way will have the effect of reducing the accumulated loss at that level (step) so that I can reduce the risk on the next trade to recover the marginally reduced accumulated loss at that level. This has worked anecdotally on the live demo test and I have seen the martingale jump down from level 7 to level 5 due to the marginal profits made on a previous trade.

So believe taking advantage of the marginal favorable moves could help deescalate my risk on the martingale and the prob of hitting the maximum level.

Options 2 & 3 working very well. Consistently make money using a 10 step martingale with circa 1 ~ 2% return per day.

Given that reaching level 10 in this case means a 20% loss. So far have been able to reach 20% return without incident on 13 currency pairs. I don’t think the long run EV has changed much with the manipulation but what is clear is that the expected time to reach level 10 or any other level for that matter has massively increased.

Option 1 turned out to be a false flag. The stochastic Oscillator whilst telling me what was happening, much like on price action has little predictive ability to move me above the equilibrium strike rate as a standalone, but did improve the strike rate marginally.

USDCHF still the best. Working with a 100k account, 10 step martingale max loss on each blowout @ 20%: 7 times out of 10 the account reaches a profit of 300k+ in 8 months. on the other 3 out of ten the account reaches at least 70%+ return before catastrophe.

The other pairs have more modest overall profit expectation and profit before blowout returns. What is clear is that I can comfortably achieve at least 20% return before any major concerns.

The thing to do to create sustainable edge here is to identify the most an least appropriate market conditions for the random trade generation, my guess would be strong trending markets; or ranging markets with a high ATR. the Stochastic Oscillator can be useful here, if I also record market features like volatility, ATR and other typically market type determinants (describers) and superimpose the performance measure of the SO to the identify the most suitable market conditions.

I think a hybridized money and trade management might work best, at least until one can identify sustainable +ve EV market conditions.

started last week with the unfinished EA the results were good. Earlier this week I made some losses, thankfully didn’t hit the max martingale Level but there were some issues with my software which needed to be corrected.

This week have traded 2 days today and yesterday. Today was quite a scare because i got as high as step 9 on a 10 step martingale. But the results were still good with 11.2% return in those 2 days.

4% yesterday, circa 7% today. will test again next week on the non news release days if I have time. Have a lot work to do on the EA and the fundamental approach behind it; to identify +EV trading periods and reduce the likely blowout rate

Maybe i’ve been a little too quick to dismiss the effectiveness of the Stochastic Oscillator on the strike rate.

on an RR of 1:2.5 the equilibrium strike rate is 28.57%, if I can consistently win trades above that rate then +EV is assured and my system has an ‘Edge’.

Taking the strike rate for the last 20 random trades and feeding the data into a Stochastic Oscillator as an indirect ‘Good Market Conditions’ signal. The following trigger seems to have a reasonable effect:

  • %K > %D
  • %K > 20
  • %K < 60
  • %K(1) > %K(0) Current greater than previous

on GBPUSD the strike rate improves from 27.61% to 31.89% and on USDCHF from 28.96% to 32.78%; Marginal improvement but non the less above the equilibrium value.

[B]Layered Stochastic[/B]

If I take the first SO on the strike rate (SO1), it gives me one of two signals (Good,Bad). Now if it gave me Good and the actual trade outcome was a Loss or gave me Bad and the actual trade outcome was a Win I can record this on a second SO (S02) as a Loss, conversely if it gave me Good and trade outcome was a Win or a Bad and the trade outcome was a Loss, I can record this as a Win.

If I use this second win lose data to feed into another stochastic (SO2 of SO1), then I might be able to track the performance of my indicator SO1.

The idea would to only take advice from my indicator SO1 (when it indicates good market conditions), when its predictive ability is also demonstrably more reliable.

SO2 on SO1 with a trigger being:

  • %K>%D
  • %K>20

If I only get in on a trade when SO2 & SO1 converge to both say yes then the strike rate improves to 66.66%. But with a sequence of 5,600 trades on GBPUSD I only got 15 trading signals with 10 Wins and 5 Losses, so i’m not so sure how reliable that improvement is.

I will have to test it among 25 or so pairs to see in the improvement in strike rate is consistent or just an error due to low data. If it proves to be accurate and not a computing or other error than I think in conjuction with a Martingale would form the basis of a good MM tool that could be applied to multiple strategies across multiple pairs to increase the number of trade signals

Results in SO2 on SO1 for 10 pairs Jan 4 2016 to Sept 3 2016

  • GBPUSD - 15 Signals - 66.67% Strike Rate (SR)
  • GBPCHF - 9 Signals - 33.33% SR
  • EURJPY - 24 Signals - 37.50% SR
  • EURCHF - 21 Signals - 28.57% SR
  • EURUSD - 18 Signals - -16.67% SR
  • USDCHF - 36 Signals - 50.00% SR
  • EURGBP - 27 Signals - 44.44% SR
  • AUDUSD - 15 Signals - 40.00% SR
  • USDJPY - 27 Signals - -22.22% SR
  • USDCAD - 42 Signals - 35.71 SR

Trade volume weighted SR is 40.19%

Okay so the last results were promising but I think I’m getting ahead of myself.

I want to find Indicator 1 (I1) that predicts if the market conditions are good for my system for above equilibrium Strike Rate and Indicator 2 that tracks the performance of I1 and lets me know effectively if I should trust its advice. I started I1 & I2 using 2 Stochastic Oscillators and randomly changing the Trigger criteria to see what worked best.

What I really ought to do is record the strike rates and feed that data into the formula for all the trend indicators and oscillators and systematically identify the correlation between the probability of wining the current trade and each variable in the respective indicator or oscillator (for Indicator 1) and similar for I2.

Once I have the correlations I can select variables with the highest impact and feed them into a multiple linear regression model to find how they interact to determine the likely strike rate/Win Rate for the current trade (for Indicator 1).

So for I1 for example I might look at the correlation between the absolute value of the last 20 strike rate (SR) to the probability of winning on the current trade, or the absolute %K reading on a Stochastic Oscillator, %D “…”,%K(1) - %K(0),%K - %D, SR - MAofSR etc…

So I will take 18 currency pairs and break them down as follows:

6 Pairs: Training Set: The data from these pairs will form the basis of the initial correlation model
6 Pairs: Validation Set: I will test and improve the correlation model using this data
6 Pairs: Test Set: Will test the modified model on completely new data to see if the results stick.

The Training Set is:

  • AUDUSD
  • CADCHF
  • EURAUD
  • EURCHF
  • EURGBP
  • EURJPY

Altogether the win lose sequencing gave me circa 51,000 trades to work with, from 4th Jan - 2nd Sept 2016.

Starting the correlation model with the simplest variable - the strike rate (SR) in the last 20.

There were multiple readings for 0% SR in the last 20 but the highest was only 75%, funny how that works in what should be a completely random system; I think it might have something to do with the spread which changes the R:R balance in the distance traveled to win versus the distance traveled to lose.

Y-AXIS (%Wins) || X-AXIS (Last 20 SR): I was expecting a horizontal (0 correlation) line here but the results were surprising; positive correlation, going from 55% SR to 75% SR the probability of wining the current trade was consistently above 30% and sloping up.

Okay so, I should really fit the model properly and then move on to the next variable, but I couldn’t help but write a quick EA to test it.

The EA enters 0.01 Lot trades at random with an R:R 1:2.5 with the recorded outcomes Win, Lose (1,-1). After 20 records start calculating the SR for the last 20 trades, if the 0.55 <= SR < 0.8 then on the current trade increase the Lot Size from 0.01 to 10 Lots (risking 0.71% of account balance per Trade).

Note: I should spread the risk to multiple currency pairs to increase the trade count so that the results tend to the true mean.

Results from 4th Jan - 2nd Sept 2016

USDCHF || 4,495 Trades || -£12,977
GBPUSD || 11,981 Trades || +£41,168
EURUSD || 15,756 Trades || +£41,168 (The same: odd)
USDJPY || 9,743 Trades || +£30,026
USDCAD || 10,147 Trades || +£3,582
AUDUSD || 4,723 Trades || +£10,376
EURGBP || 5,419 Trades || -£14,202
EURAUD || 23,041 Trades (High?) || -£8,332
EURCHF || 4,354 Trades || -£4,349
EURJPY || 12,171 Trades || £32,941

Total = £119,384. Initial account balance was £100,000 (roughly 0.71% risk per trade).

The last 20 SR seems to be a good indicator for future performance to produce a win rate above the equilibrium value for +EV, there are still many other variables to process and I am quite surprised that this appears to work on something as straightforward as that.

(I suppose this could be gamblers fallacy operating in reverse i.e. for a high consecutive win count - and I suppose it does make make sense in common sense terms of getting in when the recent performance is higher)

Should have really recorded the lowest account balance to get a better idea of the downside risk and other stuff, but it was just a quick test to see if the results make any sense in reality; though the absolute draw-down was consistently low and especially tight for the pairs that ultimately lost.

If anybody is interested please help me test the results too just to make sure I haven’t made a computing error somewhere.

Simple 20 SR Random.zip (11.6 KB)

Okay so…

Starting to process the variables a little quicker with VBA excel and so far there are few good indicators for good market conditions for I1, haven’t finished yet and modeled them properly; either independently or together.

Have however run a few quick tests on MT4 for positive encouragement. At some point in the end I will have to find a criteria for discriminating the best variables (and combination) to use in the final Indicator.

The balance will have to be between, correlation p-value and the final multiple model AIC versus the signal rate. The idea is to run the final EA across 25 currency pairs simultaneously, risking somewhere between 1% ~ 2% per trade for a return of 2.5% ~ 5.0% respectively.

Also will have to find a way to simulate the 0.01 lot trades in real time. Because the costs associated with entering 100k’s of those trades over 25 pairs, over the course of a year will be significant (Estimated £20k on £100k account with IC Markets Commission rates - could be wrong on that have to look at it properly).

And I should be careful not to expect the moon or the ‘perfect’ + 20% increase in strike rate with my indicator.

[B]Perspective:[/B]

25 pairs entering 125 Signaled trades each on average per annum

The Equilibrium Strike Rate (SR) on RR 1:2.5 is 28.57%

If I only achieve a modest 2% improvement with my indicator for a trade count weighted average SR of 30.57%

then the results becomes:

125 Trades x 25 Pairs = 3,125 Trades in total for the year.

Of which 30.57% are profitable = 955

and 69.43% are losers = 2,170

PnL for the year @ 1% Risk per trade = (955 * 2.5%) - 2,170 = 217% or circa 18% per Month.

What I will have to look very closely at the draw-down week on week for the year in the upcoming back-testing, when combining 25 pairs in such a way. and obviously test going back multiple years (Maybe 20 or so) repeatedly.

Hopefully I will have all the results soon and can start on the theory and write up.

Quick test in excel of Indicator Last 20 SR on the validation set of currency pairs, based on their binary win/lose date from Jan 4th to September 4th (8 Months)

the pairs are: EURUSD, GBPCHF,GBPUSD, USDCAD,USDCHF, USDJPY

Results are 911 signals 296 Wins 615 Losses; the win rate is: 32.49% = 125% Return in 8 Months @ 1% Risk per trade

to extrapolate for 12 months = (12/8)*125 = 187.5%

to extrapolate to 25 currency pairs = (25/6)*187.5 = 781.25%

Okay so very optimistic looking results there. I think i’ll stick to actual test runs rather than extrapolating.

Just thinking that an RR of 1:1 might be more profitable because of a higher frequency of trades being placed. Will have to test that also.

So far the best combination in terms of +EV on the validation set is:

[B]Switch On When[/B]

Last 20 SR(Current) > 14 SMA of Last 20 SR [B]and[/B]
Last 20 SR(Current) > Last 20 SR(Previous)

or simply; when the Strike Rate is trending up.

Just by sheer volume of signals. The prob of wining is only 30.77% but the signal count is 9,981 over 6 pairs in 8 months.

8 month Return in this case = 768.95%

All very good in theory, but not sure what the drawdown is.