Silly Math

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.

Quick test to find the drawdown.

Predictive data was based on tick values from Jan 4th 2016 to Sept 2016 so decided to run the test for 1 year from Jan 5th 2015 to December 30th 2015.

Final result across 10 pairs (Too Lazy to do 25)= +£2,107,723.36.

Switch On When:

Last 20 SR(Current) > 14 SMA of Last 20 SR and
Last 20 SR(Current) > Last 20 SR(Previous)

Jan 5th 2015 to Dec 30th 2015 @ 1% Risk per Switch On trade for £100k account.

Results:

Month on Month drawdown = always positive .i.e positive growth every month.

Problems: the 2 best results were only 25% model quality.

Drawdown Sheet, Raw Strategy Test Data below:

There must be problems here. Tell me where i’ve gone wrong; I must have somewhere.

Drawdown Test.zip (15.1 KB)

Jan 2015 - Dec 2015 Raw strategy test 1.zip (1.12 MB)

Jan 2015 - Dec 2015 Raw strategy test 2.zip (340 KB)

Jan 2015 - Dec 2015 Raw strategy test 3.zip (1.72 MB)

Jan 2015 - Dec 2015 Raw strategy test 4.zip (488 KB)

Rules…

Jan 2015 - Dec 2015 Raw strategy test 5.zip (987 KB)

Simple EA…

Simple Trending Up.zip (14.4 KB)

I took a look at it but it doesn’t make sense It makes trades with 0.01 lot or 24 / 18 lot The difference is so big that all profit loss coming from the big trades and the smaller ones are useless.

I would expect 0.01 lot and then 0.02 , 0.04 , 0.08 etc

I haven’t added the martingale part of it yet. What the EA does is enter random trades of 0.01 lots, then when market conditions are right i.e. when the number of wins in the last 20 0.01 lot trades is trending up.

The EA “Switches On” and increases the lot size to your risk. I think I set it to £1,000 risk working on a 100k account.

I’m working on +EV only first and later i’ll try to put altogether in a Martingale.

Ok so the last explanation was a little bit rubbish so let me try again.

The EA works by entering trades at complete random. The Idea is that on a RR of 1:2.5 the breakeven (Equilibrium) win rate is (1/3.5) or 28.57%, so if I win trades at a higher rate I will be profitable (+EV - ‘Edge’)

If you look at the results from the strategy test the % of profit trades is usually around the equilibrium value - plus or minus a few %. The Idea is that on that journey to the equilibrium value there are periods when the system, even a completely random system is performing better than the equilibrium value, and periods where it is performing worse than the equilibrium value, just because there are market conditions that are more or less suitable respectively.

So what I am trying to do is find a way to predict when the conditions are better for above equilibrium performance; even in a completely random system: those are the ‘Switch On’ moments when the lot size jumps from 0.01 to to your %Risk (I set the default at £1,000 risk per trade on a 7 pip Stop Loss)

The 0.01 lot trades are the way of tracking and measuring performance. Every 0.01 lot trade is converted into a binary (-1,1) Lose Win, depending on the outcome. Then I take the last 20 trade outcomes and create a Strike Rate (SR) from the data.

for example if in the last 20 trades I have 10 Wins (+1) then the strike rate in the last 20 was 50%. With that strike rate data I am now looking for predictive relationships that can tell me when I am entering a ‘Good Period’ and should increase my lot size.

So far I have found that if the strike rate in the last 20 is 55% or higher i.e. 11 wins then the probability of me wining the current trade is higher than the equilibrium value of 28.57%. A quick test across the Validation Set of currency pairs with that simple trigger gave me a win rate of 32.49% with 911 ‘Switch On’ signals across 6 pairs from Jan 2016 to Sept 2016.

It is important that I use as many pairs as possible to increase the sheer volume of trades so that the final result tends to the true mean. For example on EURUSD there were only 36 signals and the percentage (probability) of wins was only 16.67%

Another good signal was a simple difference in the Strike Rate to 14 Simple Moving Average of the Strike Rate. Although the the probability on winning was only 30.77%, the system was more profitable just because of the sheer number of signals: 9,981.

The second EA I posted is based on

[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)

SR = Strike Rate.

or simply, switch on when the strike rate is trending up.

It works best if you use across multiple pairs simultaneously. I checked the drawdown and the combined result for 10 pairs was account balance accretion month on month, some pairs will lose, most will win over and above those losses.

Quick test on SR Trending Up EA with USDCHF Jan 2015 to Dec 2015.

[ul]
[li]
[/li][li]£10,000.00 Initial Account Balance
[/li][li]
[/li][li]£2000 risk per ‘Switch On’ trade
[/li][li]
[/li][li]£250,357.47 Profit for the year
[/li][li]
[/li][li]£3,181.11 Absolute Drawdown[/ul]
[/li]
Made a mistake, initial account balance was supposed to be £100,000.00 but accidentally started with 10,000.00

Test + EA.zip (572 KB)

Safer Signal

[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) [B]and[/B]
14 SMA of Last 20 SR > 0.5

[ul]
[li]Only 60 Signals
[/li][li]Probability of Winning Current Trade= 45%
[/li][/ul]
[B]
Possible use[/B]: Increase risk per trade on the current trade from 1% of account balance to 3% of account balance (or whatever) when these conditions are met.

Ok, so will have to look at that - adjust the risk on each trade according to the perceived probability of winning.