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...
Trading systems
The Current Bar and Bar Offset
To clarify what the "current", or "most recently completed" bar is:
- Look at a chart.
- Make sure the chart is scrolled all the way to the right.
- Point at the right-most bar. This bar is still being made. It's not complete.
- Point at the bar just to the left of the right-most bar. That's the most recently completed bar.
ATM uses the most recently completed bar for its calculations.
Bar Offset
The "bar offset" is the number of bars before the current bar. So a bar offset of zero refers to the current bar itself (the default). A bar offset of 1 means the bar before the current bar. A bar offset of 2 means the bar before that. And so on.
When you create a rule and use a bar offset greater than zero, ATM steps back that number of bars and does its calculations as of the situation as it was back then.
The bar offset is most often used when looking for when one line crosses another. This event is often used for trading signals. To check for such a cross, 2 rules are needed: (1) check that line 1 was under line 2; and then (2) check that line 1 is now above line 2.
Rule (1) has to use a bar offset of 1 to check what the situation was 1 bar ago. Rule (2) uses the bar offset of zero to check what the current situation is.
Multiple Timeframes
Rules and values can all use the same interval, e.g. Hourly bars. Like this:
- Rule 1 does its calculations with EURUSD/Hourly/FXCM
- Rule 2 does its calculations with EURUSD/Hourly/FXCM
- Rule 3 does its calculations with EURUSD/Hourly/FXCM
Or they can all use different intervals, e.g. some use 5-Minute bars, others 20-Minute bars, and others Hourly. Like this:
- Rule 1 does its calculations with EURUSD/5-Minute/FXCM
- Rule 2 does its calculations with EURUSD/20-Minute/FXCM
- Rule 3 does its calculations with EURUSD/Hourly/FXCM
In fact ATM doesn't really care where the prices came from. This is also possible:
- Rule 1 does its calculations with EURUSD/5-Minute/FXCM
- Rule 2 does its calculations with EURUSD/20-Minute/Oanda
- Rule 3 does its calculations with EURUSD/Hourly/Gain Capital
And finally, not all rules need to check the same symbol:
- Rule 1 does its calculations with EURUSD/5-Minute/FXCM
- Rule 2 does its calculations with USDNZD/20-Minute/Oanda
- Rule 3 does its calculations with GBPJPY/Hourly/Gain Capital
So you can make trading decisions in one symbol based on what a different symbol is doing. In fact in this last scenario you can do the actual trading in yet another symbol if you like - it doesn't have be any of EURUSD, USDNZD, nor GBPJPY.
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.
How To Hedge
Most brokers do not allow hedging. For example, first open a long trade of 100,000 units, and then open a short trade of 70,000 units. With hedging not allowed you get this result:
- Long - 30,000 units
- Short - no open trade
Opening a short trade of 70,000 units in this case has the same effect of selling off 70,000 of our long units. However with hedging you get this result:
- Long - 100,000 units
- Short - 70,000 units
Hedging keeps long and short trades separate, which is how ATM likes it. If ATM opens a trade of 100,000 units, it expects to close a trade of 100,000 units. In the first example ATM would think it has 2 trades open - 1 long one for 100,000 units, and 1 short one for 70,000 units. But at the broker the reality is that there is just 1 long trade of 30,000 units.
So, how to hedge with a broker that doesn't allow hedging? Open two accounts. In account #1 you do all your long trades, and in account #2 you do all your short trades.
Multiple Rules Or Values
Multiple rules
All rules must be true for an action to be allowed.
With entry rules (and alerting rules for alerts) you can use the "group" settings to create optional entry rules.
Multiple values
This is also allowed, but the meaning of having multiple values is less obvious than the meaning of having multiple rules.
What will happen is that each value will calculated to a single number. If one of the values is "exit at market", that overrides all other settings. Otherwise with long stop losses the highest number is used, and with short stop losses the lowest is used.
It's the same with the take profit management settings. Generally take profits don't move so much, but you have two ways to move them if you want. Again, "exit at market" overrides all other settings, otherwise with long take profits the lowest number is used, and with short take profits the highest is used.
Please note that stop losses will never be moved to a position of increased risk. That is, for long trades, the stop loss will never move down. And for short trades, the stop loss will never move up. Take-profits can move wherever they like.
See also:
Stop Loss Mgmt #1-#9, Take Profit Mgmt #1, #2
These settings give you nine different ways to move your stop loss (plus the "move to break even" setting makes 10), and two different ways to move your take profit.
The ordering of #1 through #9 has no meaning - they are just labels. You can use #7 without first having set #1 through #6, if that's what you want to do. Just make sure to match up rules #7 with Values #7.
So let's say you have set up stop loss rules and values #2, #6, and #7. And by a freak of coincidence, absolutely all of those rules are true at the same time. Potentially that means the trading system wants to move the stop loss to 3 different prices, or perhaps to 2 different prices and the last is "exit at market".
ATM can only do one of those things. In this case it follows the same decision-making process as when you use multiple values in the same group (e.g. 3 different entry values).
Entering At Market
You can set the entry values to "enter at market". That creates a market order. Otherwise, the entry values evaluate to a single number (that is to say that the desired entry price is calculated) and a limit order is placed at that price. "Enter at market" overrides all other values.
Exiting At Market
Any of the stop loss management values (#1 through #9), and any of the take profit management values (#1 & #2) can be used to "exit at market". As long as the corresponding rules evaluate to true, the trade will be closed. "Exit at market" overrides all other values.
See also:
Rules and Values
Trading systems
Rules specify when some trading action is to take place; values specify where.
Rules and values - where you have one, you always need both.
For example, it's optional to specify stop loss management rules. But if you do, you also have to specify a stop loss management value (and vice versa). The former tells ATM when it should move the stop loss; the latter at what price to move it to.
Here's the full list:
| Category | Stage | Description |
| Entry | Entry Rules | Specify when you are allowed to trade. All rules (if there are more than one) must evaluate to true for an order to be placed. Use groups to set up optional entry rules. |
| Entry Values | If the Entry Rules allow an order to be placed, the Entry Values specify the entry price for the order. "Enter At Market" creates a market order. Any other setting creates a limit order. | |
| Initial Stop Loss Value | If the Entry Rules allow an order to be placed, the Initial Stop Loss Values specify the initial stop loss price for the order. | |
| Initial Take Profit Value | If the Entry Rules allow an order to be placed, the Initial Take Profit Values specify the initial take profit for the order. | |
| Stop Loss Management | Move To Break-Even (Rules) | Once in a trade, these Rules determine when the stop loss will be moved to a position of break-even. (More correctly, to where the entry price was, because commission is not included in the calculation). As the where is already known (i.e. the entry price), there are no matching Values required in this one case. |
| Stop Loss Mgmt Rules | Once in a trade, the Stop Loss Management Rules determine whether or not the stop loss will be moved. All rules must evaluate to true for the stop loss to be moved. There are 9 different groups (#1-#9) for stop loss management. | |
| Stop Loss Mgmt Value | If the Stop Loss Mgmt Rules allow the stop loss to be moved, the Stop Loss Management Values specify where the stop loss will be moved to. Make sure to match up the numbers (#1-#9) to the rules. A stop loss will never be moved to a position of increased risk though. That is, a stop loss can only go up for long trades, and only down for short trades. "Exit At Market" can be used here. | |
| Take Profit Management | Take Profit Mgmt Rules | Once in a trade, the Take Profit Management Rules determine whether or not the take profit will be moved. All rules must evaluate to true for the take profit to be moved. There are 2 different groups (#1, #2) for take profit management. |
| Take Profit Mgmt Value | If the Take Profit Mgmt Rules allow the take profit to be moved, the Take Profit Management Values specify where the take profit will be moved to. Make sure to match up the numbers (#1, #2) to the rules. A take profit can be moved up or down for both long and short trades. "Exit At Market" can be used here. |
Each of the above can be used for both the Long and Short directions.
You can have multiple rules, of course. But less obvious is that you can also have multiple values.
See also:
- What determines a complete trading system
- Stop Loss Mgmt #1-#9, Take Profit Mgmt #1, #2
- Multiple timeframes
- Trading decision flowchart
Alerts
Alerts have only alerting rules - there are no values to worry about. This is because alerts only need to know when to send you a notification.
Normally all alerting rules must be true for alert to fire. However, you can use groups to set up optional alerting rules.
What Defines A Complete Trading System
There are many different combinations which make up a "complete" trading system. The most basic trading system is to have one entry rule, one entry value, and one initial stop loss value.
While that is technically "complete", it's not much of a system. Generally your trading system will fall into one of two categories:
- Where you set both a stop loss and a take profit, and wait for one or the other to be hit; or
- Where you set only a stop loss, but you gradually move that stop loss to lock in profit. Your stop loss will be taken out at some point, but you hope that by that time it would have moved above your initial entry price.
In keeping with that theory, here is what makes up a complete trading system. Either:
- Entry rules, entry values, initial stop loss values, initial take profit values; or
- Entry rules, entry values, initial stop loss values, stop loss management rules, stop loss management values.
With both of those, you are free to add any other settings you like. Of course you can combine the two methods of making money by having both a trailing stop loss and take profit set. But the above are the minimum requirements for orders to be placed, and to give at least a chance of making a profit.
Systems which only go long, or which only go short, are completely acceptable.
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.
Getting Your Trading System To Trade - Backtesting
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 is not opening trades during the backtest. So now we will focus on the possible causes.
Firstly, are you sure that the test has enough price bars in it for the entry rules to be checked? If you have a moving average of period 200 in the rules, then you need at least 200 price bars to backtest with.
Secondly, are you sure that the entry rules can be true at some point during the test?
With that out of the way, now we focus on the results of the backtest. How the system behaved during the backtest 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.
1. No trades
This is an indication that your trading system is not set up correctly. Try these:
- Are you sure that you have corresponding values for all the rules?
- Are you sure that you have the minimum required rules and values?
- Do you have any rules which will never be true together? E.g. one entry rule says to enter when the close is above the moving average, while another entry says to enter when the close is below the moving average.
- Long trading - make sure the stop loss will work out to be lower than the entry price.
- Long trading - make sure the take profit (if set) works out to be higher than the entry price.
- Short trading - make sure the stop loss will work out to be higher than the entry price.
- Short trading - make sure the take profit (if set) works out to be lower than the entry price.
- Make sure your account balance is enough to purchase the number of units that the system wants to buy.
Once you have fixed any problems, run the backtest again and start the checklist from the beginning.
2. Trades initially, but then stops
The first thing to check is your account balance. If the trades that were made ended up in your balance falling and falling, then eventually there won't be enough balance to make any more trades. This is expected behaviour and in fact the only thing that's wrong is that your system is a dud :-)
If that is not the case, then most likely the cause is related to the "No Trading" settings. These settings can interfere with each other so that after a few trades no further trades are possible. Here's an example:
- Allow up to and including 2 long trades in a row.
- There must be 3 long trades in a row before allowing short trades or orders.
Taken together, it means there will be 2 long trades and then nothing more. After those 2 long trades, the first rule disallows any further long trades until a short. And the second rule is still waiting on another long trade before it allows any shorts.
Once you have fixed any problems, run the backtest again and start the checklist from the beginning.
3. Trades normally
If your backtest results show trades taken as you expected, then that is problem solved if all you wanted to do was backtest. If however you are reading this article because you are unsuccessfully trying to auto-trade, head to the corresponding entry for getting a trading system to trade - autotrading.
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.
Recent blog posts
- New Release: v3.0.3 - Everything Except Autotrading
- 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


Recent comments
4 weeks 4 days ago
4 weeks 4 days ago
7 weeks 3 days ago
8 weeks 2 days ago
8 weeks 3 days ago
8 weeks 3 days ago
8 weeks 3 days ago
8 weeks 4 days ago
8 weeks 4 days ago
10 weeks 6 days ago