Automated Trading Machine (ATM) makes it simple to remove fear and greed from your trading. Automated trading is no longer just for the rich or nerdy. Our revolutionary software runs on your computer, using your trading rules, but none of your emotions. There's just one requirement - you know how to use a mouse. Learn more...
Troubleshooting
Trading System Common Mistakes
Here are some common mistakes.
Only Entry Rules
| Direction | Rule Type | Rule Family | Line 1 | X / Line 2 |
| Long | Entry Rules | Line 1 is above X | MACD Histogram | 0 (zero) |
| Entry Rules | Line 1 is above X | RSI | 70 | |
| Short | Entry Rules | Line 1 is below X | MACD Histogram | 0 (zero) |
| Entry Rules | Line 1 is below X | RSI | 30 |
Here the trading system is made up of Entry Rules only. This is a mistake because you've only told ATM when to place an order. You have not told it where to put that order. And you have not told it where to put the initial stop loss.
Assuming the stop loss will move
| Direction | Rule Type | Rule Family | Line 1 | X / Line 2 |
| Long | Entry Rules | Line 1 is above X | MACD Histogram | 0 (zero) |
| Entry Rules | Line 1 is above X | RSI | 70 | |
| Entry Values | Enter At Market | |||
| Initial S/L Values | LOW - 0.0050 (low minus 50 pips) |
|||
| Short | Entry Rules | Line 1 is below X | MACD Histogram | 0 (zero) |
| Entry Rules | Line 1 is below X | RSI | 30 | |
| Entry Values | Enter At Market | |||
| Initial S/L Values | HIGH + 0.0050 (high plus 50 pips) |
Here you have satisfied the 3 mandatory fields - the Entry Rules, Entry Values, and Initial Stop Loss Values. And because all the mandatory fields are filled in, ATM will place orders for you.
However, unless you want to do the trade management manually (which is fine), then the stop loss will never move. Maybe you thought that the above settings would "automatically" create a trailing stop loss. But the thing to realise is that the Initial Stop Loss Value is just that - an initial value.
If you want the stop loss to move after the trade has been opened, you need to put in Stop Loss Management Rules and Values as well. See here for a simple trailing stop.
Alternatively, or as well, adding a take profit is the other way to give you a chance of making money. See here for a simple take profit.
Forgetting that ATM will do exactly as you tell it
Let's say you want to enter a long trade when a fast SMA crosses from below to above a slow SMA (and vice versa for shorts):
| Direction | Rule Type | Rule Family | Line 1 | X / Line 2 |
| Long | Entry Rules | Line 1 is above Line 2 | SMA(20) | SMA(50) |
| Entry Values | Enter At Market | |||
| Initial S/L Values | LOW - 0.0050 | |||
| Initial T/P Values | HIGH + 0.0075 | |||
| Short | Entry Rules | Line 1 is below Line 2 | SMA(20) | SMA(50) |
| Entry Values | Enter At Market | |||
| Initial S/L Values | HIGH + 0.0050 | |||
| Initial T/P Values | LOW - 0.0075 |
This is close, but not quite. Following the rule of "ATM will do exactly as you tell it", hopefully you can see that you have not set up a cross-over at all. You have only told it to enter Long whenever the SMA(20) is above the SMA(50) - not necessarily that the previous bar had the SMA(20) below the SMA(50).
You need one more rule to complete the cross-over aspect, as demonstrated in this cross-over example.
Mismatching #1, #2, etc
There are Stop Loss Management Rules and Values #1-#9, and Take Profit Management Rules and Values #1 & #2. This gives you nine different ways to move the stop loss (plus the Move To Break Even settings makes 10), and two ways to move the take profit.
You don't have to use those Rules and Values in any kind of order. You can use Stop Loss Management Rules and Values #7 if you want, without having anything for Stop Loss Management Rules and Values #1 through #6.
However, if you are going to use Stop Loss Management Rules #7, then you need to use Stop Loss Management Values #7 as well. It's no good to use Rules #7 with Values #1, for example. See the Decision Flowchart for more detail.
Not putting both rules *and* values
The Rules specify when to do something. The Values specify where to do it. One without the other leaves ATM with only half the information it needs.
The only exception to this rule are the Move To Break Even Rules. There are no Values required with this one because the Value is going to be the entry price (i.e. the break-even point).
Putting the stop loss on the wrong side of the entry
Should the initial stop loss be on the wrong side of the entry price, ATM will not place the order.
To be specific, the initial stop loss for a Long order must be below the entry price. For a short order, the initial stop loss must be above the entry price.
Here's an example of a system set up incorrectly:
| Direction | Rule Type | Rule Family | Line 1 | X / Line 2 |
| Long | Entry Rules | Line 1 is above X | MACD Histogram | 0 (zero) |
| Entry Rules | Line 1 is above X | RSI | 70 | |
| Entry Values | Enter At Market | |||
| Initial S/L Values | LOW - 0.0050 | |||
| Initial T/P Values | HIGH + 0.0075 | |||
| Short | Entry Rules | Line 1 is below X | MACD Histogram | 0 (zero) |
| Entry Rules | Line 1 is below X | RSI | 30 | |
| Entry Values | Enter At Market | |||
| Initial S/L Values | LOW - 0.0050 | |||
| Initial T/P Values | HIGH + 0.0075 |
The Long settings are fine - the initial stop loss will be put below the entry, and the initial take profit will be put above. But it's the last 2 entries which are incorrect. The Short settings, most likely copied hastily from the Long, are also putting the initial stop loss below the entry price, and initial take profit above. That's the wrong way for shorts. So in this case this system will place Long orders, but will not place Short orders.
Hedging (on purpose or not)
You can hedge if you want, but if your account does not allow hedging then you need to do it in two different accounts. See how to hedge.
This goes for inadvertent hedging as well - where you don't purposely set out to hedge, but your trading systems ends up in both a long and short trade at the same time.
If there's any doubt in your mind about whether your system may allow inadvertent hedging, just follow the steps in that "how to hedge" post mentioned above.
Common Error Messages
ATM is merely the glue which holds a whole bunch of other things together, with those other things all made by different companies. For this reason, we don't always control the error message that you see, and those error messages aren't always clear as to what went wrong. If the below doesn't help you out, please use the forums.
Miscellaneous
Unicode byte order mark
When importing a trading system or alert, you might get an error like this: "There is no Unicode byte order mark. Cannot switch to Unicode."
Trading systems and alerts are exported as text files, but text files in unicode format. Opening it in notepad, then saving, may revert the file to ANSI (ASCII) text. The Unicode byte order mark is an invisible character put at the start of the file to indicate that it is indeed Unicode. When it was accidentally saved as ANSI, that Unicode byte order mark character was blown away.
But the technical details don't really matter - all that matters is how to fix it. What you need to do, is open the file using Notepad, and click "Save As" from the main menu. In that "Save As" window, at the bottom, change the encoding to "Unicode". Not "Unicode (big endian)" - just "Unicode". Then save. And then try to import again.
Sending Emails
If you get an error like this when sending an email:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at...
Check that you have typed in your password correctly for the outgoing email address.
Error Messages From Oanda
Any single word error message ending in "Exception" comes from Oanda. For example, "RateTableException", or "SessionException".
Here's what the Oanda help file says about each. The description is not always so helpful:
| Error | Description |
| AccountBusyException | AccountBusyException is thrown when the server responds with this message. |
| AccountException | AccountException is the base exception thrown by any Account object function. |
| CurrencyException | CurrencyException is thrown if an invalid currency pair is used in an Account function. |
| InvalidDurationException | Thrown if order duration is not valid. |
| InvalidLimitsException | Thrown if price bounds are not valid. |
| InvalidOrderException | InvalidOrderException is thrown if a non-existant order is modified or closed. |
| InvalidPriceException | Thrown if invalid execution price is set. |
| InvalidUnitsException | Thrown if invalid number of units is set. |
| InvalidUserException | Thrown if invalid username or password. |
| NSFException | NSFException is thrown if an insufficient balance exists to complete an account function. |
| OrderException | (no description given) |
| PairNotFoundException | PairNotFoundException is thrown if the currency pair can not be found in rate table. |
| RateTableException | (no description given) |
| SessionException | A SessionException is thrown by any object in a session context. |
In addition to the above, there is also this kind of error message given by the Oanda API:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Oanda.Account.modify(Account* , MarketOrder* )
at fxClientAPI.Account.Modify(MarketOrder trade)
at [...and so on]
Oanda does not allow hedging. Preliminary evidence suggests that the cause of this error is that you already have a trade open, and are trying to open another trade going in the opposite direction (i.e. your trading system is trying to hedge, either on purpose or not).
There is a workaround. See this section - "How to Hedge"
Error Messages From Gain Capital
Text in the "Description" fields copied from a thread in the Gain Capital forum:
| Error | Description |
| 1 - General input parameter error | Problem with what we have passed through, Serious Error needing programming investigation. However, if it was a once only could be a network error. The trade was not opened therefore we would not expect to see an open position. |
| 2 - Authentication error | Problem with Authentication of security, if it is the first time we connected, then we need to check passwords etc. If this occurs after we have had several successful connections, and then we assume that this is a problem with the Authentication server taking too long to respond. So try again a little later. We would not expect to see an open position after this error. |
| 3 - Stop Loss Order rate must be > current offer rate | Placing a stop-loss order was too close to the current rate. We need to adjust our stop-loss further away from the market. The order was not placed so we should try again with a better price. |
| 4 - Limit Order rate must be < current offer rate | Similiar to Error 3, except for a Limit order. |
| 5 - Over maximum order amount | We have attempted to purchase more lots than our account allows. |
| 6 - Order rate must be within 1000 points | As per the error message. You can't place an order more than 1000 pips from the current price. |
| 7 - Record not found | This occurs when trying to cancel an order. We would expect that this has occured because the order has just been filled, and hence we need to check our open positions. |
| 8 - Unable to complete request, the trading system is down for maintenance | This normally would occur during the daily rollover. The trading system is down, and hence no DealRequests or Orders could be handled by the system. Our response to this would be to try again later as the position was not opened. |
| 9 - Rate changed (That rate is not acceptable / off market) | The rate has changed since the last price that we received from the RateServer. Our response is to get the latest price and then try again (unless the price has moved too far). Following this error we would not expect to see an open position for this request. |
| 10 - Insufficient Margin | We have attempted to DealRequest which requires more margin than we currently have available in our account (which probably means that we have something wrong with our position sizing algorithms). We would investigate what open positions we have, and check our code. We would not expect that this would have opened additional positions. |
| 11 - A fatal error occurred processing your request; please check all positions and or contact the trading desk to confirm or deny the execution of this trade. | I believe this is a wacky error, when something has gone wrong with the API, and hence we need to stop trading temporarily and ring the trading desk to find out what is going on. There is no guarantees whether this opened a position successfully or not, therefore we ring the trading desk to find out. |
Account Numbers
When you create an account in ATM you have to enter an account number. Read below for what to enter, as it differs by broker.
FXCM
To find the account number, first log in to the FXCM trading platform. You should be able to see an "Accounts" section, with all your accounts listed there. For a demo account, there's probably only one account listed. Anyway, in that "Accounts" section, there should be an "Account" column. The value in that field is close to, but not the value you want to type into ATM.
First, if the account number has letters at the start, don't type them.
Second, if the account number has zeroes at the start, don't type them.
Third, if the number is longer than 8 digits, only type the last 8 digits.
So an account number like:
- 0012346 would be entered into ATM as 123456
- ABC000123456789 would be entered as 23456789
Oanda
To find the account number, first log in to the Oanda trading platform. Then from the main menu of that trading platform, click "Account", then choose "Change Account". You should now be able to see a list of your accounts. The number to enter in this field is the number in brackets. E.g. if it says something like "Primary (1234567)", then enter 1234567 in this field in ATM.
Gain Capital
Doesn't give out account numbers, so just enter 0 (zero).
Using The Entry Price Indicator
There is a custom indicator called "Special / Miscellaneous". And in that custom indicator family is an indicator called "Entry Price".
I guess normally you would use this indicator in conjunction with the add or multiply options - like:
- Entry price - 0.0050, which is 50 pips below the entry price for a currency like EUR/USD. Might be a good spot for a long stop loss; or
- Entry price * 1.025, which is the entry price plus 2.5%. Might be a good spot for a long take profit.
You need to know that this is more accurately referred to as the calculated entry price, if you use this indicator for the initial stop loss or initial take profit values.
For market orders
When placing market orders (which is what happens when you set the entry values to "enter at market"), there is no way to tell what the actual entry price is going to be. That's not ATM's fault, that's just the nature of market orders.
But ATM has to put a stop loss along with any orders it places, including market orders. So when you use this indicator for the initial stop loss or initial take profit, ATM has to make an assumption about the probable entry price.
ATM assumes that the entry price is going to be the same as the Open price of the most recent bar. (That is, there is the most recently completed bar that ATM uses to make its calculations, and then after that is the bar that is still in progress. ATM uses the Open of that in-progress bar as the probable entry price).
So let's say that the in-progress bar opened at 1.2500. And let's say you set the initial stop loss to be 100 pips below the entry price. Then, the initial stop loss will be set to 1.2400. Easy.
But, what if the actual entry price was 1.2501? Well, remember that the initial stop loss was set at the time of placing the market order, back when we had no idea what the actual entry price would be. Therefore, the initial stop loss is still going to be 1.2400, which is 101 pips below the actual entry.
Therefore, even though you specified that you want the stop loss to be a certain number of pips below the entry, it could in fact end up more (or less) than that when using "enter at market".
For limit orders
While there is far more likelihood that the calculated and actual entry prices will be the same, sometimes there is slippage. Slippage means that the broker couldn't get that exact price you wanted but rather your trade was opened a pip or two away from your preferred entry price. Therefore everything that was said for market orders applies almost equally to limit orders.
After Entry
This problem lies only with the initial stop loss and initial take profit values. After the trade is opened, of course we now know the exact entry price. So any other setting using the "entry price" indicator will be calculating using the correct value.
Moving A Take Profit That Wasn't There Initially
That is, you don't enter anything in the initial take profit values, but you do use the take profit management rules and values. So when the trade is opened, it doesn't have a take profit. But then at some point later your trading system tries to move it.
Using the take profit management rules and values is always ok if you use it to exit at market. This is because you're not actually moving a take profit - you're just closing the trade.
Otherwise, what's going to happen depends on the broker. Some allow a take profit to be added at a later date even if there wasn't one when the trade was opened. Other brokers don't allow it. Try it in a demo account.
Getting Your Alert To Fire
Most likely you are reading this article because your alert refuses to send you any notifications. So we will focus on the possible causes. Check these:
- Does your alert have at least one alerting rule?
- If there is more than 1 alerting rule, can they actually all be true at the same time?
- Is the alert's status set to "Enabled"?
- Is there a holiday attached that's preventing alerts?
- Are the settings on the "Frequency" tab set correctly?
- Have you set the frequency to stop after a certain number of alerts have fired, and that number has been reached?
- Are you sure that the alerting rules have been true at some point after starting alerting?
- Scheduled processes on the Command Centre:
- Have you started the price download and/or creation process? Is it working and new price bars are coming in? You can check this by using the Chart window or Price History Search window. If no then read this.
- Have you started the alerting process?
- Are the alerting tasks being processed without error? You can check this on the "Alerting Tasks" > "Completed List" tab. Scroll to the right-side of the result grid. Anything in the "Error Text" field is bad.
- Did you accidentally set the alert's "last bar used" dates or "last checked" date into the future? This will pause alerting until those dates are reached.
- Have you created at least one Broadcast Setting which matches the alert?
- Is it enabled?
- Is the address being sent to enabled?
- Is the address correct?
- On the Options window, have you enabled messages in general?
- Each time a message is broadcast, ATM Activity is logged. Search through that ATM Activity and check the results of the broadcast attempts. Error messages there will give more clues.
Graphical representation of the checklist
Here's what it kind of looks like graphically:
If it still doesn't work
If your alert still refuses to fire, you will need to seek advice in the forum. Give as much information as you can. An exported version of your alert would be ideal. If you are worried about your privacy, then make a copy of your alert. Edit the copy, delete the private stuff, and maybe make a generic version of your alert that still displays the same problem but doesn't give away your special sauce. Export that one instead.
Screenshots are also good. We've found that glancing through these screenshots, it takes about 20 seconds to diagnose the problem. Without the screenshots or the exported alert it takes a lot longer.
Getting Your Trading System To Trade - Autotrading
The first step is to make sure you understand about rules and values.
the second step is to make sure your trading system has the minimum required rules and values.
Now, most likely you are reading this article because even though you have read and implemented the above, your trading system refuses to make any trades in your account. So now we will focus on the possible causes. The first step is to diagnose where the problem exactly is.
And this is actually quite simple. Just backtest over a decent number of bars - enough so that at least a few trades should be taken. More is better. The backtest results will fall into one of 3 scenarios:
- No trades are made at all.
- Trades are made initially, but then stops.
- Trades are made often, as you expect.
For the first 2 scenarios, the things to check are listed in the corresponding entry for getting a trading system to trade - backtesting.
Once you trading system does exactly as you expect while backtesting, come back here and finish this checklist.
Trades normally
If your backtest results show trades taken as you expected, then the problem is not with your trading system, but with some other setting related to connecting to your broker. Check these:
- Do you have an account yet? If no then read this.
- Is the trading system's status set to "Enabled"?
- Are all other settings on the "Auto-trading" tab set correctly? And the account balance is above the minimum setting there?
- With the account(s) you chose to trade in:
- Make sure your account balance is enough to purchase the number of units that the system wants to buy.
- Is the account number entered correctly?
- Is the password for the user who owns that account entered correctly?
- Have you installed the API for that broker?
- Is there a holiday attached that's preventing new orders?
- Are the settings on the "Frequency" tab set correctly?
- Have you set the frequency to stop after a certain number of checks, and that number has been reached?
- Are you sure that the entry rules have been true at some point after starting auto-trading?
- Scheduled processes on the Command Centre:
- Have you started the price download and/or creation process? Is it working and new price bars are coming in? You can check this by using the Chart window or Price History Search window. If no then read this.
- Have you started the auto-trading process?
- Are the auto-trading tasks being processed without error? You can check this on the "Automated Trading Tasks" >> "Completed List" tab. Scroll to the right-side of the result grid. Anything in the "Error Text" field is bad.
- Did you accidentally set the trading system's "last bars used" dates or "last checked" date into the future? This will pause trading until those dates are reached.
- Is it possible that trades are being opened, but just ATM's trade and order information is out of date? Check your account through your broker's platform instead. If trading is taking place, then it's all good and read this.
Graphical representation of the checklist
Here's what it kind of looks like graphically:
If it still doesn't work
If your trading system still refuses to trade, you will need to seek advice in the forum. Give as much information as you can. An exported version of your trading system would be ideal. If you are worried about your privacy, then make a copy of your trading system. Edit the copy, delete the private stuff, and maybe make a generic version of your system that still displays the same problem but doesn't give away your special sauce. Export that one instead.
Screenshots are also good. We've found that glancing through these screenshots, it takes about 20 seconds to diagnose the problem. Without the screenshots or the exported system it takes a lot longer.
If The Font Size Is Too Big Or Too Small
Here's what a customer wrote to me:
In the screens of my ATM installation the text is truncated, either vertically, horizontally or both. It is as if the text is too large for the space allocated for it. I have tried changing my screen resolution but the same thing happens.
In Windows XP Help, there is a solution named: "To increase or decrease the size of objects and text on your screen". My DPI setting (Control Panel > Display > Settings > Advanced > General) was wrong and was set to: "Large size (120 DPI)". When I used the "Normal size (96 DPI)" setting, ATM screens appeared as they should.
On my 17", Dell Inspiron 9400 notebook I then found that - in Control Panel > Display > Appearance - I had to also make sure the Font size was set to normal. If that was changed to large, to compensate for the small text in the Start Menu, Windows Explorer etc., I got a ATM result between the unusable original and the optimum.
Or here's another possible solution:
http://blogs.msdn.com/noahc/archive/2008/06/23/embedded-ie-text-size-too-small-or-large.aspx
The Chart Window Won't Open
This may come about if you install ATM once, install either the same or different version again into a different location, then uninstall either of those. The error message maybe something like:
Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.
Here's what happens:
- Install ATM - registers charting component
- Install ATM again in a different directory - registers charting component
- Uninstall either of those - unregisters charting component
You are now left with one installation of ATM, but the charting component is unregistered. All you have to do, is re-register it.
Click the Windows Start button at the lower left-hand corner of your screen. In XP and below, click "Run...". In Vista and above, search for "Run", then right-click on the "Run" icon and select "Run as administrator".
A little box appears.
Type or copy and paste the following, exactly, in the field in that little box:
REGSVR32 "c:\Program Files\Thinking Stuff\ATM v3.0.0\StockChartX.ocx"
The quotation marks are necessary. You may also need to alter the installation directory.
And then press the Enter key, or click the Ok button.
Now that's done, try to open the Charts window again. The fact that it opens at all is a sign of success. If it still does not work, check the directory is correct.
You get an error message regarding mscoree.dll
You need to have the .NET Framework installed, v2.0 at a minimum. Vista and above have the framework already. For earlier versions of windows, the ATM installer should have asked you if you wanted to also install the .NET Framework.
You could uninstall ATM and run the installer again, this time opting to also install the framework. Or you can download the latest version of the framework from Microsoft and install it yourself. (v2.0 is the minimum required version, but you should get the most recent version that is compatible with your version of Windows). ATM should then work after a reboot of your computer.
Recent blog posts
- Mid July 2010 Update
- Start of June 2010 Update
- New Release: v3.0.2 - Copy, better error message, more options
- New Release: v3.0.1 - The Stabilise-ening
- Ah, The First Bug [Fixed in v3.0.1]
- New Release: v3.0.0 - The Rewrite
- Start of February 2010 Update
- End Of 2009 Update
- New Release: v2.0.10
- New Release: v2.0.9 - Free



Recent comments
1 week 3 days ago
2 weeks 3 days ago
2 weeks 3 days ago
2 weeks 3 days ago
2 weeks 4 days ago
2 weeks 4 days ago
2 weeks 4 days ago
4 weeks 6 days ago
9 weeks 4 days ago
9 weeks 5 days ago