Wonsy Profile picture
Jan 19, 2023 20 tweets 5 min read Read on X
#EA Due to recent interest increase in EA, just a few words of "how to optimize it" / "avoid traps with stunning (but useless) curves" on MT4 (...MT5 is quite the same).
We'll talk about spread, slippage, stops, trailings, expected payoff, profit factor, and how to use them.
First, keep in mind demo is [really] different from live due to technical limitations.
Demo is filled instantly, no matter if price quoted at that price. Not live.
If price smash your level/stop, without quote, you'll have slippage, the main enemy of scalp EA.
That means that ...
... you have to keep in mind that your entry may change on live. Same for your stop, and 9 times out of 10, it's not in your favor.
Same idea : spread is fixed on backtests. Not on live.
What does that change ? Everything.
Let's say your EA takes 1 or 2 pips per trade ...
but you have a 0.1/0.3 (more than 10% of your TP !) average slippage on live, it will thrive on demo, providing an exceptional curve, but fail completely on live.
Same for spread : your EA use extra tiny 1 pip stop loss ? If your live do a "spread bump", you'll fail. Not on demo.
That's why you'll see a hell lot of EA which seems wonderful on paper account, but fail & are useless on live. It's not the same environment.
And you go against it : if there's no quote, there's no quote, you can't invent price, same for spread/stops.
How to bypass it ? "Easy".
EA which does scalp are 99% doomed due to theses live conditions, aiming for "small scraps 1 pip*700 times per day", which... doesn't work, obviously.
Because TP/SL are too small and subject to variations of market, missing ticks on your data history, varying spread, so on.
Said in another manner : if you TP is 60 pips, and your SL 20 pips, you don't care if you enter 0.1, 0.2, even 1 pip away from wanted price, that's 1.6% of your TP.
If your TP is 2 pips, 1 pip away is 50% of your target.
Small variation from "perfect world" will impact hugely.
Good news : you'll have a STUNNING curve on your backtest.
Bad news : it's useless, but pretty.
Enter profit factor/expected payoff.
First of all : when optimizing, *DISABLE MONEY MANAGEMENT*. Seriously.
If your EA use X%'s account, and make some wins, % will change.Results too.
That means you will compare "unequal parameters".
How can you compare expected profit/trade if lotsize are not the same between two runs ?
Expected payoff (EP) is dependant from lotsize used, obviously. It's "how much can you expect if you take a trade", statistically speaking.
You can see two runs here, exact same parameters optimized, different EP. One use dynamic size, the other don't.
As EP is dependant from size, you have to make it "relative" : if my EP is 10$, but I trade 1 lot, that mean I can expect ... 1 pip. Woot. Not great : see above. ImageImage
That doesn't mean my TP is 10$. That means, on average, given all win & loss, my expected profit will be 10$.
If I trade 0.01 lot, it's excellent. If I trade 1 lot, it's terrible. But I need static sizes to compare runs.
What to aim ? Well, biggest EP possible.
The higher the EP *relative to size*, the less it will be impacted by live conditions like slippage or spread bump.
Make sense : high EP means a trade get "more pips" on average => less volatility impact.
Now, profit factor. Easy : profits divided by losses.
Rule of thumb : aim for higher than 2. That means you'll earn 2x your losses.
You can get huge profits, with terrible profit factor. That means you give back almost everything you get.
... but that will points you in a possible optimization point. Usually linked to Win %.
Let's say I trade 0.5 lots, EA come back with 2400 profit, 300 trades, profit factor of 1.78. I earned 5470, gave back 3100. Nice, but not "great".
But, that also means I *could* get 5400 of raw profits, if I can filter false trades... which would increase my expected payoff..
Once again, aim for biggest profit factor, obviously.
The whole thing is they are interdependant if you want a "likely working on live EA".
For each optimization run, you can't just take highest profit or highest PF or highest EP.
You need to check which trades were made, why...
Something you need to check is globally : "how weak am I with this strategy against market unexpected moves & variations" ?
If you have a 1 pip SL, 1 pip trailing stop, 2 pip TP, it's not going to end well.
Overall, I tend to prefer "coherent stuff" over "ultra uber profit".
I usually look for the best combination above the 3 : profit, PF, EP. And, sadly, it's usually not the max profit.
One last thing : by filtering false signal, you [will] filter true signals too. Lowering profits. Increasing PF/EP. Rinse, repeat...
To end this : do not look for "ultra high speed mega duper EA taking 2K trades a day with max profits only 4999$ now", they just won't work.
Look for something that look sensible to you : how many trades a day ? Which risk ? Do you prefer smaller TP (but "safer" ?) or larger ?
If something looks odd or dumb in a global perspective, it probably is.
This is way longer than I expected, and there's a ton of stuff left to said, maybe another time.
Anyway : have a good day everyone, wish you green pips :)
( Note to myself : next time, talk about parameter impact's linearity. )

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Wonsy

Wonsy Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(