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 robots are the best and what are the best ways to use them? Under what conditions do these forex robots work? Why most commercial forex 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.

After exactly one year of testing and tweaking, my quest is finally over, I have come up with a new approach to forex.

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

UPDATE: 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 (see my one year live test here). 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 VPS unfortunately crashed completely , until I figure out how to fix it, this is the reference account:

How does it 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 2 or 3 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.

I have backtested the robot from 2009 to 2015, 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), USDJPY (M30). Virtually all pairs are supported, but I will only provide settings for majors. For now.

It has a solid recovery function, the lot gets increased after 2 or 3 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 frequent trader, you won’t get bored watching it, I can guarantee you that. :)

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 robot is optimized from 2000 to 2015 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 2015 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 2015. 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 2015. If the drawdown length, drawdown depth and number of consecutive losses remains the same, then the strategy is valid. This is our main assumption.

Recovery function

Starting from the assumption that the backtests are valid and the number of consecutive losses always remains the same, the recovery function is built this way:

Stop loss = 40 pips, Take profit = 60 pips, Stop Loss is always higher than Take Profit. The bayesian filters are trained to select only those trades.

First lost trade – lot = 0.1, 40 pips lost
Second lost trade – lot = 0.1, 40 pips lost
Third lost trade – lot = 0.1, 40 pips lost
4th lost trade – lot = 0.2, 40 pips lost (x2)
5th lost trade – lot = 0.4, 40 pips lost (x4)
6th lost trade – lot = 0.6, 40 pips lost (x6)
7th lost trade – lot = 1.2, 40 pips lost (x12)
8th won trade – lot = 2, 60 pips won – everything is recovered + 120 pips

If the starting lot is 0.1, then the lot succession is: 0.1, 0.1, 0.1, 0.2, 0.4, 0.6, 1.2, 2. If the losing streak continues, the robot has to be stopped and reoptimized because the pattern is invalidated. For EURUSD, USDJPY and AUDUSD, the number of consecutive losses is 7. If the 8th trade is also lost, the the robot should be stopped.  After the loss of 7 trades, in order to keep your account safe, just use the controller to set the lot size to 1.8 instead of 2. This way, if the 8th trade is also lost, the damages to your account are not so bad, you only lose 22% of your account.

For GBPUSD, the number of consecutive losses is 6, therefore the lot succession is a bit different: 0.1, 0.1, 0.2, 0.4, 0.8, 0.12, 1

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. :)


AUDUSD – H1 Timeframe

Settings: lot=0.1; Slippage=2; bayes_MAGIC=1111; recovery_step=3; recovery_factor=2; sl=34; tp=43;




EURUSD – H1 Timeframe

Settings: lot=0.1; Slippage=2; bayes_MAGIC=2222; recovery_step=3; recovery_factor=2; sl=40; tp=61;




GBPUSD – H1 Timeframe

Settings: lot=0.1; Slippage=2; bayes_MAGIC=23456; recovery_step=2; recovery_factor=2; sl=40; tp=45;




USDJPY – M30 Timeframe

Settings: lot=0.1; Slippage=2; bayes_MAGIC=23456; recovery_step=3; recovery_factor=2; sl=38; tp=52;





Zamolxis Trading System- all Currencies

Zamolxis Trading System- all Currencies

Extra account protection

I have created an additional robot called controller which takes care of my portfolio. The risk increases if more than one trade is open at the same time. The maximum number of open trades is 4, one for each currency.

Zamolxis controller is highly customizable and gives you complete control over your portfolio. For example, suppose that your current balance is up by 20% and you have 4 open trades. There is no point in risking too much, so you could tell the controller to close them all for x pips win or y pips loss.

The controller is currently running on my account, that’s why some trades were closed sooner then they should have been.


When I designed this system I have the following 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 37 days, but in real life trading I’m sure that it will be extended to 2-3 months. Ok, so no more than 3 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 35% 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 35% drawdown.

– I have to know exactly when the strategy becomes invalid and when the robot should be retrained. Considering the fact that the robot was tested against unseen data and the number of consecutive losses remained the same, here is the limit: 7 consecutive losses for GBPUSD and 8 consecutive losses for other pairs. If this limit is reached, the robot should be stopped and retrained.

Zamolxis 2.0 – Multi currency trading enabled!

The update has just been launched and is available to subscribers since 08.07.2015 and it comes with a neat feature which further decreases the risk!

If the last 10 trades are profitable, and the profit is more than 150 pips, there is no point in increasing the lot size for one pair even if 3 trades in a row were lost for that pair.

TODO list

– more pairs should be added, including metals
– the bayesian filters and neural network architecture may suffer some changes if further tests show that there is room for improvement
– the controller also is going to be updated when necessary.- more strategies should be added to the system if all profitability tests will be passed

All my subscribers won’t have to pay extra for these changes and improvement. I will only charge a small yearly support fee ($69) and that’s it, no more upsells!

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.