Zamolxis Forex Robot

Are forex robots the holy grail?. Should we use forex robots or should we trade manually? What strategies are the best? How do we determine which forex robot is the best and what are the best ways to use it? Under what conditions do they work? Why most commercial robots fail? Are backtests useless? I’m trying to answer these questions, but keep in mind that I’m not interested in short term high gains. I’m aiming long term consistent profits, between 3-10% every month. Quick profit involves a very high risk, this is one of forex golden rules. 30-40% per year is awesome considering the fact that the bank interest doesn’t exceed 2-5% per year the most.

Long story short: My robot, Zamolxis has made a 128% profit during one year and 6 months period. Which means, ~3,000 pips, an account growth of 4.7% per month. This is near our target. We could have set a different target (higher profits), but high profits come with high risks and we can’t accept that as we’re aiming for long term profits.

Here, at we treat forex as a business. And before we start a business, any business, we need to know when exactly will get back our main investment.

According to investopedia, “The yield is the income return on an investment, such as the interest or dividends received from holding a particular security. The yield is usually expressed as an annual percentage rate based on the investment’s cost, current market value or face value.

For example, suppose we buy a nice house for $3,00,000 and rent it. At the end of the year, we get a nice $21,000 revenue, which gives us an yield of nearly 7% per year. After 14 years of renting, we finally recovered our main investment.

On the other side, forex is a more lucrative business (if treated as a business) because the yield is much higher. Zamolxis has an average yield of 35 – 60% per year, which comes with a risk of 20%. If you want to lower the risk to 2%, the profit is also reduced at 6%. This is comparable to the situation we described above.

For those of you who don’t have the money or time to buy a house and rent it, we propose Zamolxis.

But before diving into details, let’s see how it works.

What exactly a bayesian classifier does and how can this be applied to forex trading?

I have written a very comprehensive article about bayesian filters, everyone can understand it, please check it out here.

In machine learning, Bayes classifiers are a family of simple probabilistic classifiers based on applying Bayes theorem with strong independence assumptions between the features. For example, a winning trade is strongly correlated with certain factors like volatility, pivot points, the difference between previous high and low and so on. My initial approach was to gather as many inputs as I can coming for any forex robots I could find on the market (including the ones I myself created, please see the “My forex robots portfolio” section). The general assumption was that, no matter what strategy the robot uses, (trend, pullback, scalper, countertrend), a winning trade can be statistically identified. For example, trading around support and resistance points has a higher success probability compared to simply trading blind. If you add an extra filter, like volatility, the success probability increases. But the main problem is that the market is dynamic, the trading conditions always changes. Today is a good day for scalping, tomorrow might be a food day for trend followers, next week might be a great week for grid trading. We already know that optimizing the robot is not the answer because we are always one step behind the market.

Tu put it simply, a bayesian filter calculates the probability of success based on several factors like support and resistance points and if the probability is good enough, a trade is being opened. My forex robot, called Zamolxis is a mixture of bayesian filters and perceptrons (sometimes neural network classifiers work better under certain circumstances and this robot uses both).

I have spent an entire year trying to gather as much data as possible in order to feed the neural networks and bayesian filters. Then, I let them learn and classify the market conditions all by themselves, no optimization was performed. It survived in the wild without any optimization or tweaking. The purpose was merely survival and learning, without any kind of trade filtering whatsoever, not the profit. Now, the test is over and it’s time to see the results.
This time, the robot is fully trained and ready to make money.
You can see the results here ( live account).

My own demo forward test here.


How does Zamolxis work?

At first, it was a complete mystery to me why all forex robots fail in spite of such great backtests. The answer is simple: the market changes and it doesn’t always follow past conditions. You have to face many months and years of drawdown before you see the light at the end of the tunnel again. What is my solution to this problem? The approach is different. First of all, I don’t care about the drawdown anymore. The lot gets increased after 3 or more losses and the robot recovers fast, the only thing I care is to keep a lower losing streak, in my case, no more than 7 losses in a row.

This is not martingale, it’s position sizing.

The recovery function has nothing to do with martingale. Martingale involves opening multiple positions while doubling the lot size and keeping them open until the all are closed for a profit or the account gets blown. This is the fastest way to lose the account.

My recovery function doesn’t involve martingale, but position sizing, which is a very different thing. Zamolxis opens one position at a time.

No system is highly profitable on the long run unless it is using some sort of recovery function or position sizing! Zamolxis wins 51% of the trades considering the fact that take profit is always higher than stop loss. It is profitable even without any recovery function but the profit is low. Besides, nobody has the time to wait for years of drawdown, we already know that from our past adventures with forex robots. That’s why I created a realistic recovery function.

I have backtested the robot from 2009 to 2016, saved all winning settings, then backtested it against unseen data, from 2003 to 2009. If the losing streak and drawdown doesn’t change than I considered that setting to be a valid one and discarded the rest. If the losing streak gets higher than 6, the strategy gets invalidated by the market changes and the robot has to be retrained. Please note that this is not the holy grail, there is no such thing, it’s just a trading tool.

At the close of every bar, the market conditions are analyzed and classified with a bayesian filter and a neural network. If the feedback is similar, the robot opens a trade. Take profit is usually higher than stop loss, making the robot more reliable and trustworthy.

It runs on multiple currencies, the supported currencies are: EURUSD (H1), AUDUSD (H1), GBPUSD (H1), EURJPY (H1) and USDJPY (M30).

It has a solid recovery function, the lot gets increased after 3 or more consecutive losses. A very fast recovery is expected.

Sometimes is trades every signal, sometimes it doesn’t. After a more careful analysis I reached the conclusion that sometimes, under certain conditions opening at every signal is a bad thing to do. Why? Suppose we’re talking about a forex robot that opens a trade every time the current candle closes above/bellow a moving average. When a violent trend occurs many trades are being opened and if a more violent reversal occurs then we’re out. It’s wiser to analyze the market conditions before starting to open more than one trade in the same direction for the same strategy.

Is a very (and I mean very!) frequent trader, you won’t get bored watching it. 🙂

Pattern validation

If the market suffers major changes, the pattern is no longer valid and the robot should be retrained in order to learn the new market patterns.

As I said before, it was a complete mystery to me why 99% of forex robots fail in spite of such great backtests. One possible answer to this question is over-optimization/curve fitting. The forex robot is optimized from 2000 to 2016 and only the best looking equity curve is selected. This is terribly wrong because that nice looking equity curve is only an accident that doesn’t repeat so often in real trading! Therefore, as a consequence, the robot fails a few month after the launch.

A second possible answer is that the market changes to some degree and the strategy no longer works until the market changes in our favor again.

My approach is different: Stop loss is smaller than Take Profit and no more than 6-7 losing trades in a row are allowed. The recovery function makes sure that we are in profit all the time.

I trained the robot from 2009 to 2016 and then tested it against unseen data, from 2003 to 2009. If the number of consecutive losses in a row doesn’t change, then the pattern is solid enough.

If the number of allowed losses is exceeded, then the market changed and the robot should be retrained.

How recovery function works?

The way this robot is designed is very important. I need to know if the backtests are valid or not, this is the main problem of all forex robots.

Optimizing the wrong way (99% of forex robot vendors are doing it, intentionally or not)

The robot is optimized for the whole testing period, for example between 2000 and 2016. It selects only the best trades, the equity curve looks nice, everything is fine, then after a few months, it bites the dust. At first, as I stated before it was a complete mystery to me why. Then I realized that the market does not behave according to our backtests, the conditions change and therefore the pattern is broken. The second important thing is that backtesting this way there is no checking procedure! How can we tell if the backtest is valid or not? We can’t!

Optimizing the right way

The robot is optimized using data between 2003 and 2009. Then, the robot is tested against unseen data, between 2009 and 2016. If the drawdown length, drawdown depth and number of consecutive losses remains the same, then the strategy is valid. This is our main assumption.

What is new in the current version v30

1. Trailing stop. We don’t want to lose the profits entirely if the market turns against us, especially when the traded lot size is bigger, therefore the robot has not the ability to decide when the trailling stop should be activated. If the market goes in our favor, we can follow it and win big!

2. Lot increment algorithm has been changed. Suppose the starting lot is 0.1, then the lot increment goes as follows:

USDJPY: 0.1, 0.1, 0.1, 0.2, 0.4, 0.8, 1.2
EURJPY: 0.1, 0.1, 0.1, 0.2, 0.4, 0.6, 1.2, 2.4
AUDUSD: 0.1, 0.1, 0.1, 0.2, 0.4, 0.8, 1.6
EURUSD: 0.1, 0.1, 0.1, 0.2, 0.4, 0.8, 1
GBPUSD: 0.1, 0.1, 0.1, 0.2, 0.6, 0.8, 2.4

If the 7th trade is lost, then the next lot size equals initial lot of 0.1 and the cycle continues. If you lose a 7 trades cycle (which never happened during 10 years of backtests), you lose 20% of your account, which will be recovered in no more than 3-4 months. Awesome, right?

However, thanks to the trailing stop function we added, if the lot size of a trade is 0.1 (the initial lot size) and the profit for that trade is higher than the initial tp, the lot size doesn’t increment even if the next 3 trades are lost. Why? Because we are still in profit overall and we can afford to take one more loss (or more) with lot = 0.1 (initial lot). Now we can win big if the market goes our way and we can take many future losses without the need to increment the lot size.

To put it simple, the lot size rarely increases! And this is a huge step forward because the risk is highly reduced!

3. Multi currency trader without additional controller. If for trades trades we have a profit of pips pips, the lot size doesn’t get incremented. For example, if trades=20 and pips=200, it means that for the last 20 trades (all currencies) we have a total profit of 200 pips. We are satisfied with it and we don’t see the point of increasing the next lot size even if the last trade has ended with a loss.

4. Protection against stop loss hunting. As much as we like to hide the sl and tp levels from brokers, is very unsafe to do it because the market may turn violently against us wiping up the account. sl and tp remains in place, but there is an additional hidden function which does exactly that: if the broker doesn’t close the trade for profit even if tp is in place, the function activates and closes the trade.

5. You can now close the trades manually for loss or profit. You could have done it in the previous version also, but now all bugs have been fixed.

6. The core algorithm has been reoptimized. Neural networks and bayesian filters has been improved, the main purpose is to reduce the risk of ruin.

7. New tp and sl setting feature. In the previous version, the sl and tp levels are not set when opening a trade, the trade is modified right after opening with the desired sl and tp levels. Now you could activate the function which enables you to set tp and sl when opening a trade. A rather useless function you may say, but some clients reported that this is the only way Zamolxis works on their broker, by setting tp and sl when opening a trade, not after.

8. Please welcome to our new pair: EURJPY

If you ask me, I think I succeeded in getting the best out of forex robot trading. This page will serve as inspiration source for many forex robot vendors, but it’s ok. 🙂


Zamolxis v30 USDJPY backtest
Zamolxis v30 GBPUSD backtest
Zamolxis v30 EURUSD backtest
Zamolxis v30 EURJPY backtest
Zamolxis v30 AUDUSD backtest

So, is it more profitable than the previous version v20? Short answer is no, the overall profit is almost the same, but the safety is highly improved, the risk has been greatly reduced. Please take a look at this picture, it’s a comparison between the previous version and the current one:



Let’s take USDJPY for example: Version 2.0 produces a profit of 145.18% and only 1532 pips. Version 3.0 produces a profit of 102.15% and 3410 pips! Which means the version’s 2.0 higher profitability comes from a large number of increased lots which leads to a much larger risk! See the difference?

Let’s see how it trades in the wild, how profits are protected in version 3.0


Thanks to our trailing stop function we added, sometimes, when the market conditions are appropriate, you only risk 8 pips in order to get 82!

Now, take a look at both forward tests. The new version produced 1600 pips within 2 months while the previous one produced 3000 pips within 18 months! The profitability is now focused on individual trades instead of just increasing lots. This is a huge step forward.

Overall profitability, if all pairs are traded in portfolio, is the same! All years are profitable.





When I designed this system I had the followings in mind:

– I don’t have the patience to suffer many years of drawdown (Ok, I’m finally admitting it, I’m not a patient man even if I’m doing all my best to become one). But leaving aside my lack of patience, what’s the point of waiting 2-3 years without even being certain of further recovery? So, I’m not willing to wait for recovery more than 3 months, the most! The portfolio analysis shows a maximum drawdown period of 70 days, but in real life trading I’m sure that it will be extended to 3-4 months. Ok, so no more than 4 months without profit. Please take a look at my former portfolio, for example read this post, the main problem is the drawdown length. Without a nice recovery function, you are doomed to wait for a hypothetical recovery for years.

– Drawdown depth should be no more than 25% of my account, the most! I’m willing to take such a risk if the recovery is fast. Portfolio analysis shows a maximum drawdown of 15% but as I said before, real trading conditions are different and I’m expecting a 25% drawdown.

– I have to know exactly when the strategy becomes invalid and when the robot should be retrained.

Is the profit guaranteed?

No, of course not, aren’t you tired of being scammed? Nobody can guarantee the profit, no one can foresee the future and market changes. All we can do is try our best according to our current knowledge of math, programming and statistics.